xfs/realtime: add _require_no_rtinherit function
authorRichard Wareing <rwareing@fb.com>
Fri, 12 Jan 2018 04:16:18 +0000 (20:16 -0800)
committerEryu Guan <eguan@redhat.com>
Fri, 19 Jan 2018 04:47:03 +0000 (12:47 +0800)
To better exercise the data path code of realtime subvolumes, we
will set rtinherit=1 during mkfs calls.  For tests which this is not
desired we introduce a _require_no_rtinherit function to opt out of
this behavior.

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/generic/250
tests/generic/252
tests/generic/441
tests/xfs/170

index bd1ec6f70c6a77f873c44ad7d82f9855ff73aae1..77a4eb4338fc263af8175cd0ae1bf522e205c069 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -33,6 +33,16 @@ BC=$(which bc 2> /dev/null) || BC=
 VALID_TEST_ID="[0-9]\{3\}"
 VALID_TEST_NAME="$VALID_TEST_ID-\?[[:alnum:]-]*"
 
+# Some tests are not relevant or functional when testing XFS realtime
+# subvolumes along with the rtinherit=1 mkfs option.  In these cases,
+# this test will opt-out of the test.
+_require_no_rtinherit()
+{
+       [ "$FSTYP" = "xfs" ] && echo "$MKFS_OPTIONS" |
+               egrep -q "rtinherit([^=]|=1|$)" && \
+               _notrun "rtinherit mkfs option is not supported by this test."
+}
+
 _require_math()
 {
        if [ -z "$BC" ]; then
index 3c4fe6dbf28cb4e11990b0158fb39222697dcd78..a8fd97e31ff015c98d6262a5a8e65461db83a0b6 100755 (executable)
@@ -48,6 +48,9 @@ _require_scratch
 _require_dm_target error
 _require_xfs_io_command "falloc"
 _require_odirect
+# This test uses "dm" without taking into account the data could be on
+# realtime subvolume, thus the test will fail with rtinherit=1
+_require_no_rtinherit
 
 rm -f $seqres.full
 
index ffedd569ec03bd272e47c020cb20b38aaf037086..b506d599f638bb1a13e636c5c61e23664372e555 100755 (executable)
@@ -47,6 +47,9 @@ _supported_os Linux
 _require_scratch
 _require_dm_target error
 _require_xfs_io_command "falloc"
+# This test uses "dm" without taking into account the data could be on
+# realtime subvolume, thus the test will fail with rtinherit=1
+_require_no_rtinherit
 _require_aiodio "aiocp"
 AIO_TEST="src/aio-dio-regress/aiocp"
 
index 075d87723ca1e06a6df4bf213ecde1ad3f48b9fd..5fbfececadc07bad16d6c037d345d9d2e6d61801 100755 (executable)
@@ -47,6 +47,9 @@ _cleanup()
 # real QA test starts here
 _supported_os Linux
 _require_scratch
+# This test uses "dm" without taking into account the data could be on
+# realtime subvolume, thus the test will fail with rtinherit=1
+_require_no_rtinherit
 
 # Generally, we want to avoid journal errors on the extended testcase. Only
 # unset the -s flag if we have a logdev
index c5ae8e45213c6990ce1617e6d09dde5535e7d9d4..6deef1b29777e33899130d183a671a47d361476d 100755 (executable)
@@ -50,6 +50,7 @@ _supported_fs xfs
 _supported_os Linux
 
 _require_scratch
+_require_no_rtinherit
 
 _check_filestreams_support || _notrun "filestreams not available"