From 8fd755ffe674ee2fe774a8052878f3e1104871f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= Date: Thu, 23 May 2024 18:01:24 +0200 Subject: [PATCH 1/2] 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. --- test/units/TEST-19-CGROUP.delegate.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/units/TEST-19-CGROUP.delegate.sh b/test/units/TEST-19-CGROUP.delegate.sh index 74d36c405d..022515fc8c 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 \ From 307abfc83a41962c9db76dc09f1dcc84828308ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= Date: Mon, 29 Apr 2024 17:51:54 +0200 Subject: [PATCH 2/2] Revert "TEST-19-CGROUP: Skip on opensuse" This reverts commit 60d064d3fdfc21d9209d81ed8b29fe0d90891ebf. The logged test failure was because of missing memory controller in testing cgroup. With the test fixed in previous commit, memory attributes are delegated as expected. Ref: #32439 --- test/units/TEST-19-CGROUP.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/units/TEST-19-CGROUP.sh b/test/units/TEST-19-CGROUP.sh index 60c53cd80d..9c2a033aa9 100755 --- a/test/units/TEST-19-CGROUP.sh +++ b/test/units/TEST-19-CGROUP.sh @@ -3,14 +3,6 @@ set -eux set -o pipefail -. /etc/os-release -# FIXME: This test fails on opensuse with the following error and others: -# Apr 25 10:24:04 H (cat)[910]: device-mapper: create ioctl on ... failed: Device or resource busy -if [[ "$ID" =~ "opensuse" ]]; then - echo "Skipping due to known unexpected behaviour in OpenSUSE kernels" >>/skipped - exit 77 -fi - # shellcheck source=test/units/test-control.sh . "$(dirname "$0")"/test-control.sh