test_so_rcv.sh uses KSFT_FAIL and KSFT_PASS, but lib.sh defines the lowercase ksft_fail and ksft_pass constants. With the uppercase variables unset, exit has no argument and returns the successful echo status, even when the script has reported failed tests. Use the constants actually provided by lib.sh so failures produce a nonzero exit status. Run as root from tools/testing/selftests/net after building the helpers. For the original four-case script, this changes only sender metadata to 1 while the listeners still expect 2 or 3: sed '/\.\/cmsg_sender/s/\$arg/${arg% *} 1/' test_so_rcv.sh | bash echo $? Both versions report four failures. The original prints 0 as the exit status; with this fix it prints 1. AI-assisted inspection found this while extending the receive tests. With deliberately mismatched sender metadata, all four original cases fail on both versions: the original script exits 0 and the corrected script exits 1. The unmodified sender passes all four cases with exit 0. No kernel instrumentation or fault injection was used. Fixes: c935af429ec2 ("selftests: net: add support for testing SO_RCVMARK and SO_RCVPRIORITY") Signed-off-by: Jingjing Xu --- tools/testing/selftests/net/test_so_rcv.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/test_so_rcv.sh b/tools/testing/selftests/net/test_so_rcv.sh index d8aa4362879d..ae01fa3c5329 100755 --- a/tools/testing/selftests/net/test_so_rcv.sh +++ b/tools/testing/selftests/net/test_so_rcv.sh @@ -66,8 +66,8 @@ done if [ "$FAILED_TESTS" -ne 0 ]; then echo "FAIL - $FAILED_TESTS/$TOTAL_TESTS tests failed" - exit ${KSFT_FAIL} + exit ${ksft_fail} else echo "OK - All $TOTAL_TESTS tests passed" - exit ${KSFT_PASS} + exit ${ksft_pass} fi base-commit: 57f165ff2f30491bc3511d24a52ca516751a268b -- 2.53.0