From: Michal Koutný Date: Thu, 23 May 2024 16:01:24 +0000 (+0200) Subject: test: Ensure delegation test unit has memory controller X-Git-Tag: v256-rc4~93^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fd755ffe674ee2fe774a8052878f3e1104871f1;p=thirdparty%2Fsystemd.git test: Ensure delegation test unit has memory controller When the test used to be run on distro that doesn't enable memory accounting by default (such as openSUSE TW), there is no guarantee that testing unit has memory.* cgroup attributes and delegation test would fail if they are missing. Require memory controller explicitly inside the unit so that test can work in any environment. --- diff --git a/test/units/TEST-19-CGROUP.delegate.sh b/test/units/TEST-19-CGROUP.delegate.sh index 74d36c405da..022515fc8cc 100755 --- a/test/units/TEST-19-CGROUP.delegate.sh +++ b/test/units/TEST-19-CGROUP.delegate.sh @@ -32,6 +32,7 @@ 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="MemoryAccounting=1" \ --property="DynamicUser=1" \ --property="Delegate=" \ test -w /sys/fs/cgroup/system.slice/test-0.service/ -a \