Skip to contentSkip to conversation

xfstests: fix flink test V2

PATCH In review Josef Bacik 3 participants 3 messages May 8, 2014 – May 9, 2014 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: fix flink test V2

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,

---
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(+)
common/rc +2 -0
index 5c13db5..f37b310 100644
@@ -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`
Signature · 6 lines
1.8.3.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Josef Bacik

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,

Looks good to me, thanks.

Quoted 21 lines

---
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(+)
common/rc +2 -0
index 5c13db5..f37b310 100644
@@ -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`