test: add a brief comment for the chattr check

Addresses: https://github.com/systemd/systemd/pull/32907#discussion_r1605919598
This commit is contained in:
Frantisek Sumsal
2024-05-21 15:08:07 +02:00
parent 95400d1d83
commit d3c14f78cd

View File

@@ -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