From cc15b887a00069b14513d457eee0dd0d19c8efaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Wed, 17 Feb 2021 13:05:17 -0500 Subject: [PATCH] tests: add integration test for cgroups hybrid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check that runc run and runc exec put the process on the same cgroups v2 when using hybrid mode. Signed-off-by: Mauricio Vásquez Signed-off-by: Kir Kolyshkin --- tests/integration/cgroups.bats | 21 +++++++++++++++++++++ tests/integration/helpers.bash | 9 +++++++++ 2 files changed, 30 insertions(+) diff --git a/tests/integration/cgroups.bats b/tests/integration/cgroups.bats index ee95a01f6..57e81b15c 100644 --- a/tests/integration/cgroups.bats +++ b/tests/integration/cgroups.bats @@ -282,3 +282,24 @@ function setup() { [ "$status" -eq 0 ] [ "$(wc -l <<<"$output")" -eq 1 ] } + +@test "runc exec (cgroup v1+hybrid joins correct cgroup)" { + requires root cgroups_hybrid + + set_cgroups_path + + runc run --pid-file pid.txt -d --console-socket "$CONSOLE_SOCKET" test_cgroups_group + [ "$status" -eq 0 ] + + pid=$(cat pid.txt) + run_cgroup=$(tail -1