xfstests: fix flink test V2
diff mbox

Message ID 1399574310-13718-1-git-send-email-jbacik@fb.com
State Not Applicable
Headers show

Commit Message

Josef Bacik May 8, 2014, 6:38 p.m. UTC
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, whereas Eric
gets an error about $TEST_DIR being a directory because his xfs_io tries to open
the directory first before it parses the options.  So fix this by checking flink
with these two cases and don't run if we hit either of them.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
---
V1->V2: check for "Is a directory" errors that Eric mentioned, move test up into
the flink specific case.

 common/rc | 2 ++
 1 file changed, 2 insertions(+)

Comments

Eric Sandeen May 8, 2014, 6:41 p.m. UTC | #1
On 5/8/14, 1:38 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, whereas Eric
> gets an error about $TEST_DIR being a directory because his xfs_io tries to open
> the directory first before it parses the options.  So fix this by checking flink
> with these two cases and don't run if we hit either of them.  Thanks,
> 
> Signed-off-by: Josef Bacik <jbacik@fb.com>

Looks good to me, thanks.

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
> V1->V2: check for "Is a directory" errors that Eric mentioned, move test up into
> the flink specific case.
> 
>  common/rc | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index 5c13db5..f37b310 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1248,6 +1248,8 @@ _require_xfs_io_command()
>  	"flink" )
>  		testio=`$XFS_IO_PROG -T -F -c "flink $testfile" \
>  			$TEST_DIR 2>&1`
> +		echo $testio | egrep -q "invalid option|Is a directory" && \
> +			_notrun "xfs_io $command support is missing"
>  		;;
>  	*)
>  		testio=`$XFS_IO_PROG -c "$command help" 2>&1`
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig May 9, 2014, 7:24 a.m. UTC | #2
Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/common/rc b/common/rc
index 5c13db5..f37b310 100644
--- a/common/rc
+++ b/common/rc
@@ -1248,6 +1248,8 @@  _require_xfs_io_command()
 	"flink" )
 		testio=`$XFS_IO_PROG -T -F -c "flink $testfile" \
 			$TEST_DIR 2>&1`
+		echo $testio | egrep -q "invalid option|Is a directory" && \
+			_notrun "xfs_io $command support is missing"
 		;;
 	*)
 		testio=`$XFS_IO_PROG -c "$command help" 2>&1`