netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft 1/2] tests/shell: exit 77 from "run-tests.sh" if all tests were skipped
@ 2023-09-13 17:11 Thomas Haller
  2023-09-13 17:11 ` [PATCH nft 2/2] tests/shell: accept $NFT_TEST_TMPDIR_TAG for the result directory Thomas Haller
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Haller @ 2023-09-13 17:11 UTC (permalink / raw)
  To: NetFilter; +Cc: Thomas Haller

If there are multiple tests and some of them pass and some are skipped,
the overall result should be success (zero). Because likely the user
just selected a bunch of tests (or all of them). So skipping some tests
does not mean that the entire run is not a success.

However, if all tests are skipped, then mark the overall result as
skipped too. The more common case is if you only run one single test,
then we want to know, that the test didn't run.

Signed-off-by: Thomas Haller <thaller@redhat.com>
---
 tests/shell/run-tests.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index bdca0ee1fa0b..188ac89ca1de 100755
--- a/tests/shell/run-tests.sh
+++ b/tests/shell/run-tests.sh
@@ -728,4 +728,10 @@ if [ "$failed" -gt 0 -o "$NFT_TEST_KEEP_LOGS" = y ] ; then
 	NFT_TEST_TMPDIR=
 fi
 
-[ "$failed" -eq 0 ]
+if [ "$failed" -gt 0 ] ; then
+	exit 1
+elif [ "$ok" -eq 0 -a "$skipped" -gt 0 ] ; then
+	exit 77
+else
+	exit 0
+fi
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-13 17:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-13 17:11 [PATCH nft 1/2] tests/shell: exit 77 from "run-tests.sh" if all tests were skipped Thomas Haller
2023-09-13 17:11 ` [PATCH nft 2/2] tests/shell: accept $NFT_TEST_TMPDIR_TAG for the result directory Thomas Haller

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).