From: Shuah Khan <skhan@linuxfoundation.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Brown <broonie@kernel.org>, shuah <shuah@kernel.org>,
Shuah Khan <skhan@linuxfoundation.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [GIT PULL] kselftest next update regression fixes for Linux 7.1-rc1
Date: Mon, 20 Apr 2026 09:17:00 -0600 [thread overview]
Message-ID: <599c06d8-d33d-47ac-aeed-9e6caa35bb9c@linuxfoundation.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 2146 bytes --]
Hi Linus,
Please pull these fixes to regressions introduced in the next update
that are breaking CI runs.
Fixes regressions in non-bash shells and busybox support, and reverts
a commit that regression in build and installation when one or more
tests fail to build. Fixes duplicated test number reporting introduced
in ktap support patch.
- selftests: Fix duplicated test number reporting
- selftests: Fix runner.sh for non-bash shells
- selftests: Fix runner.sh busybox support
- selftests: Deescalate error reporting
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit f8e0a5a174d7d3bc3547c15bc1647c35427f5c34:
selftests/ftrace: Quote check_requires comparisons (2026-04-13 11:05:39 -0600)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-next-7.1-next-fixes
for you to fetch changes up to 83ef26f911432d9c98b6d8b6ed0709a8b79cd834:
selftests: Fix duplicated test number reporting (2026-04-17 11:29:03 -0600)
----------------------------------------------------------------
linux_kselftest-next-7.1-next-fixes
Fixes regressions in non-bash shells and busybox support, and reverts
a commit that regression in build and installation when one or more
tests fail to build. Fixes duplicated test number reporting introduced
in ktap support patch.
- selftests: Fix duplicated test number reporting
- selftests: Fix runner.sh for non-bash shells
- selftests: Fix runner.sh busybox support
- selftests: Deescalate error reporting
----------------------------------------------------------------
Mark Brown (4):
selftests: Deescalate error reporting
selftests: Fix runner.sh busybox support
selftests: Fix runner.sh for non-bash shells
selftests: Fix duplicated test number reporting
tools/testing/selftests/Makefile | 8 ++---
tools/testing/selftests/kselftest/runner.sh | 49 ++++++++++++++---------------
2 files changed, 28 insertions(+), 29 deletions(-)
----------------------------------------------------------------
[-- Attachment #2: linux_kselftest-next-7.1-next-fixes.diff --]
[-- Type: text/x-patch, Size: 5037 bytes --]
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 0949f370ad78..450f13ba4cca 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -209,14 +209,14 @@ export KHDR_INCLUDES
.DEFAULT_GOAL := all
all:
- @ret=0; \
+ @ret=1; \
for TARGET in $(TARGETS) $(INSTALL_DEP_TARGETS); do \
BUILD_TARGET=$$BUILD/$$TARGET; \
mkdir $$BUILD_TARGET -p; \
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET \
O=$(abs_objtree) \
$(if $(FORCE_TARGETS),|| exit); \
- [ $$? -eq 0 ] || ret=1; \
+ ret=$$((ret * $$?)); \
done; exit $$ret;
run_tests: all
@@ -274,7 +274,7 @@ ifdef INSTALL_PATH
install -m 744 kselftest/ksft.py $(INSTALL_PATH)/kselftest/
install -m 744 run_kselftest.sh $(INSTALL_PATH)/
rm -f $(TEST_LIST)
- @ret=0; \
+ @ret=1; \
for TARGET in $(TARGETS) $(INSTALL_DEP_TARGETS); do \
BUILD_TARGET=$$BUILD/$$TARGET; \
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install \
@@ -283,7 +283,7 @@ ifdef INSTALL_PATH
OBJ_PATH=$(INSTALL_PATH) \
O=$(abs_objtree) \
$(if $(FORCE_TARGETS),|| exit); \
- [ $$? -eq 0 ] || ret=1; \
+ ret=$$((ret * $$?)); \
done; exit $$ret;
diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh
index 6da3390825fe..311811dc55a0 100644
--- a/tools/testing/selftests/kselftest/runner.sh
+++ b/tools/testing/selftests/kselftest/runner.sh
@@ -1,8 +1,17 @@
-#!/bin/bash
+#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
#
# Runs a set of tests in a given subdirectory.
-. $(dirname "$(readlink -e "${BASH_SOURCE[0]}")")/ktap_helpers.sh
+
+# There isn't a shell-agnostic way to find the path of a sourced file,
+# so we must rely on BASE_DIR being set to find other tools.
+if [ -z "$BASE_DIR" ]; then
+ echo "Error: BASE_DIR must be set before sourcing." >&2
+ exit 1
+fi
+
+. ${BASE_DIR}/kselftest/ktap_helpers.sh
+
export timeout_rc=124
export logfile=/dev/stdout
export per_test_logging=
@@ -14,13 +23,6 @@ export RUN_IN_NETNS=
# over our soft timeout limit.
export kselftest_default_timeout=45
-# There isn't a shell-agnostic way to find the path of a sourced file,
-# so we must rely on BASE_DIR being set to find other tools.
-if [ -z "$BASE_DIR" ]; then
- echo "Error: BASE_DIR must be set before sourcing." >&2
- exit 1
-fi
-
TR_CMD=$(command -v tr)
# If Perl is unavailable, we must fall back to line-at-a-time prefixing
@@ -49,7 +51,6 @@ run_one()
{
DIR="$1"
TEST="$2"
- local rc test_num="$3"
BASENAME_TEST=$(basename $TEST)
@@ -106,7 +107,7 @@ run_one()
echo "# $TEST_HDR_MSG"
if [ ! -e "$TEST" ]; then
ktap_print_msg "Warning: file $TEST is missing!"
- ktap_test_fail "$test_num $TEST_HDR_MSG"
+ ktap_test_fail "$TEST_HDR_MSG"
rc=$KSFT_FAIL
else
if [ -x /usr/bin/stdbuf ]; then
@@ -125,7 +126,7 @@ run_one()
interpreter=$(head -n 1 "$TEST" | cut -c 3-)
cmd="$stdbuf $interpreter ./$BASENAME_TEST"
else
- ktap_test_fail "$test_num $TEST_HDR_MSG"
+ ktap_test_fail "$TEST_HDR_MSG"
return $KSFT_FAIL
fi
fi
@@ -136,15 +137,15 @@ run_one()
rc=$?
case "$rc" in
"$KSFT_PASS")
- ktap_test_pass "$test_num $TEST_HDR_MSG";;
+ ktap_test_pass "$TEST_HDR_MSG";;
"$KSFT_SKIP")
- ktap_test_skip "$test_num $TEST_HDR_MSG";;
+ ktap_test_skip "$TEST_HDR_MSG";;
"$KSFT_XFAIL")
- ktap_test_xfail "$test_num $TEST_HDR_MSG";;
+ ktap_test_xfail "$TEST_HDR_MSG";;
"$timeout_rc")
- ktap_test_fail "$test_num $TEST_HDR_MSG # TIMEOUT $kselftest_timeout seconds";;
+ ktap_test_fail "$TEST_HDR_MSG # TIMEOUT $kselftest_timeout seconds";;
*)
- ktap_test_fail "$test_num $TEST_HDR_MSG # exit=$rc";;
+ ktap_test_fail "$TEST_HDR_MSG # exit=$rc";;
esac
cd - >/dev/null
fi
@@ -159,7 +160,7 @@ in_netns()
BASE_DIR=$BASE_DIR
source $BASE_DIR/kselftest/runner.sh
logfile=$logfile
- run_one $DIR $TEST $test_num
+ run_one $DIR $TEST
EOF
}
@@ -172,7 +173,7 @@ run_in_netns()
ip netns add $netns
if [ $? -ne 0 ]; then
ktap_print_msg "Warning: Create namespace failed for $BASENAME_TEST"
- ktap_test_fail "$test_num selftests: $DIR: $BASENAME_TEST # Create NS failed"
+ ktap_test_fail "selftests: $DIR: $BASENAME_TEST # Create NS failed"
fi
ip -n $netns link set lo up
@@ -189,28 +190,26 @@ run_in_netns()
run_many()
{
DIR="${PWD#${BASE_DIR}/}"
- test_num=0
local rc
- pids=()
+ pids=
for TEST in "$@"; do
BASENAME_TEST=$(basename $TEST)
- test_num=$(( test_num + 1 ))
if [ -n "$per_test_logging" ]; then
logfile="$per_test_log_dir/$BASENAME_TEST"
cat /dev/null > "$logfile"
fi
if [ -n "$RUN_IN_NETNS" ]; then
run_in_netns &
- pids+=($!)
+ pids="$pids $!"
else
- run_one "$DIR" "$TEST" "$test_num"
+ run_one "$DIR" "$TEST"
fi
done
# These variables are outputs of ktap_helpers.sh but since we've
# run the test in a subprocess we need to update them manually
- for pid in "${pids[@]}"; do
+ for pid in $pids; do
wait "$pid"
rc=$?
case "$rc" in
next reply other threads:[~2026-04-20 15:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 15:17 Shuah Khan [this message]
2026-04-21 0:31 ` [GIT PULL] kselftest next update regression fixes for Linux 7.1-rc1 pr-tracker-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=599c06d8-d33d-47ac-aeed-9e6caa35bb9c@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox