From 41e04aa6833915ea478697a7ad8a34a740a5af09 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 9 Aug 2022 14:10:22 -0700 Subject: [PATCH] tests/int: rename a variable Rename CGROUP_PATH to CGROUP_V2_PATH so it is more clear that it can only be used for CGROUP_V2, and to resolve ambiguity with CGROUP_PATH variable used in tests/rootless.sh. Signed-off-by: Kir Kolyshkin --- tests/integration/cgroups.bats | 2 +- tests/integration/delete.bats | 4 ++-- tests/integration/helpers.bash | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/integration/cgroups.bats b/tests/integration/cgroups.bats index 89d4b3626..1842bdcf3 100644 --- a/tests/integration/cgroups.bats +++ b/tests/integration/cgroups.bats @@ -386,7 +386,7 @@ function setup() { FREEZER="${FREEZER_DIR}/freezer.state" STATE="FROZEN" else - FREEZER_DIR="${CGROUP_PATH}" + FREEZER_DIR="${CGROUP_V2_PATH}" FREEZER="${FREEZER_DIR}/cgroup.freeze" STATE="1" fi diff --git a/tests/integration/delete.bats b/tests/integration/delete.bats index 9b95b845a..efd43de5b 100644 --- a/tests/integration/delete.bats +++ b/tests/integration/delete.bats @@ -157,7 +157,7 @@ EOF [[ "$output" =~ [0-9]+ ]] # check create subcgroups success - [ -d "$CGROUP_PATH"/foo ] + [ -d "$CGROUP_V2_PATH"/foo ] # force delete test_busybox runc delete --force test_busybox @@ -166,5 +166,5 @@ EOF [ "$status" -ne 0 ] # check delete subcgroups success - [ ! -d "$CGROUP_PATH"/foo ] + [ ! -d "$CGROUP_V2_PATH"/foo ] } diff --git a/tests/integration/helpers.bash b/tests/integration/helpers.bash index ee2e9c9e0..7b1cc4a08 100644 --- a/tests/integration/helpers.bash +++ b/tests/integration/helpers.bash @@ -220,7 +220,7 @@ function set_cgroups_path() { # Absolute path to container's cgroup v2. if [ -v CGROUP_V2 ]; then - CGROUP_PATH=${CGROUP_BASE_PATH}${REL_CGROUPS_PATH} + CGROUP_V2_PATH=${CGROUP_BASE_PATH}${REL_CGROUPS_PATH} fi [ -v pod ] && create_parent @@ -233,7 +233,7 @@ function set_cgroups_path() { # $1: controller name (like "pids") or a file name (like "pids.max"). function get_cgroup_path() { if [ -v CGROUP_V2 ]; then - echo "$CGROUP_PATH" + echo "$CGROUP_V2_PATH" return fi