From: Barry Naujok Date: Wed, 19 Mar 2008 03:18:01 +0000 (+0000) Subject: Fix up QA tests for mkfs behaviour changes X-Git-Tag: v1.1.0~410 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3768e3b4ad00dd2ff02379cf98d249d3ff3336b9;p=xfstests-dev.git Fix up QA tests for mkfs behaviour changes Merge of master-melb:xfs-cmds:30689a by kenmcd. Force the agcount to 6 to keep behaviour the same as old and new --- diff --git a/030 b/030 index e488ee2d..e384658f 100755 --- a/030 +++ b/030 @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _link_out_file $seq.out # nuke the superblock, AGI, AGF, AGFL; then try repair the damage -# +# _check_ag() { for structure in 'sb 0' 'agf 0' 'agi 0' 'agfl 0' @@ -52,7 +52,7 @@ _supported_os IRIX Linux _require_nobigloopfs _require_scratch -DSIZE="-dsize=100m" +DSIZE="-dsize=100m,agcount=6" # first we need to ensure there are no bogus secondary # superblocks between the primary and first secondary diff --git a/078 b/078 index b6572eae..623bcc9d 100755 --- a/078 +++ b/078 @@ -36,7 +36,7 @@ _cleanup() _supported_fs xfs _supported_os Linux -# Must have loop device +# Must have loop device _require_loop LOOP_DEV=$TEST_DIR/$seq.fs @@ -59,13 +59,19 @@ _grow_loop() new_size=$2 bsize=$3 check=$4 + agsize=$5 + + dparam="file,name=$LOOP_DEV,size=$original" + if [ -n "$agsize" ]; then + dparam="$dparam,agsize=$agsize" + fi echo echo "=== GROWFS (from $original to $new_size, $bsize blocksize)" echo echo "*** mkfs loop file (size=$original)" - /sbin/mkfs.xfs -bsize=$bsize -dfile,name=$LOOP_DEV,size=$original \ + $MKFS_XFS_PROG -b size=$bsize -d $dparam \ | _filter_mkfs 2>/dev/null echo "*** extend loop file" @@ -75,13 +81,13 @@ _grow_loop() echo "*** grow loop filesystem" #xfs_growfs $LOOP_MNT 2>&1 | grep -e "^data" #| _filter_growfs 2>/dev/null - xfs_growfs $LOOP_MNT 2>&1 | _filter_growfs 2>&1 + $XFS_GROWFS_PROG $LOOP_MNT 2>&1 | _filter_growfs 2>&1 echo "*** unmount" umount $LOOP_MNT # Large grows takes forever to check.. - if [ "$check" -gt "0" ] + if [ "$check" -gt "0" ] then echo "*** check" _check_xfs_filesystem $LOOP_DEV none none @@ -95,7 +101,7 @@ _grow_loop 168024b 1376452608 4096 1 # Some other blocksize cases... _grow_loop 168024b 1376452608 2048 1 -_grow_loop 168024b 1376452608 512 1 +_grow_loop 168024b 1376452608 512 1 16m _grow_loop 168024b 688230400 1024 1 diff --git a/178 b/178 index f204611c..2c0293ee 100755 --- a/178 +++ b/178 @@ -25,12 +25,12 @@ _cleanup() rm -f $tmp.* } # dd the 1st sector then repair -_dd_repair_check() +_dd_repair_check() { #dd first sector dd if=/dev/zero of=$1 bs=$2 count=1 2>&1 | _filter_dd #xfs_repair - _scratch_xfs_repair 2>&1 | _filter_repair + _scratch_xfs_repair 2>&1 | _filter_repair #check repair if _check_scratch_fs; then echo "repair passed" @@ -47,14 +47,14 @@ _dd_repair_check() # real QA test starts here # Modify as appropriate. -_supported_fs xfs +_supported_fs xfs _supported_os Linux # From the PV # o Summary of testing: # 1. mkfs.xfs a default filesystem, note agcount value. # 2. dd zero first sector and repair and verify. -# 3. mkfs.xfs overriding agcount to a smaller value +# 3. mkfs.xfs overriding agcount to a smaller value # (ie. each AG is bigger) # 4. dd zero first sector, repair and verify. # -> old mkfs.xfs will cause repair to incorrectly @@ -64,11 +64,16 @@ _require_scratch _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs \ || _fail "mkfs failed!" -# By executing the followint tmp file, will get on the mkfs options stored in +# By executing the followint tmp file, will get on the mkfs options stored in # variables . $tmp.mkfs -[ $agcount -le 2 ] && _notrun "Test requires more than 2 AGs." +# if the default agcount is too small, bump it up and re-mkfs before testing +if [ $agcount -lt 8 ]; then + agcount=8 + _scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 \ + || _notrun "Test requires at least 8 AGs." +fi _dd_repair_check $SCRATCH_DEV $sectsz