diff mbox

generic/071: require falloc -k

Message ID 1468829204-24593-1-git-send-email-hch@lst.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christoph Hellwig July 18, 2016, 8:06 a.m. UTC
NFSv4.2 supports fallocate, but not the FALLOC_FL_KEEP_SIZE option.
To avoid a spurious failure test for the correct command.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 tests/generic/071 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eryu Guan July 18, 2016, 8:47 a.m. UTC | #1
On Mon, Jul 18, 2016 at 11:06:44AM +0300, Christoph Hellwig wrote:
> NFSv4.2 supports fallocate, but not the FALLOC_FL_KEEP_SIZE option.
> To avoid a spurious failure test for the correct command.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  tests/generic/071 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/generic/071 b/tests/generic/071
> index 65ed0c7..9d0d136 100755
> --- a/tests/generic/071
> +++ b/tests/generic/071
> @@ -46,7 +46,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> -_require_xfs_io_command "falloc"
> +_require_xfs_io_command "falloc" "-k"

This stops generic/071 from running no matter what filesystem it's
testing, this is because _require_xfs_io_command only checks whether
xfs_io knows the option (-k) by searching it in help message, not really
running it, i.e.

xfs_io -c "help falloc" | grep -q "^ -k --"

but "help falloc" doesn't follow the normal xfs_io command help format

# xfs_io -c "help falloc"
falloc [-c] [-k] [-p] off len -- allocates space associated with part of a file via fallocate

So the check always returns false, and test always _notrun, with the
additional "-k" switch.

Perhaps we should update _require_xfs_io_command to actually run the
command with the provided additional option?

Thanks,
Eryu
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig July 19, 2016, 4:17 a.m. UTC | #2
On Mon, Jul 18, 2016 at 04:47:14PM +0800, Eryu Guan wrote:
> This stops generic/071 from running no matter what filesystem it's
> testing, this is because _require_xfs_io_command only checks whether
> xfs_io knows the option (-k) by searching it in help message, not really
> running it, i.e.

Well, we can at least add the documentation as that would be useful
on it's own.  I'll look into a patch.

> Perhaps we should update _require_xfs_io_command to actually run the
> command with the provided additional option?

I'll have to look at the archives, but I remember we had a reason for
this way of probing for feature support.
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tests/generic/071 b/tests/generic/071
index 65ed0c7..9d0d136 100755
--- a/tests/generic/071
+++ b/tests/generic/071
@@ -46,7 +46,7 @@  trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 _require_scratch
-_require_xfs_io_command "falloc"
+_require_xfs_io_command "falloc" "-k"
 
 rm -f $seqres.full