[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240229005920.2407409-4-kuba@kernel.org>
Date: Wed, 28 Feb 2024 16:59:10 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org,
edumazet@...gle.com,
pabeni@...hat.com,
shuah@...nel.org,
linux-kselftest@...r.kernel.org,
mic@...ikod.net,
linux-security-module@...r.kernel.org,
keescook@...omium.org,
jakub@...udflare.com,
Jakub Kicinski <kuba@...nel.org>,
luto@...capital.net,
wad@...omium.org
Subject: [PATCH v4 03/12] selftests: kselftest_harness: use KSFT_* exit codes
Now that we no longer need low exit codes to communicate
assertion steps - use normal KSFT exit codes.
Acked-by: Kees Cook <keescook@...omium.org>
Tested-by: Jakub Sitnicki <jakub@...udflare.com>
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
CC: keescook@...omium.org
CC: luto@...capital.net
CC: wad@...omium.org
CC: shuah@...nel.org
CC: mic@...ikod.net
CC: linux-kselftest@...r.kernel.org
CC: linux-security-module@...r.kernel.org
---
tools/testing/selftests/kselftest_harness.h | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
index ad49832457af..62ce258b0853 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -936,7 +936,7 @@ void __wait_for_test(struct __test_metadata *t)
fprintf(TH_LOG_STREAM,
"# %s: Test terminated by timeout\n", t->name);
} else if (WIFEXITED(status)) {
- if (WEXITSTATUS(status) == 255) {
+ if (WEXITSTATUS(status) == KSFT_SKIP) {
/* SKIP */
t->passed = 1;
t->skip = 1;
@@ -949,7 +949,7 @@ void __wait_for_test(struct __test_metadata *t)
} else {
switch (WEXITSTATUS(status)) {
/* Success */
- case 0:
+ case KSFT_PASS:
t->passed = 1;
break;
/* Failure */
@@ -1128,11 +1128,10 @@ void __run_test(struct __fixture_metadata *f,
setpgrp();
t->fn(t, variant);
if (t->skip)
- _exit(255);
- /* Pass is exit 0 */
+ _exit(KSFT_SKIP);
if (t->passed)
- _exit(0);
- _exit(1);
+ _exit(KSFT_PASS);
+ _exit(KSFT_FAIL);
} else {
__wait_for_test(t);
}
--
2.43.2
Powered by blists - more mailing lists