qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Cody <jcody@redhat.com>
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
Subject: [Qemu-devel] [PATCH for-2.11 3/3] qemu-iotests: add option to save temp files on error
Date: Mon, 31 Jul 2017 01:04:40 -0400	[thread overview]
Message-ID: <402fccc1212ad053c47110420b9f1c2e751d3d31.1501477080.git.jcody@redhat.com> (raw)
In-Reply-To: <cover.1501477080.git.jcody@redhat.com>
In-Reply-To: <cover.1501477080.git.jcody@redhat.com>

Now that ./check takes care of cleaning up after each tests, it
can also selectively not clean up.  Add option to leave all output from
tests intact if that test encountered an error.

Note: this currently only works for bash tests, as the python tests
still clean up after themselves manually.

Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 tests/qemu-iotests/check  | 5 ++++-
 tests/qemu-iotests/common | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 20cb93d..48d206c 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -381,7 +381,10 @@ do
             fi
         fi
 
-        rm -rf "$TEST_DIR_SEQ"
+        if [ "$save_on_err" != "true" ] || [ "$err" != "true" ]
+        then
+            rm -rf "$TEST_DIR_SEQ"
+        fi
 
     fi
 
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index d34c11c..d08b233 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -42,6 +42,7 @@ expunge=true
 have_test_arg=false
 randomize=false
 cachemode=false
+save_on_err=false
 rm -f $tmp.list $tmp.tmp $tmp.sed
 
 export IMGFMT=raw
@@ -172,6 +173,7 @@ other options
     -T                  output timestamps
     -r                  randomize test order
     -c mode             cache mode
+    -s                  save test scratch directory on test failure
 
 testlist options
     -g group[,group...]        include tests from these groups
@@ -349,6 +351,10 @@ testlist options
             xgroup=true
             xpand=false
             ;;
+        -s)
+            save_on_err=true
+            xpand=false
+            ;;
         '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')
             echo "No tests?"
             status=1
-- 
2.9.4

  parent reply	other threads:[~2017-07-31  5:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-31  5:04 [Qemu-devel] [PATCH for-2.11 0/3] qemu-iotests: place output in unique dir Jeff Cody
2017-07-31  5:04 ` [Qemu-devel] [PATCH for-2.11 1/3] qemu-iotests: set TEST_DIR to a unique dir for each test Jeff Cody
2017-07-31 12:03   ` Eric Blake
2017-07-31  5:04 ` [Qemu-devel] [PATCH for-2.11 2/3] qemu-iotests: remove file cleanup from bash tests Jeff Cody
2017-07-31 12:20   ` Eric Blake
2017-07-31 12:29     ` Jeff Cody
2017-07-31  5:04 ` Jeff Cody [this message]
2017-07-31 13:02   ` [Qemu-devel] [PATCH for-2.11 3/3] qemu-iotests: add option to save temp files on error Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=402fccc1212ad053c47110420b9f1c2e751d3d31.1501477080.git.jcody@redhat.com \
    --to=jcody@redhat.com \
    --cc=famz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).