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 <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Dave Chinner
2015-09-21 13:06:18 +10:00
committed by Dave Chinner
parent 6714b6f788
commit 3038de2b24
2 changed files with 19 additions and 20 deletions
+19 -13
View File
@@ -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"
-7
View File
@@ -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