Merge pull request #2818 from kolyshkin/rootless-cgroup2-mount

Fix cgroup2 mount for rootless case
This commit is contained in:
Mrunal Patel
2021-04-22 17:04:19 -07:00
committed by GitHub
5 changed files with 79 additions and 32 deletions
+17 -1
View File
@@ -138,7 +138,8 @@ function setup() {
}
@test "runc run (blkio weight)" {
requires root cgroups_v2
requires cgroups_v2
[[ "$ROOTLESS" -ne 0 ]] && requires rootless_cgroup
set_cgroups_path
update_config '.linux.resources.blockIO |= {"weight": 750}'
@@ -235,3 +236,18 @@ function setup() {
check_cpu_weight 42
}
@test "runc run (cgroupv2 mount inside container)" {
requires cgroups_v2
[[ "$ROOTLESS" -ne 0 ]] && requires rootless_cgroup
set_cgroups_path
runc run -d --console-socket "$CONSOLE_SOCKET" test_cgroups_unified
[ "$status" -eq 0 ]
# Make sure we don't have any extra cgroups inside
runc exec test_cgroups_unified find /sys/fs/cgroup/ -type d
[ "$status" -eq 0 ]
[ "$(wc -l <<<"$output")" -eq 1 ]
}