selftests: net/fcnal-test.sh: add exit code

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 <philip.li@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Li Zhijian <zhijianx.li@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Li Zhijian 2021-12-03 10:32:13 +08:00 committed by David S. Miller
parent dac8e00fb6
commit 0f8a3b48f9
1 changed files with 8 additions and 0 deletions

View File

@ -4077,3 +4077,11 @@ cleanup 2>/dev/null
printf "\nTests passed: %3d\n" ${nsuccess} printf "\nTests passed: %3d\n" ${nsuccess}
printf "Tests failed: %3d\n" ${nfail} 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