All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Disseldorp <ddiss@suse.de>
To: fstests@vger.kernel.org, tytso@mit.edu
Cc: David Disseldorp <ddiss@suse.de>
Subject: [RFC PATCH v2 6/6] check: stash full/dmesg/out.bad files on rerun
Date: Tue, 28 Jun 2022 00:22:56 +0200	[thread overview]
Message-ID: <20220627222256.14175-7-ddiss@suse.de> (raw)
In-Reply-To: <20220627222256.14175-1-ddiss@suse.de>

These files would otherwise be overwritten.

Signed-off-by: David Disseldorp <ddiss@suse.de>
---
 check | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/check b/check
index 726c83d9..baf336da 100755
--- a/check
+++ b/check
@@ -570,8 +570,17 @@ _stash_test_status() {
 				      "$report_msg"
 	fi
 
-	# only stash result for first failure (triggering loop)
-	((loop_num > 1)) && return
+	if ((loop_num > 0)); then
+		# retain files which would be overwritten in subsequent reruns
+		for i in "${REPORT_DIR}/${test_seq}.full" \
+			 "${REPORT_DIR}/${test_seq}.dmesg" \
+			 "${REPORT_DIR}/${test_seq}.out.bad"; do
+			[ -f "$i" ] || continue
+			cp "$i" "${i}.rerun$((loop_num - 1))"
+		done
+		# only stash result for first failure (triggering loop)
+		((loop_num != 1)) && return
+	fi
 
 	case "$test_status" in
 	fail)
-- 
2.35.3


  parent reply	other threads:[~2022-06-27 22:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 22:22 [RFC PATCH v2 0/6] check: add option to rerun failed tests David Disseldorp
2022-06-27 22:22 ` [RFC PATCH v2 1/6] report: use array for REPORT_ENV_LIST David Disseldorp
2022-06-28 14:54   ` Darrick J. Wong
2022-06-27 22:22 ` [RFC PATCH v2 2/6] report: pass through most details as function parameters David Disseldorp
2022-06-28 14:55   ` Darrick J. Wong
2022-06-27 22:22 ` [RFC PATCH v2 3/6] check: make a few variables local David Disseldorp
2022-06-28 14:56   ` Darrick J. Wong
2022-06-27 22:22 ` [RFC PATCH v2 4/6] check: append bad / notrun arrays in helper function David Disseldorp
2022-06-28 15:00   ` Darrick J. Wong
2022-06-27 22:22 ` [RFC PATCH v2 5/6] check: add -L <n> parameter to rerun failed tests David Disseldorp
2022-06-28 15:15   ` Darrick J. Wong
2022-06-28 22:34     ` David Disseldorp
2022-06-27 22:22 ` David Disseldorp [this message]
2022-06-28 15:16   ` [RFC PATCH v2 6/6] check: stash full/dmesg/out.bad files on rerun Darrick J. Wong
2022-06-28 22:36     ` David Disseldorp

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=20220627222256.14175-7-ddiss@suse.de \
    --to=ddiss@suse.de \
    --cc=fstests@vger.kernel.org \
    --cc=tytso@mit.edu \
    --subject='Re: [RFC PATCH v2 6/6] check: stash full/dmesg/out.bad files on rerun' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.