From: Dave Chinner Date: Tue, 26 Nov 2024 23:29:59 +0000 (+1100) Subject: fstests: clean up termination of various tests X-Git-Tag: v2024.12.08~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e2986ec534700570e07cb96fd0ab1b81d0cb0187;p=xfstests-dev.git fstests: clean up termination of various tests Accumulated minor fixes to improve reliablity of the termination of various tests when interrupted. Signed-off-by: Dave Chinner Reviewed-by: Zorro lang Signed-off-by: Zorro Lang --- diff --git a/tests/generic/084 b/tests/generic/084 index 137ba23c..fe758f11 100755 --- a/tests/generic/084 +++ b/tests/generic/084 @@ -12,6 +12,15 @@ . ./common/preamble _begin_fstest auto metadata quick +_cleanup() +{ + [ -n "$link_pids" ] && kill $link_pids + [ -n "$open_pid" ] && kill $open_pid + wait + cd / + rm -f $tmp.* +} + # Import common functions. . ./common/filter @@ -57,9 +66,6 @@ done & sleep 5 kill $! >/dev/null 2>&1 -kill $open_pid $link_pids >/dev/null 2>&1 -wait $open_pid $link_pids - # all done, no oops/hang expected, _check_filesystems checks SCRATCH_DEV after test status=0 exit diff --git a/tests/generic/464 b/tests/generic/464 index f114208f..ebf47509 100755 --- a/tests/generic/464 +++ b/tests/generic/464 @@ -66,22 +66,22 @@ _scratch_mount # for each operation and runs for $LOOP_TIME seconds, and check filesystem # consistency after each iteration for i in `seq 1 $LOOP_CNT`; do - rm -f $stop + touch $stop for j in `seq 1 $PROC_CNT`; do - while [ ! -e $stop ]; do + while [ -e $stop ]; do do_write done & - while [ ! -e $stop ]; do + while [ -e $stop ]; do do_append done & - while [ ! -e $stop ]; do + while [ -e $stop ]; do do_writeback done & done sleep $LOOP_TIME - touch $stop + rm -f $stop wait _scratch_unmount diff --git a/tests/generic/650 b/tests/generic/650 index 36a23e48..60f86fdf 100755 --- a/tests/generic/650 +++ b/tests/generic/650 @@ -52,8 +52,6 @@ nr_hotplug_cpus="${#hotplug_cpus[@]}" test "$nr_hotplug_cpus" -gt 0 || _notrun "CPU hotplugging not supported" stress_dir="$TEST_DIR/$seq" -rm -r -f "$stress_dir" -mkdir -p "$stress_dir" echo "Silence is golden." @@ -79,12 +77,14 @@ fsstress_args+=(--duration="$((SOAK_DURATION / 10))") nr_ops=$((2500 * TIME_FACTOR)) fsstress_args+=(-n $nr_ops) for ((i = 0; i < 10; i++)); do - _run_fsstress_bg -w "${fsstress_args[@]}" - _wait_for_fsstress + rm -rf "$stress_dir" + mkdir -p "$stress_dir" + _run_fsstress "${fsstress_args[@]}" _test_cycle_mount done rm -f $sentinel_file +wait # success, all done status=0 diff --git a/tests/xfs/013 b/tests/xfs/013 index 5a92ef08..fd011445 100755 --- a/tests/xfs/013 +++ b/tests/xfs/013 @@ -120,6 +120,7 @@ _kill_fsstress # clean out the competing fsstress allocations, then everything else rm -rf $SCRATCH_MNT/fsstress rm -rf $SCRATCH_MNT/dir* +wait _scratch_unmount diff --git a/tests/xfs/558 b/tests/xfs/558 index ba137ae8..c594d8cc 100755 --- a/tests/xfs/558 +++ b/tests/xfs/558 @@ -193,6 +193,7 @@ wait_for_errortag & $XFS_IO_PROG -c "pwrite -S 0x56 $((2 * blksz)) $((2 * blksz))" \ -c 'fsync' $SCRATCH_MNT/file >> $seqres.full rm -f $sentryfile +wait cat "$tracefile" >> $seqres.full grep -q iomap_invalid "$tracefile"