Skip to content

Commit ed43523

Browse files
poetteringkeszybz
authored andcommitted
test: test that delegation of some newer attrs that shall be delegated work
(cherry picked from commit 113defc)
1 parent 9b298cb commit ed43523

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/units/testsuite-19.delegate.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ systemd-run --wait \
2626
-w /sys/fs/cgroup/system.slice/test-0.service/cgroup.procs -a \
2727
-w /sys/fs/cgroup/system.slice/test-0.service/cgroup.subtree_control
2828

29+
# Test if this also works for some of the more recent attrs the kernel might or might not support
30+
for attr in cgroup.threads memory.oom.group memory.reclaim ; do
31+
32+
if grep -q "$attr" /sys/kernel/cgroup/delegate ; then
33+
systemd-run --wait \
34+
--unit=test-0.service \
35+
--property="DynamicUser=1" \
36+
--property="Delegate=" \
37+
test -w /sys/fs/cgroup/system.slice/test-0.service/ -a \
38+
-w /sys/fs/cgroup/system.slice/test-0.service/"$attr"
39+
fi
40+
done
41+
2942
systemd-run --wait \
3043
--unit=test-1.service \
3144
--property="DynamicUser=1" \

0 commit comments

Comments
 (0)