@@ -13,6 +13,17 @@ _cleanup()
rm -r -f $tmp.*
}
+# Standard cleanup function for tests using fsstress. THese tests all need to
+# kill fsstress processes when unexpectedly killed, and wait for them to finish.
+# Those tests can either register this function directly or call it from their
+# own local cleanup functions.
+_fsstress_cleanup()
+{
+ $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1
+ wait
+ _cleanup
+}
+
# Install the supplied cleanup code as a signal handler for HUP, INT, QUIT,
# TERM, or when the test exits. Extra signals can be specified as subsequent
# parameters.
@@ -10,13 +10,6 @@
#
. ./common/preamble
_begin_fstest auto freeze log metadata quick
-
-_fsstress_cleanup()
-{
- $KILLALL_PROG -9 fsstress 2>/dev/null
- wait
- _cleanup
-}
_register_cleanup _fsstress_cleanup
# Use the information exported by XFS to sysfs to determine whether the log has
@@ -12,18 +12,11 @@
#
. ./common/preamble
_begin_fstest auto metadata stress
+_register_cleanup _fsstress_cleanup
# Import common functions.
. ./common/filter
-_fsstress_cleanup()
-{
- $KILLALL_PROG -9 fsstress 2>/dev/null
- wait
- _cleanup
-}
-_register_cleanup _fsstress_cleanup
-
filter_enospc() {
sed -e '/^.*No space left on device.*/d'
}
@@ -10,19 +10,12 @@
#
. ./common/preamble
_begin_fstest shutdown auto log metadata
-
-_fsstress_cleanup()
-{
- $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1
- wait
- _cleanup
-}
-_register_cleanup fsstress_cleanup
+_register_cleanup _fsstress_cleanup
# Import common functions.
. ./common/dmflakey
-# Modify as appropriate.
+# real QA test starts here
_supported_fs xfs
_require_scratch
@@ -23,13 +23,6 @@
. ./common/preamble
_begin_fstest auto log recoveryloop
-_fsstress_cleanup()
-{
- $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1
- wait
- _cleanup
-}
-
local_cleanup()
{
[ -e /sys/fs/xfs/$sdev/errortag/log_item_pin ] &&
@@ -42,8 +35,6 @@ _register_cleanup local_cleanup
. ./common/inject
# real QA test starts here
-
-# Modify as appropriate.
_supported_fs xfs
_require_xfs_io_error_injection log_item_pin
_require_xfs_io_error_injection log_bad_crc
@@ -16,21 +16,12 @@
#
. ./common/preamble
_begin_fstest shutdown auto log quick
-
-_fsstress_cleanup()
-{
- $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1
- wait
- _cleanup
-}
-_register_cleanup fsstress_cleanup
+_register_cleanup _fsstress_cleanup
# Import common functions.
. ./common/log
# real QA test starts here
-
-# Modify as appropriate.
_supported_fs xfs
_require_scratch
_require_v2log
@@ -13,21 +13,12 @@
#
. ./common/preamble
_begin_fstest auto log metadata
-
-_fsstress_cleanup()
-{
- $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1
- wait
- _cleanup
-}
-_register_cleanup fsstress_cleanup
+_register_cleanup _fsstress_cleanup
# Import common functions.
. ./common/inject
# real QA test starts here
-
-# Modify as appropriate.
_supported_fs xfs
_require_xfs_io_error_injection "log_bad_crc"
_require_scratch
@@ -8,14 +8,7 @@
#
. ./common/preamble
_begin_fstest rw metadata auto stress
-
-_fsstress_cleanup()
-{
- $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1
- wait
- _cleanup
-}
-_register_cleanup fsstress_cleanup
+_register_cleanup _fsstress_cleanup
workout()
{
@@ -11,21 +11,14 @@
#
. ./common/preamble
_begin_fstest auto stress clone quota
-
-_fsstress_cleanup()
-{
- $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1
- wait
- _cleanup
-}
-_register_cleanup fsstress_cleanup
+_register_cleanup _fsstress_cleanup
# Import common functions.
. ./common/quota
. ./common/filter
. ./common/reflink
-# Modify as appropriate.
+# real QA test starts here
_supported_fs xfs
_require_scratch_reflink