summaryrefslogtreecommitdiffstats
path: root/tests/shell/run-tests.sh
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-09-08 00:07:14 +0200
committerFlorian Westphal <fw@strlen.de>2023-09-08 11:50:41 +0200
commit264614afb9dcbe0c8f841e174962e57931ec6b46 (patch)
tree4e45d350b44b01df225c2c1c61a857941b72f438 /tests/shell/run-tests.sh
parent55fe071cd1939cca2294ceeef639625c3d81abeb (diff)
tests/shell: cleanup print_test_result() and show TAINTED error code
We will add more special error codes (122 for VALGRIND). Minor refactor of print_test_result() to make it easier to extend for that. Also, we will soon colorize the output. This preparation patch makes that easier too. Signed-off-by: Thomas Haller <thaller@redhat.com> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/shell/run-tests.sh')
-rwxr-xr-xtests/shell/run-tests.sh18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index 423c5465..e0adb27a 100755
--- a/tests/shell/run-tests.sh
+++ b/tests/shell/run-tests.sh
@@ -471,25 +471,27 @@ print_test_result() {
shift 3
local result_msg_level="I"
- local result_msg_status="OK"
local result_msg_suffix=""
local result_msg_files=( "$NFT_TEST_TESTTMPDIR/testout.log" "$NFT_TEST_TESTTMPDIR/ruleset-diff" )
+ local result_msg_status
if [ "$rc_got" -eq 0 ] ; then
((ok++))
- elif [ "$rc_got" -eq 124 ] ; then
- ((failed++))
- result_msg_level="W"
- result_msg_status="DUMP FAIL"
+ result_msg_status="OK"
elif [ "$rc_got" -eq 77 ] ; then
((skipped++))
- result_msg_level="I"
result_msg_status="SKIPPED"
else
((failed++))
result_msg_level="W"
- result_msg_status="FAILED"
- result_msg_suffix="got $rc_got"
+ if [ "$rc_got" -eq 123 ] ; then
+ result_msg_status="TAINTED"
+ elif [ "$rc_got" -eq 124 ] ; then
+ result_msg_status="DUMP FAIL"
+ else
+ result_msg_status="FAILED"
+ result_msg_suffix="got $rc_got"
+ fi
result_msg_files=( "$NFT_TEST_TESTTMPDIR/testout.log" )
fi