xfs/realtime: Add require_no_realtime function
authorRichard Wareing <rwareing@fb.com>
Fri, 12 Jan 2018 04:16:17 +0000 (20:16 -0800)
committerEryu Guan <eguan@redhat.com>
Fri, 19 Jan 2018 04:43:49 +0000 (12:43 +0800)
Some tests do not play well with realtime devices, in an effort to
produce a stable set of test which exercise the realtime code paths
we introduce a _require_no_realtime function to allow tests to opt
out of realtime subvolume test runs.

And to make tests generic/409-411 work well with rt device, teach
_get_mount now honors $SCRATCH_OPTIONS.

Signed-off-by: Richard Wareing <rwareing@fb.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/rc
tests/xfs/077
tests/xfs/189
tests/xfs/284

index a3bfa1b0e730024091061dda8907041c5edd7e50..bd1ec6f70c6a77f873c44ad7d82f9855ff73aae1 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -200,8 +200,14 @@ _mount()
 _get_mount()
 {
        local mnt_point=${!#}
+       local mnt_dev=${@:(-2):1}
+       local scratch_opts=""
+       if [ "$mnt_dev" = "$SCRATCH_DEV" ]; then
+               _scratch_options mount
+               scratch_opts="$SCRATCH_OPTIONS"
+       fi
 
-       _mount $*
+       _mount $scratch_opts $*
        if [ $? -eq 0 ]; then
                MOUNTED_POINT_STACK="$mnt_point $MOUNTED_POINT_STACK"
        else
@@ -232,7 +238,7 @@ _clear_mount_stack()
 
 _scratch_options()
 {
-    type=$1
+    local type=$1
     SCRATCH_OPTIONS=""
 
     if [ "$FSTYP" != "xfs" ]; then
@@ -1761,6 +1767,14 @@ _require_realtime()
        _notrun "Realtime device required, skipped this test"
 }
 
+# This test requires that a realtime subvolume is not in use
+#
+_require_no_realtime()
+{
+       [ "$USE_EXTERNAL" = "yes" ] && [ -n "$SCRATCH_RTDEV" ] && \
+               _notrun "Test not compatible with realtime subvolumes, skipped this test"
+}
+
 # this test requires that a specified command (executable) exists
 # $1 - command, $2 - name for error message
 #
index eba4f085ee4cc17639e0fa35e50fce0e2c0d6d53..6d5ac1a36bd7957247469aff6d166bb1d1f0c414 100755 (executable)
@@ -50,6 +50,8 @@ _cleanup()
 
 _supported_fs xfs
 _supported_os Linux
+# xfs_copy does not support realtime devices
+_require_no_realtime
 _require_scratch
 _require_xfs_crc
 _require_meta_uuid
index 636f6f056c96c7c36024123def0973adbdb61a56..699eb3c1f941b8ac35e2d05a73dd15a0d58ba41a 100755 (executable)
@@ -236,6 +236,7 @@ _putback_scratch_fstab()
 _supported_fs xfs
 _supported_os Linux
 
+_require_no_realtime
 _require_scratch
 _require_noattr2
 
index e3625fe64e0ebddf8363c0fcf60025fa6c1ad138..d0eb5bd6b8e0734e9136e1870ba8c24e2d718441 100755 (executable)
@@ -49,6 +49,8 @@ rm -f $seqres.full
 # real QA test starts here
 _supported_fs xfs
 _supported_os Linux
+# xfs_copy does not support realtime devices
+_require_no_realtime
 _require_test
 _require_scratch