summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorBreno Leitao <leitao@debian.org>2026-03-02 17:40:39 +0300
committerJakub Kicinski <kuba@kernel.org>2026-03-04 04:22:54 +0300
commitdfa77c0dd4ab267d3f1160617c95eab80181a76f (patch)
tree57921fae06e151831fceef377ea54dae7d078856 /tools/testing
parent1085c258d88493f920789e1215b31f32031942ac (diff)
downloadlinux-dfa77c0dd4ab267d3f1160617c95eab80181a76f.tar.xz
selftests: netconsole: print diagnostic on busywait timeout in netcons_basic
The script uses set -euo pipefail, so when busywait times out waiting for the netconsole message to arrive, it returns 1 and the script exits immediately without printing any error message. As reported by Jakub, this makes failures hard to diagnose since the test reports exit=1 with no explanation. Handle the busywait failure explicitly so that a FAIL message is printed before exiting. This is how it looks like now: Running with target mode: basic (ipv6) [ 167.452561] netconsole selftest: netcons_QdMay FAIL: Timed out waiting (20000 ms) for netconsole message in /tmp/netcons_QdMay The remaining silent failures under set -e can only happen during the setup phase (netdevsim creation, interface configuration, configfs writes). So, it is not expected to have any silent failure once the test starts. Note that this issue might be less frequent now, since commit a68a9bd086c28 ("selftests: netconsole: Increase port listening timeout") increased the timeout that _might_ have been the root cause of these random failures in NIPA. Signed-off-by: Breno Leitao <leitao@debian.org> Link: https://patch.msgid.link/20260302-netconsole_test_verbose-v1-1-b1be5d30cd7d@debian.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing')
-rwxr-xr-xtools/testing/selftests/drivers/net/netconsole/netcons_basic.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/testing/selftests/drivers/net/netconsole/netcons_basic.sh b/tools/testing/selftests/drivers/net/netconsole/netcons_basic.sh
index 59cf10013ecd..7976206523b2 100755
--- a/tools/testing/selftests/drivers/net/netconsole/netcons_basic.sh
+++ b/tools/testing/selftests/drivers/net/netconsole/netcons_basic.sh
@@ -58,7 +58,11 @@ do
# Send the message
echo "${MSG}: ${TARGET}" > /dev/kmsg
# Wait until socat saves the file to disk
- busywait "${BUSYWAIT_TIMEOUT}" test -s "${OUTPUT_FILE}"
+ if ! busywait "${BUSYWAIT_TIMEOUT}" test -s "${OUTPUT_FILE}"
+ then
+ echo "FAIL: Timed out waiting (${BUSYWAIT_TIMEOUT} ms) for netconsole message in ${OUTPUT_FILE}" >&2
+ exit "${ksft_fail}"
+ fi
# Make sure the message was received in the dst part
# and exit