FSTests Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] xfs/030: fix test for external log device
@ 2020-02-20  2:16 Eric Sandeen
  2020-02-20  2:20 ` Eric Sandeen
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2020-02-20  2:16 UTC (permalink / raw)
  To: fstests, linux-xfs; +Cc: Luis R. Rodriguez

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
 	}'`



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs/030: fix test for external log device
  2020-02-20  2:16 [PATCH] xfs/030: fix test for external log device Eric Sandeen
@ 2020-02-20  2:20 ` Eric Sandeen
  2020-02-20 13:42   ` Luis Chamberlain
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2020-02-20  2:20 UTC (permalink / raw)
  To: fstests, linux-xfs; +Cc: Luis R. Rodriguez

On 2/19/20 8:16 PM, Eric Sandeen wrote:
> 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>

hm self-NAK I didn't realize we had _scratch_xfs_db, better to go
through and fix all of these sorts of things at once.

Luis, seems like you have an itch to scratch, no?

> ---
> 
> 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
>  	}'`
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs/030: fix test for external log device
  2020-02-20  2:20 ` Eric Sandeen
@ 2020-02-20 13:42   ` Luis Chamberlain
  0 siblings, 0 replies; 3+ messages in thread
From: Luis Chamberlain @ 2020-02-20 13:42 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: fstests, linux-xfs

On Wed, Feb 19, 2020 at 08:20:14PM -0600, Eric Sandeen wrote:
> On 2/19/20 8:16 PM, Eric Sandeen wrote:
> > 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>
> 
> hm self-NAK I didn't realize we had _scratch_xfs_db, better to go
> through and fix all of these sorts of things at once.
> 
> Luis, seems like you have an itch to scratch, no?

I didn't know it was so easy, sure! Since I test rt and logdev
on stable kernels, will give this a crack once I have my new
stable test rig running. Thanks for the proactive approach.

  Luis

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20  2:16 [PATCH] xfs/030: fix test for external log device Eric Sandeen
2020-02-20  2:20 ` Eric Sandeen
2020-02-20 13:42   ` Luis Chamberlain

FSTests Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/fstests/0 fstests/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 fstests fstests/ https://lore.kernel.org/fstests \
		fstests@vger.kernel.org
	public-inbox-index fstests

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.fstests


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git