[PATCH 2/6] selftests/run_kselftest.sh: Add missing quotes

From: Ricardo B. Marlière

Date: Fri Mar 20 2026 - 14:35:46 EST


Fix the following shellcheck warning:

Double quote to prevent globbing and word splitting. [SC2086]

Signed-off-by: Ricardo B. Marlière <rbm@xxxxxxxx>
---
tools/testing/selftests/run_kselftest.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/run_kselftest.sh b/tools/testing/selftests/run_kselftest.sh
index 9abea79018d7..b782b025d002 100755
--- a/tools/testing/selftests/run_kselftest.sh
+++ b/tools/testing/selftests/run_kselftest.sh
@@ -11,7 +11,7 @@ else
BASE_DIR=$(readlink -f $(dirname $0))
fi

-cd $BASE_DIR
+cd "$BASE_DIR"
TESTS="$BASE_DIR"/kselftest-list.txt
if [ ! -r "$TESTS" ] ; then
echo "$0: Could not find list of tests to run ($TESTS)" >&2
@@ -38,7 +38,7 @@ Usage: $0 [OPTIONS]
-h | --help Show this usage info
-o | --override-timeout Number of seconds after which we timeout
EOF
- exit $1
+ exit "$1"
}

COLLECTIONS=""
@@ -51,7 +51,7 @@ while true; do
case "$1" in
-s | --summary)
logfile="$BASE_DIR"/output.log
- cat /dev/null > $logfile
+ cat /dev/null > "$logfile"
shift ;;
-p | --per-test-log)
per_test_logging=1
@@ -127,7 +127,7 @@ collections=$(echo "$available" | cut -d: -f1 | sort | uniq)
for collection in $collections ; do
[ -w /dev/kmsg ] && echo "kselftest: Running tests in $collection" >> /dev/kmsg
tests=$(echo "$available" | grep "^$collection:" | cut -d: -f2)
- ($dryrun cd "$collection" && $dryrun run_many $tests)
+ ($dryrun cd "$collection" && $dryrun run_many "$tests")
done

failures="$(cat "$kselftest_failures_file")"

--
2.53.0