public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Improve generic test coverage for overlayfs
@ 2018-05-06  6:36 Amir Goldstein
  2018-05-06  6:36 ` [PATCH 1/2] common/rc: decouple xfs_io flink check from xfs_io -T check Amir Goldstein
  2018-05-06  6:36 ` [PATCH 2/2] generic/{159,160}: require chattr instead of lsattr Amir Goldstein
  0 siblings, 2 replies; 3+ messages in thread
From: Amir Goldstein @ 2018-05-06  6:36 UTC (permalink / raw)
  To: Eryu Guan; +Cc: Miklos Szeredi, linux-unionfs, fstests

Eryu,

With current upstream kernel and xfs base FSTYP, this is the test coverage
I got from running: ./check -overlay -g generic/auto

Ran: 495; Not run: 192; Failures: 0

These patches improve test coverage by running and passing two more tests
and improving the reason in report for not running two of the tests.

Thanks,
Amir.

Amir Goldstein (2):
  common/rc: decouple xfs_io flink check from xfs_io -T check
  generic/{159,160}: require chattr instead of lsattr

 common/rc         | 15 +++++++++++----
 tests/btrfs/058   |  4 +---
 tests/generic/004 |  1 +
 tests/generic/159 |  2 +-
 tests/generic/160 |  2 +-
 tests/generic/389 |  1 +
 6 files changed, 16 insertions(+), 9 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] common/rc: decouple xfs_io flink check from xfs_io -T check
  2018-05-06  6:36 [PATCH 0/2] Improve generic test coverage for overlayfs Amir Goldstein
@ 2018-05-06  6:36 ` Amir Goldstein
  2018-05-06  6:36 ` [PATCH 2/2] generic/{159,160}: require chattr instead of lsattr Amir Goldstein
  1 sibling, 0 replies; 3+ messages in thread
From: Amir Goldstein @ 2018-05-06  6:36 UTC (permalink / raw)
  To: Eryu Guan; +Cc: Miklos Szeredi, linux-unionfs, fstests

The 3 tests that _require_xfs_io_command "flink", actually require
O_TMPFILE support and flink command, but the former is far unlikely
to be missing. The test btrfs/058 doesn't even use the flink command.

When running these tests on a filesystem that does not support O_TMPFILE
(e.g. overlayfs) the result is not very infomative:

 generic/004 1s ... [not run] xfs_io flink failed (old kernel/wrong fs?)

Decouple the requirements for "flink" command and "-T" command line flag
and require the former explicitly in tests that use it.

As a result the report is now more informative:

 generic/004 1s ... [not run] O_TMPFILE is not supported

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 common/rc         | 15 +++++++++++----
 tests/btrfs/058   |  4 +---
 tests/generic/004 |  1 +
 tests/generic/389 |  1 +
 4 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/common/rc b/common/rc
index 9ffab7f..3dabdc9 100644
--- a/common/rc
+++ b/common/rc
@@ -2147,13 +2147,20 @@ _require_xfs_io_command()
 			-c "fiemap -v $param" $testfile 2>&1`
 		param_checked=1
 		;;
-	"flink" )
-		testio=`$XFS_IO_PROG -T -F -c "flink $testfile" \
-			$TEST_DIR 2>&1`
+	"flink")
+		local testlink=$TEST_DIR/$$.link.xfs_io
+		testio=`$XFS_IO_PROG -F -f -c "flink $testlink" $testfile 2>&1`
+		rm -f $testlink > /dev/null 2>&1
+		;;
+	"-T")
+		# Check O_TMPFILE support in xfs_io, kernel and fs
+		testio=`$XFS_IO_PROG -T -c quit $TEST_DIR 2>&1`
 		echo $testio | egrep -q "invalid option|Is a directory" && \
 			_notrun "xfs_io $command support is missing"
+		echo $testio | grep -q "Operation not supported" && \
+			_notrun "O_TMPFILE is not supported"
 		;;
-	"fsmap" )
+	"fsmap")
 		testio=`$XFS_IO_PROG -f -c "fsmap" $testfile 2>&1`
 		echo $testio | grep -q "Inappropriate ioctl" && \
 			_notrun "xfs_io $command support is missing"
diff --git a/tests/btrfs/058 b/tests/btrfs/058
index ed39f94..f139d0c 100755
--- a/tests/btrfs/058
+++ b/tests/btrfs/058
@@ -53,9 +53,7 @@ _cleanup()
 _supported_fs btrfs
 _supported_os Linux
 _require_scratch
-# Requiring flink command tests for the presence of the -T option used
-# to pass O_TMPFILE to open(2).
-_require_xfs_io_command "flink"
+_require_xfs_io_command "-T"
 
 rm -f $seqres.full
 
diff --git a/tests/generic/004 b/tests/generic/004
index d0926f1..df6f215 100755
--- a/tests/generic/004
+++ b/tests/generic/004
@@ -45,6 +45,7 @@ _supported_fs generic
 _supported_os Linux
 
 _require_test
+_require_xfs_io_command "-T"
 _require_xfs_io_command "flink"
 
 rm -f $seqres.full
diff --git a/tests/generic/389 b/tests/generic/389
index 6d63eda..1b7bd77 100755
--- a/tests/generic/389
+++ b/tests/generic/389
@@ -47,6 +47,7 @@ _supported_fs generic
 _supported_os Linux
 
 _require_test
+_require_xfs_io_command "-T"
 _require_xfs_io_command "flink"
 _require_acls
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] generic/{159,160}: require chattr instead of lsattr
  2018-05-06  6:36 [PATCH 0/2] Improve generic test coverage for overlayfs Amir Goldstein
  2018-05-06  6:36 ` [PATCH 1/2] common/rc: decouple xfs_io flink check from xfs_io -T check Amir Goldstein
@ 2018-05-06  6:36 ` Amir Goldstein
  1 sibling, 0 replies; 3+ messages in thread
From: Amir Goldstein @ 2018-05-06  6:36 UTC (permalink / raw)
  To: Eryu Guan; +Cc: Miklos Szeredi, linux-unionfs, fstests

The tests _require_test_lsattr, but don't actually use lsattr.
They use chattr +i/-i, so require the appropriate command.

_require_test_lsattr checks the FS_IOC_GETFLAGS ioctl on a directory
and that is not supported in overlayfs. _require_chattr checks the
ioctl on a file, which is supported in overlayfs, so this change makes
the tests run and pass on overlayfs.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 tests/generic/159 | 2 +-
 tests/generic/160 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/generic/159 b/tests/generic/159
index 7e52d5c..f517b55 100755
--- a/tests/generic/159
+++ b/tests/generic/159
@@ -43,7 +43,7 @@ _cleanup()
 
 # real QA test starts here
 _supported_os Linux
-_require_test_lsattr
+_require_chattr i
 _require_test_reflink
 
 rm -f $seqres.full
diff --git a/tests/generic/160 b/tests/generic/160
index 409b15e..cd1044d 100755
--- a/tests/generic/160
+++ b/tests/generic/160
@@ -43,7 +43,7 @@ _cleanup()
 
 # real QA test starts here
 _supported_os Linux
-_require_test_lsattr
+_require_chattr i
 _require_test_dedupe
 
 rm -f $seqres.full
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-06  6:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-06  6:36 [PATCH 0/2] Improve generic test coverage for overlayfs Amir Goldstein
2018-05-06  6:36 ` [PATCH 1/2] common/rc: decouple xfs_io flink check from xfs_io -T check Amir Goldstein
2018-05-06  6:36 ` [PATCH 2/2] generic/{159,160}: require chattr instead of lsattr Amir Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox