Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: fib_nexthops: do not mark skipped tests as failed

The current test marks all unexpected return values as failed and sets ret
to 1. If a test is skipped, the entire test also returns 1, incorrectly
indicating failure.

To fix this, add a skipped variable and set ret to 4 if it was previously
0. Otherwise, keep ret set to 1.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://patch.msgid.link/20250220085326.1512814-1-liuhangbin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Hangbin Liu and committed by
Jakub Kicinski
465b210f 27422c37

+5 -2
+5 -2
tools/testing/selftests/net/fib_nexthops.sh
··· 76 76 printf "TEST: %-60s [ OK ]\n" "${msg}" 77 77 nsuccess=$((nsuccess+1)) 78 78 else 79 - ret=1 80 - nfail=$((nfail+1)) 81 79 if [[ $rc -eq $ksft_skip ]]; then 80 + [[ $ret -eq 0 ]] && ret=$ksft_skip 81 + nskip=$((nskip+1)) 82 82 printf "TEST: %-60s [SKIP]\n" "${msg}" 83 83 else 84 + ret=1 85 + nfail=$((nfail+1)) 84 86 printf "TEST: %-60s [FAIL]\n" "${msg}" 85 87 fi 86 88 ··· 2530 2528 if [ "$TESTS" != "none" ]; then 2531 2529 printf "\nTests passed: %3d\n" ${nsuccess} 2532 2530 printf "Tests failed: %3d\n" ${nfail} 2531 + printf "Tests skipped: %2d\n" ${nskip} 2533 2532 fi 2534 2533 2535 2534 exit $ret