Skip to content

Commit 2751571

Browse files
committed
add testcase for enable all supported controllers in cgroupv2
Signed-off-by: lifubang <lifubang@acmcoder.com>
1 parent a67dab0 commit 2751571

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/integration/cgroups.bats

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ EOF
110110

111111
runc run -d --console-socket $CONSOLE_SOCKET test_cgroups_permissions
112112
[ "$status" -eq 0 ]
113+
if [ "$CGROUP_UNIFIED" != "no" ]; then
114+
if [ -n "${RUNC_USE_SYSTEMD}" ] ; then
115+
if [ $(id -u) = "0" ]; then
116+
check_cgroup_value "cgroup.controllers" "$(cat /sys/fs/cgroup/machine.slice/cgroup.controllers)"
117+
else
118+
check_cgroup_value "cgroup.controllers" "$(cat /sys/fs/cgroup/user.slice/user-$(id -u).slice/cgroup.controllers)"
119+
fi
120+
else
121+
check_cgroup_value "cgroup.controllers" "$(cat /sys/fs/cgroup/cgroup.controllers)"
122+
fi
123+
fi
113124
}
114125

115126
@test "runc exec (limits + cgrouppath + permission on the cgroup dir) succeeds" {

0 commit comments

Comments
 (0)