[PATCH] generic/571: skip test on filesystems that don't support F_SETLEASE fcntl

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



nfs and gfs2 (without localflocks) both use simple_nosetlease() for
their setlease f_op, so skip this test on those filesystem types.

Signed-off-by: Scott Mayhew <smayhew@xxxxxxxxxx>
---
 common/rc         | 13 +++++++++++++
 tests/generic/571 |  1 +
 2 files changed, 14 insertions(+)

diff --git a/common/rc b/common/rc
index 454f5ccf..ea0fd67f 100644
--- a/common/rc
+++ b/common/rc
@@ -3501,6 +3501,19 @@ _require_test_fcntl_advisory_locks()
 		_notrun "Require fcntl advisory locks support"
 }
 
+_require_test_fcntl_setlease()
+{
+	case $FSTYP in
+	nfs)
+		_notrun "Setting leases not supported on $FSTYP"
+		;;
+	gfs2)
+		grep $TEST_DEV /proc/mounts | grep gfs2 | grep -q "localflocks" || \
+			_notrun "Setting leases not supported on $FSTYP without localflocks"
+		;;
+	esac
+}
+
 _require_ofd_locks()
 {
 	# Give a test run by getlk wrlck on testfile.
diff --git a/tests/generic/571 b/tests/generic/571
index 68c8a604..599e3e68 100755
--- a/tests/generic/571
+++ b/tests/generic/571
@@ -26,6 +26,7 @@ _supported_fs generic
 _supported_os Linux
 _require_test
 _require_test_fcntl_advisory_locks
+_require_test_fcntl_setlease
 
 _run_leasetest
 
-- 
2.18.2




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux