aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2022-01-06 08:30:49 -0500
committerEryu Guan <guaneryu@gmail.com>2022-01-09 21:35:16 +0800
commitc61c1e2f4cad89d4f900eaef173616b309228110 (patch)
tree40d6deaf0579f64ae8faca7d65f9d39e44b0b2b7
parent424b0975184aee816d4cd12a249cb9d3b5bb08c1 (diff)
downloadxfstests-dev-c61c1e2f4cad89d4f900eaef173616b309228110.tar.gz
ceph/001-003: skip if test_dummy_encryption is enabled
Some tests on ceph require changing the layout of new files, which is forbidden when the files are encrypted. Skip these tests if the test_dummy_encryption mount option is being used. Generalize the _exclude_scratch_mount_option code and add a new _exclude_test_mount_option call as well. Call the new function from the ceph tests that should exclude test_dummy_encryption. Cc: Luis Henriques <lhenriques@suse.de> Cc: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Luis Henriques <lhenriques@suse.de> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rw-r--r--common/btrfs2
-rw-r--r--common/rc28
-rwxr-xr-xtests/ceph/0011
-rwxr-xr-xtests/ceph/0021
-rwxr-xr-xtests/ceph/0031
5 files changed, 23 insertions, 10 deletions
diff --git a/common/btrfs b/common/btrfs
index fe5985663a..4afe81eb2d 100644
--- a/common/btrfs
+++ b/common/btrfs
@@ -115,7 +115,7 @@ _require_btrfs_fs_sysfs()
_require_btrfs_no_compress()
{
- if _normalize_mount_options | grep -q "compress"; then
+ if _normalize_mount_options "$MOUNT_OPTIONS" | grep -q "compress"; then
_notrun "This test requires no compression enabled"
fi
}
diff --git a/common/rc b/common/rc
index 09a5c0661e..c087875a42 100644
--- a/common/rc
+++ b/common/rc
@@ -2027,7 +2027,7 @@ _require_sane_bdev_flush()
# Returns 0 if DAX will be used, 1 if DAX is not going to be used.
__scratch_uses_fsdax()
{
- local ops=$(_normalize_mount_options)
+ local ops=$(_normalize_mount_options "$MOUNT_OPTIONS")
echo $ops | egrep -qw "dax(=always| |$)" && return 0
echo $ops | grep -qw "dax=never" && return 1
@@ -3706,7 +3706,7 @@ _has_metadata_journaling()
return 1
}
# ext4 might not load a journal
- if _normalize_mount_options | grep -qw "noload"; then
+ if _normalize_mount_options "$MOUNT_OPTIONS" | grep -qw "noload"; then
echo "mount option \"noload\" not allowed in this test"
return 1
fi
@@ -3870,20 +3870,20 @@ _require_cloner()
_notrun "cloner binary not present at $CLONER_PROG"
}
-# Normalize mount options from global $MOUNT_OPTIONS
-# Convert options like "-o opt1,opt2 -oopt3" to
-# "opt1 opt2 opt3"
+# Normalize mount options from the option string in $1
+# Convert options like "-o opt1,opt2 -oopt3" to "opt1 opt2 opt3"
_normalize_mount_options()
{
- echo $MOUNT_OPTIONS | sed -n 's/-o\s*\(\S*\)/\1/gp'| sed 's/,/ /g'
+ echo "$1" | sed -n 's/-o\s*\(\S*\)/\1/gp'| sed 's/,/ /g'
}
-# skip test if MOUNT_OPTIONS contains the given strings
+# skip test if $1 contains the given strings in trailing arguments
# Both dax and dax=always are excluded if dax or dax=always is passed
-_exclude_scratch_mount_option()
+_exclude_mount_option()
{
- local mnt_opts=$(_normalize_mount_options)
+ local mnt_opts=$(_normalize_mount_options "$1")
+ shift
while [ $# -gt 0 ]; do
local pattern=$1
echo "$pattern" | egrep -q "dax(=always|$)" && \
@@ -3895,6 +3895,16 @@ _exclude_scratch_mount_option()
done
}
+_exclude_scratch_mount_option()
+{
+ _exclude_mount_option "$MOUNT_OPTIONS" $@
+}
+
+_exclude_test_mount_option()
+{
+ _exclude_mount_option "$TEST_FS_MOUNT_OPTS" $@
+}
+
_require_atime()
{
_exclude_scratch_mount_option "noatime"
diff --git a/tests/ceph/001 b/tests/ceph/001
index c00de308fd..5a828567d5 100755
--- a/tests/ceph/001
+++ b/tests/ceph/001
@@ -22,6 +22,7 @@ _begin_fstest auto quick copy_range
_supported_fs ceph
_require_xfs_io_command "copy_range"
+_exclude_test_mount_option "test_dummy_encryption"
_require_attrs
_require_test
diff --git a/tests/ceph/002 b/tests/ceph/002
index 9bc728fd2e..ac3d65b529 100755
--- a/tests/ceph/002
+++ b/tests/ceph/002
@@ -30,6 +30,7 @@ _begin_fstest auto quick copy_range
_supported_fs ceph
_require_xfs_io_command "copy_range"
+_exclude_test_mount_option "test_dummy_encryption"
_require_attrs
_require_test
diff --git a/tests/ceph/003 b/tests/ceph/003
index faedb48cfe..2d6cb393b3 100755
--- a/tests/ceph/003
+++ b/tests/ceph/003
@@ -18,6 +18,7 @@ _begin_fstest auto quick copy_range
_supported_fs ceph
_require_xfs_io_command "copy_range"
+_exclude_test_mount_option "test_dummy_encryption"
_require_attrs
_require_test