From: Frantisek Sumsal Date: Tue, 21 May 2024 13:08:07 +0000 (+0200) Subject: test: add a brief comment for the chattr check X-Git-Tag: v256-rc3~15^2 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=d3c14f78cd66a498c2ff8a836bfc4f6a110315fe;p=systemd%2F.git test: add a brief comment for the chattr check Addresses: https://github.com/systemd/systemd/pull/32907#discussion_r1605919598 --- diff --git a/test/units/TEST-13-NSPAWN.machinectl.sh b/test/units/TEST-13-NSPAWN.machinectl.sh index c27207bcc7..462cc6a8c3 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