xfstests 223: reinitialize MKFS_OPTIONS
authorBoris Ranto <branto@redhat.com>
Thu, 18 Nov 2010 02:44:57 +0000 (20:44 -0600)
committerEric Sandeen <sandeen@sandeen.net>
Thu, 18 Nov 2010 02:44:57 +0000 (20:44 -0600)
Test case 223 constantly fails because the variable carrying mkfs
options is not being reinitialized.

Test calls function _scratch_mkfs_geom repeatedly in for loop without
cleaning the MKFS_OPTIONS variable. Since _scratch_mkfs_geom only
appends options to the variable, MKFS_OPTIONS looks like this in 5th
iteration:
MKFS_OPTIONS="-bsize=4096-b size=4096 -d su=8192,sw=4-b size=4096 -d
su=16384,sw=4-b size=4096 -d su=32768,sw=4-b size=4096 -d
su=65536,sw=4-b size=4096 -d su=131072,sw=4"

It is also easy to see that _scratch_mkfs_geom does not append leading
space when it appends the variable.

Following patch fixes the issue for me and based on my testing does not
break any other test case:

Signed-off-by: Boris Ranto <branto@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
223
common.rc

diff --git a/223 b/223
index cf498ae441c10b44c9723e505bde9cf9ec9c74fe..2e0a2451179141ea0b8ca146f9d55f0c8d4617ec 100755 (executable)
--- a/223
+++ b/223
@@ -58,6 +58,7 @@ for SUNIT_K in 8 16 32 64 128; do
        let SUNIT_BLOCKS=$SUNIT_BYTES/$BLOCKSIZE
 
        echo "=== mkfs with su $SUNIT_BLOCKS blocks x 4 ==="
        let SUNIT_BLOCKS=$SUNIT_BYTES/$BLOCKSIZE
 
        echo "=== mkfs with su $SUNIT_BLOCKS blocks x 4 ==="
+       export MKFS_OPTIONS=""
        _scratch_mkfs_geom $SUNIT_BYTES 4 $BLOCKSIZE >> $seq.full 2>&1
        _scratch_mount
 
        _scratch_mkfs_geom $SUNIT_BYTES 4 $BLOCKSIZE >> $seq.full 2>&1
        _scratch_mount
 
index 760b883eb24078ec3bf57a390968e7b71f9ce72e..a5db913ad020762ef3ff5e9c7593392b01bb5362 100644 (file)
--- a/common.rc
+++ b/common.rc
@@ -349,10 +349,10 @@ _scratch_mkfs_geom()
 
     case $FSTYP in
     xfs)
 
     case $FSTYP in
     xfs)
-       MKFS_OPTIONS+="-b size=$blocksize, -d su=$sunit_bytes,sw=$swidth_mult"
+       MKFS_OPTIONS+=" -b size=$blocksize, -d su=$sunit_bytes,sw=$swidth_mult"
        ;;
     ext4)
        ;;
     ext4)
-       MKFS_OPTIONS+="-b $blocksize -E stride=$sunit_blocks,stripe_width=$swidth_blocks"
+       MKFS_OPTIONS+=" -b $blocksize -E stride=$sunit_blocks,stripe_width=$swidth_blocks"
        ;;
     *)
        _notrun "can't mkfs $FSTYP with geometry"
        ;;
     *)
        _notrun "can't mkfs $FSTYP with geometry"