@@ -4782,6 +4782,23 @@ _require_kernel_config()
_has_kernel_config $1 || _notrun "Installed kernel not built with $1"
}
+_require_not_encrypted()
+{
+ local target=$TEST_DIR/require_not_encrypted.$$
+ local ret=0
+
+ #
+ # The top-level directory mounted with test_dummy_encryption is not
+ # itself encrypted. Only new files and directories created under it
+ # are.
+ touch $target
+ local attrs=$($XFS_IO_PROG -c 'statx -r' $target | awk '/stat.attributes / { print $3 }')
+ rm -f $target
+
+ # STATX_ATTR_ENCRYPTED == 0x800
+ [ $(( attrs & 0x800 )) -eq 0 ] || _notrun "Filesystem is encrypted"
+}
+
init_rc
################################################################################
@@ -22,6 +22,7 @@ _begin_fstest auto quick copy_range
_supported_fs ceph
_require_xfs_io_command "copy_range"
+_require_not_encrypted
_require_attrs
_require_test
@@ -30,6 +30,7 @@ _begin_fstest auto quick copy_range
_supported_fs ceph
_require_xfs_io_command "copy_range"
+_require_not_encrypted
_require_attrs
_require_test
@@ -18,6 +18,7 @@ _begin_fstest auto quick copy_range
_supported_fs ceph
_require_xfs_io_command "copy_range"
+_require_not_encrypted
_require_attrs
_require_test
Some tests on ceph require changing the layout of new files, which is forbidden when the files are encrypted. Add a test that touches a file in $TEST_DIR and then tests it to see if it reports the STATX_ATTR_ENCRYPTED flag, and does a _notrun if it's present. Also add this requirement to the two ceph tests that change the layout. Cc: Luis Henriques <lhenriques@suse.de> Signed-off-by: Jeff Layton <jlayton@kernel.org> --- common/rc | 17 +++++++++++++++++ tests/ceph/001 | 1 + tests/ceph/002 | 1 + tests/ceph/003 | 1 + 4 files changed, 20 insertions(+) v2: make ceph/001 also call _require_not_encrypted