From d3c14f78cd66a498c2ff8a836bfc4f6a110315fe Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Tue, 21 May 2024 15:08:07 +0200 Subject: [PATCH] test: add a brief comment for the chattr check Addresses: https://github.com/systemd/systemd/pull/32907#discussion_r1605919598 --- test/units/TEST-13-NSPAWN.machinectl.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/units/TEST-13-NSPAWN.machinectl.sh b/test/units/TEST-13-NSPAWN.machinectl.sh index c27207bcc7d..462cc6a8c33 100755 --- a/test/units/TEST-13-NSPAWN.machinectl.sh +++ b/test/units/TEST-13-NSPAWN.machinectl.sh @@ -132,6 +132,9 @@ machinectl show-image clone1 machinectl rename clone1 clone2 (! machinectl show-image clone1) machinectl show-image clone2 +# `machinectl read-only` uses chattr (ioctl(FS_IOC_SETFLAGS)) when the container is backed by a directory, +# and this operation might not be implemented on certain filesystems (i.e. tmpfs on older kernels), so check +# if we have chattr support before running following tests if lsattr -d /var/lib/machines >/dev/null; then [[ "$(machinectl show-image --property=ReadOnly --value clone2)" == no ]] machinectl read-only clone2 yes -- 2.47.3