fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: fstests <fstests@vger.kernel.org>, linux-xfs <linux-xfs@vger.kernel.org>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>
Subject: [PATCH] xfs/030: fix test for external log device
Date: Wed, 19 Feb 2020 20:16:23 -0600	[thread overview]
Message-ID: <d3b3a65e-3575-f153-98ca-4a34e170ab78@redhat.com> (raw)

Several tests fail if an external log device is used; in this case
the xfs_db invocation fails with a clear indication of why, so fix
that as other tests do by testing for and using the external log
option if present.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/common/repair b/common/repair
index 5a9097f4..cf69dde9 100644
--- a/common/repair
+++ b/common/repair
@@ -9,8 +9,12 @@ _zero_position()
 	value=$1
 	struct="$2"
 
+	SCRATCH_OPTIONS=""
+	[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+		SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
+
 	# set values for off/len variables provided by db
-	eval `xfs_db -r -c "$struct" -c stack $SCRATCH_DEV | perl -ne '
+	eval `xfs_db -r -c "$struct" -c stack $SCRATCH_OPTIONS $SCRATCH_DEV | perl -ne '
 		if (/byte offset (\d+), length (\d+)/) {
 			print "offset=$1\nlength=$2\n"; exit
 		}'`
diff --git a/tests/xfs/030 b/tests/xfs/030
index efdb6a18..e1cc32ef 100755
--- a/tests/xfs/030
+++ b/tests/xfs/030
@@ -77,7 +77,10 @@ else
 	_scratch_unmount
 fi
 clear=""
-eval `xfs_db -r -c "sb 1" -c stack $SCRATCH_DEV | perl -ne '
+SCRATCH_OPTIONS=""
+[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+	SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
+eval `xfs_db -r -c "sb 1" -c stack $SCRATCH_OPTIONS $SCRATCH_DEV | perl -ne '
 	if (/byte offset (\d+), length (\d+)/) {
 		print "clear=", $1 / 512, "\n"; exit
 	}'`



             reply	other threads:[~2020-02-20  2:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20  2:16 Eric Sandeen [this message]
2020-02-20  2:20 ` [PATCH] xfs/030: fix test for external log device Eric Sandeen
2020-02-20 13:42   ` Luis Chamberlain

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=d3b3a65e-3575-f153-98ca-4a34e170ab78@redhat.com \
    --to=sandeen@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    /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).