From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dc2sz-00038g-Nf for qemu-devel@nongnu.org; Mon, 31 Jul 2017 01:04:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dc2sy-0000R5-NL for qemu-devel@nongnu.org; Mon, 31 Jul 2017 01:04:57 -0400 From: Jeff Cody Date: Mon, 31 Jul 2017 01:04:38 -0400 Message-Id: <03558ebe46550c94a977bb4bb09555cec5dac022.1501477080.git.jcody@redhat.com> In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PATCH for-2.11 1/3] qemu-iotests: set TEST_DIR to a unique dir for each test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, kwolf@redhat.com, mreitz@redhat.com, stefanha@redhat.com, jsnow@redhat.com, famz@redhat.com Right now, all qemu-iotests output data into the same scratch directory, and so each tests needs to be responsible for cleanup 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. Signed-off-by: Jeff Cody --- 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 2a55ec9..20cb93d 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -254,6 +254,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 @@ -300,13 +301,23 @@ do fi export OUTPUT_DIR=$PWD if $debug; then - (cd "$source_iotests"; + ( + cd "$source_iotests"; + export TEST_DIR=$TEST_DIR_SEQ + . "$source_iotests/common.config" + . "$source_iotests/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 + . "$source_iotests/common.config" + . "$source_iotests/common.rc" + cd "$source_iotests"; MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \ - $run_command >$tmp.out 2>&1) + $run_command >$tmp.out 2>&1 + ) fi sts=$? $timestamp && _timestamp @@ -370,6 +381,8 @@ do fi fi + rm -rf "$TEST_DIR_SEQ" + fi # come here for each test, except when $showme is true -- 2.9.4