Skip to content

Commit 8626c71

Browse files
kolyshkinlifubang
authored andcommitted
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 <[email protected]>
1 parent e530b2a commit 8626c71

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/integration/helpers.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function init_cgroup_paths() {
121121
CGROUP_BASE_PATH=/sys/fs/cgroup
122122

123123
# Find any cgroup.freeze files...
124-
if [ -n "$(find "$CGROUP_BASE_PATH" -type f -name "cgroup.freeze" -print -quit)" ]; then
124+
if [ -n "$(find "$CGROUP_BASE_PATH" -maxdepth 2 -type f -name "cgroup.freeze" -print -quit)" ]; then
125125
CGROUP_SUBSYSTEMS+=" freezer"
126126
fi
127127
else
@@ -460,7 +460,7 @@ function requires() {
460460
init_cgroup_paths
461461
[ -v CGROUP_V1 ] && p="$CGROUP_CPU_BASE_PATH"
462462
[ -v CGROUP_V2 ] && p="$CGROUP_BASE_PATH"
463-
if [ -z "$(find "$p" -name cpu.idle -print -quit)" ]; then
463+
if [ -z "$(find "$p" -maxdepth 2 -type f -name cpu.idle -print -quit)" ]; then
464464
skip_me=1
465465
fi
466466
;;
@@ -476,7 +476,7 @@ function requires() {
476476
p="$CGROUP_BASE_PATH"
477477
f="cpu.max.burst"
478478
fi
479-
if [ -z "$(find "$p" -name "$f" -print -quit)" ]; then
479+
if [ -z "$(find "$p" -maxdepth 2 -type f -name "$f" -print -quit)" ]; then
480480
skip_me=1
481481
fi
482482
;;

0 commit comments

Comments
 (0)