From 6a4b036c2f2b470fe5a78ffb9d06c55d10c2ba7c Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 8 Oct 2010 15:03:21 +0000 Subject: [PATCH] Update script for fsadm testing --- WHATS_NEW | 1 + test/t-fsadm.sh | 119 +++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 109 insertions(+), 11 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 093fd40eb..01243c32f 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.75 - ===================================== + Update script for fsadm testing. Better support of noninteractive shell execution of fsadm. Fix usage of --yes flag for ReiserFS resize in fsadm. Fix detection of mounted filesystems for fsadm when udev is used. diff --git a/test/t-fsadm.sh b/test/t-fsadm.sh index 6cff7c544..b89e457da 100644 --- a/test/t-fsadm.sh +++ b/test/t-fsadm.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (C) 2008 Red Hat, Inc. All rights reserved. +# Copyright (C) 2008-2010 Red Hat, Inc. All rights reserved. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions @@ -9,17 +9,114 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +test_description='Exercise fsadm filesystem resize' + . ./test-utils.sh -exit 200 -# doesn't work right now -aux prepare_pvs 2 -aux pvcreate --metadatacopies 0 $dev1 -vgcreate -cn $vg $devs +aux prepare_vg 1 100 + +# set to "skip" to avoid testing given fs and test warning result +# i.e. check_reiserfs=skip +check_ext3= +check_xfs= +check_reiserfs= + +which mkfs.ext3 || check_ext3=${check_ext3:=mkfs.ext3} +which fsck.ext3 || check_ext3=${check_ext3:=fsck.ext3} +which mkfs.xfs || check_xfs=${check_xfs:=mkfs.xfs} +which xfs_check || check_xfs=${check_xfs:=xfs_check} +which mkfs.reiserfs || check_reiserfs=${check_reiserfs:=mkfs.reiserfs} +which reiserfsck || check_reiserfs=${check_reiserfs:=reiserfsck} + +vg_lv="$vg/$lv1" +dev_vg_lv="$DM_DEV_DIR/$vg_lv" +mount_dir="$TESTDIR/mnt" + +test ! -d $mount_dir && mkdir $mount_dir + +cleanup_mounted_and_teardown() +{ + umount $mount_dir || true + teardown +} + +fscheck_ext3() +{ + fsck.ext3 -p -F -f $dev_vg_lv +} + +fscheck_xfs() +{ + xfs_check $dev_vg_lv +} + +fscheck_reiserfs() +{ + reiserfsck --check -p -f $dev_vg_lv