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

Subsystems: kernel selftest framework, networking [general], the rest

STALE1771d

2 messages, 2 authors, 2021-12-03 · open the first message on its own page

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

From: Li Zhijian <hidden>
Date: 2021-12-03 02:37:59

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 <redacted>
Reported-by: kernel test robot <redacted>
Signed-off-by: Li Zhijian <redacted>
---
 tools/testing/selftests/net/fcnal-test.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
index 3313566ce906..46297ceaa6d1 100755
--- a/tools/testing/selftests/net/fcnal-test.sh
+++ b/tools/testing/selftests/net/fcnal-test.sh
@@ -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
-- 
2.32.0

Re: [PATCH] selftests: net/fcnal-test.sh: add exit code

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-12-03 14:20:19

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller [off-list ref]:

On Fri,  3 Dec 2021 10:32:13 +0800 you wrote:
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 <redacted>
Reported-by: kernel test robot <redacted>
Signed-off-by: Li Zhijian <redacted>

[...]
Here is the summary with links:
  - selftests: net/fcnal-test.sh: add exit code
    https://git.kernel.org/netdev/net/c/0f8a3b48f91b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help