[PATCH] fstests: add a _require_scratch_mountopt helper

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



I want to add a test that requires a new mount option, so add a helper
to safely _notrun if the kernel doesn't support the new mount option.

Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
---
 common/rc | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/rc b/common/rc
index aa5a7409..431855a7 100644
--- a/common/rc
+++ b/common/rc
@@ -3281,6 +3281,19 @@ _require_norecovery()
 	_scratch_unmount
 }
 
+# notrun if we can't mount scratch with the given mount option
+_require_scratch_mountopt()
+{
+	local option=$1
+
+	_require_scratch
+	_scratch_mkfs > /dev/null 2>&1
+
+	_try_scratch_mount "-o $option" > /dev/null 2>&1 || \
+		_notrun "$SCRATCH_DEV $FSTYP does not support -o $option"
+	_scratch_unmount
+}
+
 # Does this filesystem support metadata journaling?
 # We exclude ones here that don't; otherwise we assume that it does, so the
 # test will run, fail, and motivate someone to update this test for a new
-- 
2.26.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