summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2023-11-22 17:20:13 +0200
committerZorro Lang <zlang@kernel.org>2023-12-09 13:52:36 +0800
commit2a4fef036ee795e57069d928bbe48c07be9b0e77 (patch)
tree4b3712489428bb8a0256d8417b23621592b99bf1 /common
parent98865122ed3cbedabffdb09d1c4af32bfa32baf5 (diff)
overlay/026: Fix test expectation for newer kernels
The test checks the expectaion from old kernels that set/get of trusted.overlay.* xattrs is not supported on an overlayfs filesystem. New kernels support set/get xattr of trusted.overlay.* xattrs, so adapt the test to check that either both set and get work on new kernel, or neither work on old kernel. Signed-off-by: Alexander Larsson <alexl@redhat.com> Signed-off-by: Amir Goldstein <amir73il@gmail.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'common')
-rw-r--r--common/overlay19
1 files changed, 19 insertions, 0 deletions
diff --git a/common/overlay b/common/overlay
index 7004187f..8f275228 100644
--- a/common/overlay
+++ b/common/overlay
@@ -201,6 +201,25 @@ _require_scratch_overlay_features()
_scratch_unmount
}
+_check_scratch_overlay_xattr_escapes()
+{
+ local testfile=$1
+
+ touch $testfile
+ ! ($GETFATTR_PROG -n trusted.overlay.foo $testfile 2>&1 | grep -E -q "not (permitted|supported)")
+}
+
+_require_scratch_overlay_xattr_escapes()
+{
+ _scratch_mkfs > /dev/null 2>&1
+ _scratch_mount
+
+ _check_scratch_overlay_xattr_escapes $SCRATCH_MNT/file || \
+ _notrun "xattr escaping is not supported by overlay"
+
+ _scratch_unmount
+}
+
_require_scratch_overlay_verity()
{
local lowerdirs="$OVL_BASE_SCRATCH_MNT/$OVL_UPPER:$OVL_BASE_SCRATCH_MNT/$OVL_LOWER"