mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
tests/int: fixup find statements
1. Add "-maxdepth 2" to not dive too deep into cgroup hierarchy. 2. Add "-type f" to look for a regular file. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -121,7 +121,7 @@ function init_cgroup_paths() {
|
||||
CGROUP_BASE_PATH=/sys/fs/cgroup
|
||||
|
||||
# Find any cgroup.freeze files...
|
||||
if [ -n "$(find "$CGROUP_BASE_PATH" -type f -name "cgroup.freeze" -print -quit)" ]; then
|
||||
if [ -n "$(find "$CGROUP_BASE_PATH" -maxdepth 2 -type f -name "cgroup.freeze" -print -quit)" ]; then
|
||||
CGROUP_SUBSYSTEMS+=" freezer"
|
||||
fi
|
||||
else
|
||||
@@ -460,7 +460,7 @@ function requires() {
|
||||
init_cgroup_paths
|
||||
[ -v CGROUP_V1 ] && p="$CGROUP_CPU_BASE_PATH"
|
||||
[ -v CGROUP_V2 ] && p="$CGROUP_BASE_PATH"
|
||||
if [ -z "$(find "$p" -name cpu.idle -print -quit)" ]; then
|
||||
if [ -z "$(find "$p" -maxdepth 2 -type f -name cpu.idle -print -quit)" ]; then
|
||||
skip_me=1
|
||||
fi
|
||||
;;
|
||||
@@ -476,7 +476,7 @@ function requires() {
|
||||
p="$CGROUP_BASE_PATH"
|
||||
f="cpu.max.burst"
|
||||
fi
|
||||
if [ -z "$(find "$p" -name "$f" -print -quit)" ]; then
|
||||
if [ -z "$(find "$p" -maxdepth 2 -type f -name "$f" -print -quit)" ]; then
|
||||
skip_me=1
|
||||
fi
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user