FS/XFS testing framework
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Dushan Tcholich <dusanc@gmail.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] generic/038: require fallocate support and test for trim support
Date: Tue, 16 Dec 2014 07:49:15 +1100	[thread overview]
Message-ID: <20141215204914.GS24183@dastard> (raw)
In-Reply-To: <alpine.LNX.2.00.1412152322070.21847@reiser4.gekom>

On Mon, Dec 15, 2014 at 11:26:35PM +0100, Dushan Tcholich wrote:
> Add tests for allocate support and test if TRIM really works on tested 
> partition.
> 
> Signed-off-by: Dushan Tcholich <dusanc@gmail.com>
> 
> --- xfstests.orig/tests/generic/038	2014-12-14 15:18:00.000000000 +0100
> +++ xfstests/tests/generic/038	2014-12-15 23:21:11.000000000 +0100
> @@ -70,6 +70,10 @@
>  _supported_os Linux
>  _require_scratch
>  _require_fstrim
> +_require_xfs_io_command "falloc"
> +_require_xfs_io_command "truncate"

No need to test for the truncate command as it's supported in all
versions of xfs_io people use. falloc, OTOH, isn't supported on oler
distros that people still need to run QA on, and hence that check is
required....

> +_test_batched_discard $SCRATCH_MNT || _notrun "FITRIM not supported on $SCRATCH_DEV"

$SCRATCH_MNT is not mounted at this point. The test needs to go
after _scratch_mkfs/_scratch_mount...

Hmmm - I'm thinking this should really be a "_requires_batched_discard"
function. It already internally calls _require_fstrim, so we should
just drive everything inwards. i.e.:

_require_batched_discard()
{
	if [ $# -ne 1 ]; then
		echo "Usage: _require_batched_discard mnt_point" 1>&2
		exit 1
	fi
	_require_fstrim
	[ $FSTRIM_PROG $1 > /dev/null 2>&1 ] || \
		_notrun "FITRIM not supported on $1"
}

And so not even need the _requires_fstrim call in these tests...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2014-12-15 20:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-15 22:26 [PATCH] generic/038: require fallocate support and test for trim support Dushan Tcholich
2014-12-15 20:49 ` Dave Chinner [this message]
2014-12-15 21:45   ` Theodore Ts'o
2014-12-15 22:07     ` Dave Chinner

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=20141215204914.GS24183@dastard \
    --to=david@fromorbit.com \
    --cc=dusanc@gmail.com \
    --cc=fstests@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