[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 02/10] qemu-iotests: set TEST_DIR to a unique dir
From: |
Jeff Cody |
Subject: |
[Qemu-devel] [PATCH v5 02/10] qemu-iotests: set TEST_DIR to a unique dir for each test |
Date: |
Tue, 17 Oct 2017 12:31:47 -0400 |
Right now, all qemu-iotests output data into the same scratch directory,
and so each test needs to be responsible for cleaning up its own files.
Have each test use 'scratch/$seq' as its temp directory, so the check
script can do simple cleanup of removing the whole temporary directory.
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Jeff Cody <address@hidden>
---
tests/qemu-iotests/check | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index e2163cc..5ae34bf 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -713,6 +713,7 @@ seq="check"
for seq in $list
do
+ TEST_DIR_SEQ=$TEST_DIR/$seq
err=false
printf %s "$seq"
if [ -n "$TESTS_REMAINING_LOG" ] ; then
@@ -756,13 +757,23 @@ do
fi
export OUTPUT_DIR=$PWD
if $debug; then
- (cd "$source_iotests";
+ (
+ export TEST_DIR=$TEST_DIR_SEQ
+ cd "$source_iotests";
+ . ./common.config
+ . ./common.rc
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \
- $run_command -d 2>&1 | tee $tmp.out)
+ $run_command -d 2>&1 | tee $tmp.out
+ )
else
- (cd "$source_iotests";
+ (
+ export TEST_DIR=$TEST_DIR_SEQ
+ cd "$source_iotests";
+ . ./common.config
+ . ./common.rc
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \
- $run_command >$tmp.out 2>&1)
+ $run_command >$tmp.out 2>&1
+ )
fi
sts=$?
$timestamp && _timestamp
@@ -826,6 +837,8 @@ do
fi
fi
+ rm -rf "$TEST_DIR_SEQ"
+
fi
# come here for each test, except when $showme is true
--
2.9.5
- [Qemu-devel] [PATCH v5 00/10] qemu-iotests improvements, Jeff Cody, 2017/10/17
- [Qemu-devel] [PATCH v5 01/10] qemu-iotests: refuse to run if TEST_DIR contains spaces, Jeff Cody, 2017/10/17
- [Qemu-devel] [PATCH v5 02/10] qemu-iotests: set TEST_DIR to a unique dir for each test,
Jeff Cody <=
- [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Jeff Cody, 2017/10/17
- Re: [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Eric Blake, 2017/10/17
- Re: [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Paolo Bonzini, 2017/10/18
- Re: [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Jeff Cody, 2017/10/18
- Re: [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Paolo Bonzini, 2017/10/18
- Re: [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Jeff Cody, 2017/10/18
- Re: [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Paolo Bonzini, 2017/10/18
- Re: [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Jeff Cody, 2017/10/18
- Re: [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Paolo Bonzini, 2017/10/18
- Re: [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Jeff Cody, 2017/10/18