Skip to content

Commit

Permalink
selftests: net/fcnal-test.sh: add exit code
Browse files Browse the repository at this point in the history
Previously, the selftest framework always treats it as *ok* even though
some of them are failed actually. That's because the script always
returns 0.

It supports PASS/FAIL/SKIP exit code now.

CC: Philip Li <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Li Zhijian <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
zhijianli88 authored and davem330 committed Dec 3, 2021
1 parent dac8e00 commit 0f8a3b4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/testing/selftests/net/fcnal-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4077,3 +4077,11 @@ cleanup 2>/dev/null

printf "\nTests passed: %3d\n" ${nsuccess}
printf "Tests failed: %3d\n" ${nfail}

if [ $nfail -ne 0 ]; then
exit 1 # KSFT_FAIL
elif [ $nsuccess -eq 0 ]; then
exit $ksft_skip
fi

exit 0 # KSFT_PASS

0 comments on commit 0f8a3b4

Please sign in to comment.