Skip to contentSkip to conversation

common/rc, ceph: skip ceph/001-ceph/003 if test_dummy_encryption is enabled

PATCH Superseded Jeff Layton 2 participants 2 messages Dec 16, 2021 – Dec 19, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/rc, ceph: skip ceph/001-ceph/003 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 <[email protected]>
---
 common/rc      | 18 ++++++++++++++----
 tests/ceph/001 |  1 +
 tests/ceph/002 |  1 +
 tests/ceph/003 |  1 +
 4 files changed, 17 insertions(+), 4 deletions(-)
common/rc +14 -4
index 7973ceb5fdf8..312ebea8fb57 100644
@@ -3844,14 +3844,14 @@ _require_cloner()
 # "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 $2 contains the given strings in $1
 # 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 "$2")
 
 	while [ $# -gt 0 ]; do
 		local pattern=$1
@@ -3864,6 +3864,16 @@ _exclude_scratch_mount_option()
 	done
 }
 
+_exclude_scratch_mount_option()
+{
+	_exclude_mount_option "$1" "$MOUNT_OPTIONS"
+}
+
+_exclude_test_mount_option()
+{
+	_exclude_mount_option "$1" "$TEST_FS_MOUNT_OPTS"
+}
+
 _require_atime()
 {
 	_exclude_scratch_mount_option "noatime"
tests/ceph/001 +1 -0
index c00de308fd95..5a828567d500 100755
@@ -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
 
tests/ceph/002 +1 -0
index 9bc728fd2e18..ac3d65b529bd 100755
@@ -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
 
tests/ceph/003 +1 -0
index faedb48cfeea..2d6cb393b3f6 100755
@@ -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
 
Signature · 1 line
2.33.1
#1 lore raw
Quoted 22 lines · Jeff Layton

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 <[email protected]>
---
 common/rc      | 18 ++++++++++++++----
 tests/ceph/001 |  1 +
 tests/ceph/002 |  1 +
 tests/ceph/003 |  1 +
 4 files changed, 17 insertions(+), 4 deletions(-)
common/rc +0 -0
index 7973ceb5fdf8..312ebea8fb57 100644

common/rc _require_cloner() · line 3848

Quoted 6 lines
common/rc +1 -1
@@ -3844,14 +3844,14 @@ _require_cloner()
 # "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'
 }

Doesn't this break the call to _normalize_mount_options() in common/btrfs?

Quoted 13 lines
common/rc +3 -3
-# skip test if MOUNT_OPTIONS contains the given strings
+# skip test if $2 contains the given strings in $1
 # 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 "$2")
 
 	while [ $# -gt 0 ]; do
 		local pattern=$1

common/rc _exclude_scratch_mount_option() · line 3865

Quoted 2 lines
common/rc +0 -0
@@ -3864,6 +3864,16 @@ _exclude_scratch_mount_option()
 	done
 }

This function already uses all positional arguments, so using $2 isn't valid.

- Eric