mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
tests/int/helpers: fix cgroups_swap check for v2
In case of cgroup v2, there's no memory.swap.max in the top-level cgroup, so we have to use find. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -451,8 +451,14 @@ function requires() {
|
||||
;;
|
||||
cgroups_swap)
|
||||
init_cgroup_paths
|
||||
if [ -v CGROUP_V1 ] && [ ! -e "${CGROUP_MEMORY_BASE_PATH}/memory.memsw.limit_in_bytes" ]; then
|
||||
skip_me=1
|
||||
if [ -v CGROUP_V1 ]; then
|
||||
if [ ! -e "${CGROUP_MEMORY_BASE_PATH}/memory.memsw.limit_in_bytes" ]; then
|
||||
skip_me=1
|
||||
fi
|
||||
elif [ -v CGROUP_V2 ]; then
|
||||
if [ -z "$(find "$CGROUP_BASE_PATH" -maxdepth 2 -type f -name memory.swap.max -print -quit)" ]; then
|
||||
skip_me=1
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
cgroups_cpu_idle)
|
||||
|
||||
Reference in New Issue
Block a user