]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
Fix up QA tests for mkfs behaviour changes
authorBarry Naujok <bnaujok@sgi.com>
Wed, 19 Mar 2008 03:18:01 +0000 (03:18 +0000)
committerBarry Naujok <bnaujok@sgi.com>
Wed, 19 Mar 2008 03:18:01 +0000 (03:18 +0000)
Merge of master-melb:xfs-cmds:30689a by kenmcd.

  Force the agcount to 6 to keep behaviour the same as old and new

030
078
178

diff --git a/030 b/030
index e488ee2d98c8cca8bc55f253a5dae0c1cc88bfc7..e384658f9fb16fabfa5c38c253306a1ccbd717da 100755 (executable)
--- 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 b6572eaea9db27b5bcac8bef665ca15d9961855a..623bcc9d655705b9f6d9c94ca62e4bb8a7fa6b65 100755 (executable)
--- 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 f204611cd3693960aa4e1c329088cdf95844c6bf..2c0293ee0d6e49b7cb789f7791e6f1cc944364de 100755 (executable)
--- 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