From 3038de2b24da1081cf434ce8590818469487c21d Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Mon, 21 Sep 2015 13:06:18 +1000 Subject: [PATCH] xfs/199: fix breakage every time mkfs defaults change. From v3.2.4 onwards, mkfs.xfs defaults to enabling ftype, which causes xfs/199 to break again. Change the test to store the features2 fields value and compare that directly against the bad_features2 value which should be the same. Signed-off-by: Dave Chinner Signed-off-by: Dave Chinner --- tests/xfs/199 | 32 +++++++++++++++++++------------- tests/xfs/199.out | 7 ------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/tests/xfs/199 b/tests/xfs/199 index 0eef88b9..c168fec8 100755 --- a/tests/xfs/199 +++ b/tests/xfs/199 @@ -49,18 +49,22 @@ _supported_os Linux _require_scratch -# clear any mkfs options so taht we can directly specify the options we need to +get_features() +{ + xfs_db -x $SCRATCH_DEV -c "sb" -c "print $1" | awk '// {print $3}' +} + +# clear any mkfs options so that we can directly specify the options we need to # be able to test the features bitmask behaviour correctly. MKFS_OPTIONS= -_scratch_mkfs_xfs -m crc=0 -l lazy-count=1 -i projid32bit=0 >/dev/null 2>&1 +_scratch_mkfs_xfs -m crc=0 -l lazy-count=1 >/dev/null 2>&1 -# -# Print the current flags. Just a dummy so that the test breaks -# in an obvious way when the default feature flags changed in mkfs -# -echo "Default feature2 flags:" -xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print features2' -xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print bad_features2' +# Grab the initial configuration. This checks mkfs sets the fields properly, and +# gives us the values the resultant tests should be the same as for testing at +# the end of the test. We don't hard code feature values, because that makes the +# test break every time we change mkfs feature defaults. +f2=`get_features features2` +bf2=`get_features bad_features2` # # Now clear the normal flags @@ -70,8 +74,7 @@ xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0' _scratch_mount umount $SCRATCH_MNT -echo "Features 2 after mount rw:" -xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print features2' +rwf2=`get_features features2` # # Clear the normal flags again for the second rount. @@ -85,8 +88,11 @@ xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0' _scratch_mount -o ro _scratch_mount -o remount,rw umount $SCRATCH_MNT -echo "Features 2 after mount ro and remount rw:" -xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print features2' +rof2=`get_features features2` + +[ "$f2" != "$bf2" ] && echo "mkfs: features2 $f2 != bad_features2 $bf2" +[ "$f2" != "$rwf2" ] && echo "mount rw: old features2 $f2 != new features2 $rwf2" +[ "$f2" != "$rof2" ] && echo "ro->rw: old features2 $f2 != new features2 $rof2" # success, all done echo "*** done" diff --git a/tests/xfs/199.out b/tests/xfs/199.out index 0f299d77..fa1623e3 100644 --- a/tests/xfs/199.out +++ b/tests/xfs/199.out @@ -1,13 +1,6 @@ QA output created by 199 -Default feature2 flags: -features2 = 0xa -bad_features2 = 0xa Clearing features2: features2 = 0 -Features 2 after mount rw: -features2 = 0xa Clearing features2: features2 = 0 -Features 2 after mount ro and remount rw: -features2 = 0xa *** done -- 2.39.5