aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2022-04-11 15:48:33 +1000
committerEryu Guan <guaneryu@gmail.com>2022-04-17 22:47:41 +0800
commitb560e18c6216149e47c5208df2727b01ba2ce49b (patch)
tree22e3696f3b60ecb8b02b071be0670809dd176e76
parente75da9ebde722455544e7b4e261389d4b77c8a76 (diff)
downloadxfstests-dev-b560e18c6216149e47c5208df2727b01ba2ce49b.tar.gz
generic/019: kill background processes on interrupt
If you ctrl-c generic/019, it leaves fsstress processes running. Kill them in the cleanup function so that they don't have to be manually killed after interrupting the test. While touching the _cleanup() function, make it do everything that the generic _cleanup function it overrides does and fix the indenting. [Eryu: unset fs_pid and fio_pid after wait] Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rwxr-xr-xtests/generic/0198
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/generic/019 b/tests/generic/019
index db56dac1ed..854ba57de0 100755
--- a/tests/generic/019
+++ b/tests/generic/019
@@ -53,8 +53,10 @@ stop_fail_scratch_dev()
# Override the default cleanup function.
_cleanup()
{
- disallow_fail_make_request
- rm -f $tmp.*
+ kill $fs_pid $fio_pid &> /dev/null
+ disallow_fail_make_request
+ cd /
+ rm -r -f $tmp.*
}
RUN_TIME=$((20+10*$TIME_FACTOR))
@@ -138,6 +140,8 @@ _workout()
kill $fs_pid &> /dev/null
wait $fs_pid
wait $fio_pid
+ unset $fs_pid
+ unset $fio_pid
# We expect that broken FS still can be umounted
run_check _scratch_unmount