From 8626c7173ef9965f8b1f367b0be3f91df2c257d9 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Fri, 2 Feb 2024 15:05:05 -0800 Subject: [PATCH] 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 --- tests/integration/helpers.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/helpers.bash b/tests/integration/helpers.bash index e1d2a80af..4702d9714 100755 --- a/tests/integration/helpers.bash +++ b/tests/integration/helpers.bash @@ -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 ;;