From: Thomas Haller <thaller@redhat.com>
To: NetFilter <netfilter-devel@vger.kernel.org>
Cc: Thomas Haller <thaller@redhat.com>
Subject: [PATCH nft 2/3] tests/shell: don't show the exit status for failed tests
Date: Mon, 18 Sep 2023 20:45:20 +0200 [thread overview]
Message-ID: <20230918184634.3471832-3-thaller@redhat.com> (raw)
In-Reply-To: <20230918184634.3471832-1-thaller@redhat.com>
Previously, for failed tests we would print the exit code
W: [FAILED] 2/2 tests/shell/testcases/listing/0013objects_0: got 1
This doesn't seem very useful. For one, we have special exit codes like
0 (OK), 77 (SKIPPED), 124 (DUMP FAIL), 123 (TAINTED), 122 (VALGRIND).
Any other exit code is just an arbitrary failure. We don't define any
special codes, and printing them is not useful.
Note that further exit codes (118 - 121) are reserved, and could be
special purposed, when there is a use.
You can find the real exit code from the test in the result data in the
"rc-failed" file.
Signed-off-by: Thomas Haller <thaller@redhat.com>
---
tests/shell/run-tests.sh | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index 79c818cb0f11..418fab95da94 100755
--- a/tests/shell/run-tests.sh
+++ b/tests/shell/run-tests.sh
@@ -704,7 +704,6 @@ print_test_header() {
local testfile="$2"
local testidx_completed="$3"
local status="$4"
- local suffix="$5"
local text
local s_idx
@@ -713,7 +712,7 @@ print_test_header() {
s_idx="$text/${#TESTS[@]}"
align_text text left 12 "[$status]"
- _msg "$msglevel" "$text $s_idx $testfile${suffix:+: $suffix}"
+ _msg "$msglevel" "$text $s_idx $testfile"
}
print_test_result() {
@@ -722,7 +721,6 @@ print_test_result() {
local rc_got="$3"
local result_msg_level="I"
- local result_msg_suffix=""
local result_msg_files=( "$NFT_TEST_TESTTMPDIR/testout.log" "$NFT_TEST_TESTTMPDIR/ruleset-diff" )
local result_msg_status
@@ -743,13 +741,12 @@ print_test_result() {
result_msg_status="DUMP FAIL"
else
result_msg_status="FAILED"
- result_msg_suffix="got $rc_got"
fi
result_msg_status="$RED$result_msg_status$RESET"
result_msg_files=( "$NFT_TEST_TESTTMPDIR/testout.log" )
fi
- print_test_header "$result_msg_level" "$testfile" "$((ok + skipped + failed))" "$result_msg_status" "$result_msg_suffix"
+ print_test_header "$result_msg_level" "$testfile" "$((ok + skipped + failed))" "$result_msg_status"
if [ "$VERBOSE" = "y" ] ; then
local f
@@ -773,7 +770,7 @@ job_start() {
local testidx="$2"
if [ "$NFT_TEST_JOBS" -le 1 ] ; then
- print_test_header I "$testfile" "$testidx" "EXECUTING" ""
+ print_test_header I "$testfile" "$testidx" "EXECUTING"
fi
NFT_TEST_TESTTMPDIR="${JOBS_TEMPDIR["$testfile"]}" \
--
2.41.0
next prev parent reply other threads:[~2023-09-18 18:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 18:45 [PATCH nft 0/3] tests/shell: minor improvements to "run-tests.sh" Thomas Haller
2023-09-18 18:45 ` [PATCH nft 1/3] tests/shell: set C locale in "run-tests.sh" Thomas Haller
2023-09-18 18:45 ` Thomas Haller [this message]
2023-09-18 18:45 ` [PATCH nft 3/3] tests/shell: colorize NFT_TEST_HAS_SOCKET_LIMITS Thomas Haller
2023-09-27 20:27 ` [PATCH nft 0/3] tests/shell: minor improvements to "run-tests.sh" Pablo Neira Ayuso
2023-09-27 20:47 ` Thomas Haller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230918184634.3471832-3-thaller@redhat.com \
--to=thaller@redhat.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).