From: Lennart Poettering Date: Wed, 13 Dec 2023 09:10:56 +0000 (+0100) Subject: test: test that delegation of some newer attrs that shall be delegated work X-Git-Tag: v256-rc1~1499^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F30450%2Fhead;p=thirdparty%2Fsystemd.git test: test that delegation of some newer attrs that shall be delegated work --- diff --git a/test/units/testsuite-19.delegate.sh b/test/units/testsuite-19.delegate.sh index 83446a5704b..74d36c405da 100755 --- a/test/units/testsuite-19.delegate.sh +++ b/test/units/testsuite-19.delegate.sh @@ -26,6 +26,19 @@ systemd-run --wait \ -w /sys/fs/cgroup/system.slice/test-0.service/cgroup.procs -a \ -w /sys/fs/cgroup/system.slice/test-0.service/cgroup.subtree_control +# Test if this also works for some of the more recent attrs the kernel might or might not support +for attr in cgroup.threads memory.oom.group memory.reclaim ; do + + if grep -q "$attr" /sys/kernel/cgroup/delegate ; then + systemd-run --wait \ + --unit=test-0.service \ + --property="DynamicUser=1" \ + --property="Delegate=" \ + test -w /sys/fs/cgroup/system.slice/test-0.service/ -a \ + -w /sys/fs/cgroup/system.slice/test-0.service/"$attr" + fi +done + systemd-run --wait \ --unit=test-1.service \ --property="DynamicUser=1" \