fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@redhat.com>
To: fstests@vger.kernel.org
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/3] xfs: refactor calls to xfs_admin
Date: Fri, 6 Mar 2020 17:53:14 +0800	[thread overview]
Message-ID: <20200306095314.GY14282@dhcp-12-102.nay.redhat.com> (raw)
In-Reply-To: <158329000059.2374922.2321079684090223330.stgit@magnolia>

On Tue, Mar 03, 2020 at 06:46:40PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Create a helper to run xfs_admin on the scratch device, then refactor
> all tests to use it.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---



>  common/config |    1 +
>  common/xfs    |    8 ++++++++
>  tests/xfs/287 |    2 +-
>  3 files changed, 10 insertions(+), 1 deletion(-)
> 
> 
> diff --git a/common/config b/common/config
> index 9a9c7760..1116cb99 100644
> --- a/common/config
> +++ b/common/config
> @@ -154,6 +154,7 @@ MKSWAP_PROG="$MKSWAP_PROG -f"
>  export XFS_LOGPRINT_PROG="$(type -P xfs_logprint)"
>  export XFS_REPAIR_PROG="$(type -P xfs_repair)"
>  export XFS_DB_PROG="$(type -P xfs_db)"
> +export XFS_ADMIN_PROG="$(type -P xfs_admin)"
>  export XFS_GROWFS_PROG=$(type -P xfs_growfs)
>  export XFS_SPACEMAN_PROG="$(type -P xfs_spaceman)"
>  export XFS_SCRUB_PROG="$(type -P xfs_scrub)"
> diff --git a/common/xfs b/common/xfs
> index 706ddf85..d9a9784f 100644
> --- a/common/xfs
> +++ b/common/xfs
> @@ -218,6 +218,14 @@ _scratch_xfs_db()
>  	$XFS_DB_PROG "$@" $(_scratch_xfs_db_options)
>  }
>  
> +_scratch_xfs_admin()
> +{
> +	local options=("$SCRATCH_DEV")
> +	[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
> +		options+=("$SCRATCH_LOGDEV")
> +	$XFS_ADMIN_PROG "$@" "${options[@]}"
> +}
> +

Looks good to me.

Althought on old xfs_admin doesn't external log device, this test fails if we
use SCRATCH_LOGDEV and USE_EXTERNAL=yes, it's fine for me.

Reviewd-by: Zorro Lang <zlang@redhat.com>

>  _scratch_xfs_logprint()
>  {
>  	SCRATCH_OPTIONS=""
> diff --git a/tests/xfs/287 b/tests/xfs/287
> index 8dc754a5..f77ed2f1 100755
> --- a/tests/xfs/287
> +++ b/tests/xfs/287
> @@ -70,7 +70,7 @@ $XFS_IO_PROG -r -c "lsproj" $dir/32bit
>  _scratch_unmount
>  
>  # Now, enable projid32bit support by xfs_admin
> -xfs_admin -p $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_admin failed"
> +_scratch_xfs_admin -p >> $seqres.full 2>&1 || _fail "xfs_admin failed"
>  
>  # Now mount the fs, 32bit project quotas shall be supported, now
>  _qmount_option "pquota"
> 


  reply	other threads:[~2020-03-06  9:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04  2:46 [PATCH 0/3] fstests: random stuff Darrick J. Wong
2020-03-04  2:46 ` [PATCH 1/3] generic/402: skip test if xfs_io can't parse the date value Darrick J. Wong
2020-03-06  9:33   ` Zorro Lang
2020-03-04  2:46 ` [PATCH 2/3] xfs: refactor calls to xfs_admin Darrick J. Wong
2020-03-06  9:53   ` Zorro Lang [this message]
2020-03-04  2:46 ` [PATCH 3/3] xfs: make sure xfs_db/xfs_quota commands are documented Darrick J. Wong
2020-03-06 10:06   ` Zorro Lang
2020-03-06 15:41     ` Darrick J. Wong

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=20200306095314.GY14282@dhcp-12-102.nay.redhat.com \
    --to=zlang@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-xfs@vger.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).