* [PATCH] xfstests: fix flink test
@ 2014-05-07 20:54 Josef Bacik
2014-05-07 22:44 ` Dave Chinner
2014-05-08 4:16 ` Eric Sandeen
0 siblings, 2 replies; 3+ messages in thread
From: Josef Bacik @ 2014-05-07 20:54 UTC (permalink / raw)
To: linux-btrfs, xfs
I don't have flink support in my xfsprogs, but it doesn't fail with "command not
found" or whatever, it fails because I don't have the -T option. So fix
_require_xfs_io_command to check for an invalid option and not run. This way I
get notrun instead of a failure. Thanks,
Signed-off-by: Josef Bacik <jbacik@fb.com>
---
common/rc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/common/rc b/common/rc
index 5c13db5..4fa7e63 100644
--- a/common/rc
+++ b/common/rc
@@ -1258,6 +1258,8 @@ _require_xfs_io_command()
_notrun "xfs_io $command support is missing"
echo $testio | grep -q "Operation not supported" && \
_notrun "xfs_io $command failed (old kernel/wrong fs?)"
+ echo $testio | grep -q "invalid option" && \
+ _notrun "xfs_io $command support is missing"
}
# Check that a fs has enough free space (in 1024b blocks)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfstests: fix flink test
2014-05-07 20:54 [PATCH] xfstests: fix flink test Josef Bacik
@ 2014-05-07 22:44 ` Dave Chinner
2014-05-08 4:16 ` Eric Sandeen
1 sibling, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2014-05-07 22:44 UTC (permalink / raw)
To: Josef Bacik; +Cc: linux-btrfs, xfs
On Wed, May 07, 2014 at 04:54:47PM -0400, Josef Bacik wrote:
> I don't have flink support in my xfsprogs, but it doesn't fail with "command not
> found" or whatever, it fails because I don't have the -T option. So fix
> _require_xfs_io_command to check for an invalid option and not run. This way I
> get notrun instead of a failure. Thanks,
>
> Signed-off-by: Josef Bacik <jbacik@fb.com>
> ---
> common/rc | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/common/rc b/common/rc
> index 5c13db5..4fa7e63 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1258,6 +1258,8 @@ _require_xfs_io_command()
> _notrun "xfs_io $command support is missing"
> echo $testio | grep -q "Operation not supported" && \
> _notrun "xfs_io $command failed (old kernel/wrong fs?)"
> + echo $testio | grep -q "invalid option" && \
> + _notrun "xfs_io $command support is missing"
> }
Yeah, looks like it throws a different error - it treats -T as an
option, not a command. Rather than multiple checks that result in
the same error, why not just:
- echo $testio | grep -q "not found" && \
+ echo $testio | egrep -q 'not found|invalid option' && \
_notrun "xfs_io $command support is missing"
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfstests: fix flink test
2014-05-07 20:54 [PATCH] xfstests: fix flink test Josef Bacik
2014-05-07 22:44 ` Dave Chinner
@ 2014-05-08 4:16 ` Eric Sandeen
1 sibling, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2014-05-08 4:16 UTC (permalink / raw)
To: Josef Bacik, linux-btrfs, xfs
On 5/7/14, 3:54 PM, Josef Bacik wrote:
> I don't have flink support in my xfsprogs, but it doesn't fail with "command not
> found" or whatever, it fails because I don't have the -T option. So fix
> _require_xfs_io_command to check for an invalid option and not run. This way I
> get notrun instead of a failure. Thanks,
This actually doesn't work for me on an old kernel, if that matters; it
fails with:
/mnt/test: Is a directory
and nothing catches that. Old xfsprogs tries to open the file
in question RDWR even before it gets to the -T option (which
would fail, I guess), and you can't do that for directories.
So I suppose we could explicitly test for that when checking
flink:
[ $command = "flink" ] && echo $testio | grep -q "Is a directory" && \
_notrun "xfs_io flink support is missing"
or alternately, first just run xfs_io w/ the command but no file;
today, at least, that works:
[root@bp-05 xfstests]# xfs_io -c flink
command "flink" not found
[root@bp-05 xfstests]# xfs_io -c pread
[root@bp-05 xfstests]#
so could do this before the case statement:
$XFS_IO_PROG -c $command 2>&1 | grep -q "not found" && \
_notrun "xfs_io $command support is missing"
but that might be subject to future changes in xfs_io command
parsing...
-Eric
> Signed-off-by: Josef Bacik <jbacik@fb.com>
> ---
> common/rc | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/common/rc b/common/rc
> index 5c13db5..4fa7e63 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1258,6 +1258,8 @@ _require_xfs_io_command()
> _notrun "xfs_io $command support is missing"
> echo $testio | grep -q "Operation not supported" && \
> _notrun "xfs_io $command failed (old kernel/wrong fs?)"
> + echo $testio | grep -q "invalid option" && \
> + _notrun "xfs_io $command support is missing"
> }
>
> # Check that a fs has enough free space (in 1024b blocks)
> -- 1.8.3.1 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-08 4:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-07 20:54 [PATCH] xfstests: fix flink test Josef Bacik
2014-05-07 22:44 ` Dave Chinner
2014-05-08 4:16 ` Eric Sandeen
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).