test: add a brief comment for the chattr check
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 21 May 2024 13:08:07 +0000 (15:08 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 21 May 2024 13:08:07 +0000 (15:08 +0200)
Addresses: https://github.com/systemd/systemd/pull/32907#discussion_r1605919598

test/units/TEST-13-NSPAWN.machinectl.sh

index c27207bcc7d98988dc67c12e67ae56b1942399f5..462cc6a8c33d55b75f854ac6aae70030ccbf1a21 100755 (executable)
@@ -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