[PATCH 29/40] generic/085: general cleanup for reliability and debugging

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



From: Dave Chinner <dchinner@xxxxxxxxxx>

This test was quite unreliable during development of the parallel
check runner. It redirects all errors to /dev/null, so there was no
way to debug it when it failed.

Use common mount/unmount helpers, redirect errors to $seqres.full,
make sure the cleanup code is always run at test exit and only
attempt to kill processes if they are still running during cleanup.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
---
 tests/generic/085 | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/tests/generic/085 b/tests/generic/085
index 8fbcdce2e..7671a36ab 100755
--- a/tests/generic/085
+++ b/tests/generic/085
@@ -16,18 +16,20 @@ _begin_fstest auto freeze mount
 # Override the default cleanup function.
 _cleanup()
 {
+	cleanup_dmdev
 	cd /
 	rm -f $tmp.*
-	cleanup_dmdev
 }
 
 cleanup_dmdev()
 {
+	if [ -n "$pid" ]; then
+		kill -9 $pid 2>> $seqres.full
+		wait $pid 2>> $seqres.full
+	fi
 	# in case it's still suspended and/or mounted
-	$DMSETUP_PROG resume $lvdev >/dev/null 2>&1
-	[ -n "$pid" ] && kill -9 $pid 2>/dev/null
-	wait $pid
-	_unmount $lvdev >/dev/null 2>&1
+	$DMSETUP_PROG resume $lvdev >> $seqres.full 2>&1
+	_unmount -q $SCRATCH_MNT
 	_dmsetup_remove $node
 }
 
@@ -64,18 +66,19 @@ setup_dmdev
 # important, as long as they're racing with each other. So just throw away the
 # outputs and ignore the results.
 for ((i=0; i<100; i++)); do
-	$DMSETUP_PROG suspend $lvdev >/dev/null 2>&1
-	$DMSETUP_PROG resume $lvdev >/dev/null 2>&1
+	$DMSETUP_PROG suspend $lvdev >> $seqres.full 2>&1
+	$DMSETUP_PROG resume $lvdev >> $seqres.full 2>&1
 done &
 pid=$!
 for ((i=0; i<100; i++)); do
-	_mount $lvdev $SCRATCH_MNT >/dev/null 2>&1
-	_unmount $lvdev >/dev/null 2>&1
+	_mount $lvdev $SCRATCH_MNT >> $seqres.full 2>&1
+	_unmount $lvdev >> $seqres.full 2>&1
 done &
 pid="$pid $!"
 
 wait $pid
 unset pid
 
+cleanup_dmdev
 status=0
 exit
-- 
2.45.2





[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux