mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
common: Check fs consistency on TEST_DEV only when needed
Currently we're checking file system consistency on TEST_DEV after every successful test run even though the TEST_DEV might not even be used in that test. Fix it by introducing _require_test to for the test ti indicate that it's about to use TEST_DEV. Also add _require_test to the new script so that this requirement is a default. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
ab1d756fe1
commit
83ef157def
@@ -625,7 +625,8 @@ for section in $HOST_OPTIONS_SECTIONS; do
|
||||
then
|
||||
try="$try $seqnum"
|
||||
n_try=`expr $n_try + 1`
|
||||
_check_test_fs
|
||||
test -f ${RESULT_DIR}/require_test && _check_test_fs
|
||||
rm -f ${RESULT_DIR}/require_test
|
||||
test -f ${RESULT_DIR}/require_scratch && _check_scratch_fs
|
||||
rm -f ${RESULT_DIR}/require_scratch
|
||||
fi
|
||||
|
||||
@@ -989,6 +989,55 @@ _require_scratch()
|
||||
touch ${RESULT_DIR}/require_scratch
|
||||
}
|
||||
|
||||
# this test needs a test partition - check we're ok & unmount it
|
||||
#
|
||||
_require_test()
|
||||
{
|
||||
case "$FSTYP" in
|
||||
nfs*)
|
||||
_notrun "requires a test device"
|
||||
;;
|
||||
tmpfs)
|
||||
if [ -z "$TEST_DEV" -o ! -d "$TEST_DIR" ];
|
||||
then
|
||||
_notrun "this test requires a valid \$TEST_DIR and unique $TEST_DEV"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if [ -z "$TEST_DEV" -o "`_is_block_dev $TEST_DEV`" = "" ]
|
||||
then
|
||||
_notrun "this test requires a valid \$TEST_DEV"
|
||||
fi
|
||||
if [ "`_is_block_dev $SCRATCH_DEV`" = "`_is_block_dev $TEST_DEV`" ]
|
||||
then
|
||||
_notrun "this test requires a valid \$TEST_DEV"
|
||||
fi
|
||||
if [ ! -d "$TEST_DIR" ]
|
||||
then
|
||||
_notrun "this test requires a valid \$TEST_DIR"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# mounted?
|
||||
if _mount | grep -q $TEST_DEV
|
||||
then
|
||||
# if it's mounted, make sure its on $TEST_DIR
|
||||
if ! _mount | grep $TEST_DEV | grep -q $TEST_DIR
|
||||
then
|
||||
echo "\$TEST_DEV is mounted but not on \$TEST_DIR - aborting"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
out=`_mount_or_remount_rw "$MOUNT_OPTIONS" $TEST_DEV $TEST_DIR`
|
||||
if [ $? -ne 1 ]; then
|
||||
echo $out
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
touch ${RESULT_DIR}/require_test
|
||||
}
|
||||
|
||||
# this test needs a logdev
|
||||
#
|
||||
_require_logdev()
|
||||
|
||||
@@ -129,6 +129,7 @@ _cleanup()
|
||||
# Modify as appropriate.
|
||||
_supported_fs generic
|
||||
_supported_os IRIX Linux
|
||||
_require_test
|
||||
|
||||
# if error
|
||||
exit
|
||||
|
||||
@@ -50,6 +50,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
|
||||
# real QA test starts here
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_scratch
|
||||
|
||||
_scratch_mkfs > /dev/null 2>&1
|
||||
|
||||
@@ -49,6 +49,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
|
||||
# real QA test starts here
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_scratch
|
||||
_require_fssum
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
|
||||
# real QA test starts here
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_scratch
|
||||
|
||||
_scratch_mkfs > /dev/null 2>&1
|
||||
|
||||
@@ -55,6 +55,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
|
||||
# real QA test starts here
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
|
||||
rm -f $seqres.full
|
||||
echo "Silence is golden"
|
||||
|
||||
@@ -50,6 +50,7 @@ _supported_os Linux
|
||||
|
||||
_require_xfs_io_command "fiemap"
|
||||
_require_cp_reflink
|
||||
_require_test
|
||||
|
||||
TESTDIR1=$TEST_DIR/test-$seq
|
||||
rm -rf $TESTDIR1
|
||||
|
||||
@@ -50,6 +50,7 @@ _supported_os Linux
|
||||
|
||||
_require_xfs_io_command "fiemap"
|
||||
_require_cp_reflink
|
||||
_require_test
|
||||
|
||||
TESTDIR1=$TEST_DIR/test-$seq
|
||||
rm -rf $TESTDIR1
|
||||
|
||||
@@ -48,6 +48,7 @@ _supported_os Linux
|
||||
|
||||
_require_xfs_io_command "fiemap"
|
||||
_require_cp_reflink
|
||||
_require_test
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ _cleanup()
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
|
||||
_require_test
|
||||
_require_scratch
|
||||
_require_cp_reflink
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ _cleanup()
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
|
||||
_require_test
|
||||
_require_scratch
|
||||
_require_cp_reflink
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ _cleanup()
|
||||
# real QA test starts here
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_scratch
|
||||
_need_to_be_root
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ _cleanup()
|
||||
# real QA test starts here
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_scratch
|
||||
_require_fssum
|
||||
_need_to_be_root
|
||||
|
||||
@@ -57,6 +57,7 @@ _cleanup()
|
||||
# real QA test starts here
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_scratch
|
||||
_require_fssum
|
||||
_require_xfs_io_command "fiemap"
|
||||
|
||||
@@ -45,6 +45,7 @@ _cleanup()
|
||||
# real QA test starts here
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_scratch
|
||||
_require_btrfs "property"
|
||||
_need_to_be_root
|
||||
|
||||
@@ -51,6 +51,7 @@ _cleanup()
|
||||
# real QA test starts here
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_scratch
|
||||
_require_fssum
|
||||
_need_to_be_root
|
||||
|
||||
@@ -48,6 +48,7 @@ _cleanup()
|
||||
# real QA test starts here
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_scratch
|
||||
_require_fssum
|
||||
_need_to_be_root
|
||||
|
||||
@@ -50,6 +50,7 @@ _cleanup()
|
||||
# real QA test starts here
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_scratch
|
||||
_require_fssum
|
||||
_require_attrs
|
||||
|
||||
@@ -58,6 +58,7 @@ _cleanup()
|
||||
# real QA test starts here
|
||||
_supported_fs btrfs
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_scratch
|
||||
_need_to_be_root
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user