public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Xiao Yang <yangx.jy@cn.fujitsu.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH 1/3] common: add _require_test_swapfile
Date: Wed, 19 Dec 2018 08:54:24 +1100	[thread overview]
Message-ID: <20181218215424.GB31274@dastard> (raw)
In-Reply-To: <5C124D9A.3040305@cn.fujitsu.com>

On Thu, Dec 13, 2018 at 08:16:26PM +0800, Xiao Yang wrote:
> On 2018/12/03 14:42, Dave Chinner wrote:
> 
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > Because we can host swap files on the test device, not just the
> > scratch device.
> >
> > Also, move the tests for the utilities needed to manipulate swap
> > files into the functions that test whether swap files are supported
> > so they are checked for existence /before/ we try to us them. This
> > fixes all the tests that currently check for these utilities
> > manually /after/ checking if swapfiles are supported.
> >
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > ---
> >  common/rc         | 29 +++++++++++++++++++++--------
> >  tests/generic/472 |  2 --
> >  tests/generic/495 |  2 --
> >  tests/generic/496 |  2 --
> >  tests/generic/497 |  2 --
> >  5 files changed, 21 insertions(+), 16 deletions(-)
> >
> > diff --git a/common/rc b/common/rc
> > index ecb17380bad8..5b344b25012b 100644
> > --- a/common/rc
> > +++ b/common/rc
> > @@ -2214,22 +2214,35 @@ _format_swapfile() {
> >  }
> >  
> >  # Check that the filesystem supports swapfiles
> > -_require_scratch_swapfile()
> > +_require_swapfile()
> >  {
> > -	_require_scratch
> > +	dir=$1
> >  
> > -	_scratch_mkfs >/dev/null
> > -	_scratch_mount
> > +	# fstests also has custom binaries for mkswap/swapon
> > +	_require_test_program mkswap
> > +	_require_test_program swapon
> Hi Dave,
> 
> Is it necessary to include the check for custom mkswap/swapon in _require_swapfile()?
> In fact, some tests calling _require_scratch_swapfile() just use default mkswap/swapon
> command(e.g. generic/356, generic/357, generic/493, generic/494).  I perfer to keep it
> in separate tests.

Those binaries are built by fstests, so there is absolutely no harm
in requiring them. If they didn't get built, then the fstests
install is in no shape to be run because it wasn't built correctly.

And by adding them here, we do not need to clutter up tests with
lots different requires - we just say "we require swapfile support"
and that pulls in everything swapfile related. This makes the tests
easier to review and maintain because there is less that needs to be
done to write a swapfile related test.

-Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2018-12-18 21:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03  6:42 [PATCH 0/3] fstests: copy_file_range() bounds testing Dave Chinner
2018-12-03  6:42 ` [PATCH 1/3] common: add _require_test_swapfile Dave Chinner
2018-12-03 16:43   ` Darrick J. Wong
2018-12-13 12:16   ` Xiao Yang
2018-12-18 21:54     ` Dave Chinner [this message]
2018-12-03  6:42 ` [PATCH 2/3] generic/43[014]: copy_range beyond source EOF should fail Dave Chinner
2018-12-03  7:30   ` Amir Goldstein
2018-12-03  8:10     ` Dave Chinner
2018-12-03 16:47   ` Darrick J. Wong
2018-12-05 22:23   ` Dave Chinner
2018-12-03  6:42 ` [PATCH 3/3] generic: copy_file_range bounds test Dave Chinner
2018-12-03  7:25   ` Amir Goldstein
2018-12-03  8:17     ` Dave Chinner
2018-12-03  9:22       ` Amir Goldstein
2018-12-03 13:15         ` Amir Goldstein
2019-05-13  6:03         ` Amir Goldstein
2018-12-03 16:58   ` Darrick J. Wong
2019-05-21  5:33   ` Amir Goldstein
2018-12-03 16:41 ` [PATCH 0/3] fstests: copy_file_range() bounds testing 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=20181218215424.GB31274@dastard \
    --to=david@fromorbit.com \
    --cc=fstests@vger.kernel.org \
    --cc=yangx.jy@cn.fujitsu.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