Skip to content

Commit a724707

Browse files
kuba-moodavem330
authored andcommitted
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@chromium.org> Tested-by: Jakub Sitnicki <jakub@cloudflare.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0710a1a commit a724707

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tools/testing/selftests/kselftest_harness.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ void __wait_for_test(struct __test_metadata *t)
936936
fprintf(TH_LOG_STREAM,
937937
"# %s: Test terminated by timeout\n", t->name);
938938
} else if (WIFEXITED(status)) {
939-
if (WEXITSTATUS(status) == 255) {
939+
if (WEXITSTATUS(status) == KSFT_SKIP) {
940940
/* SKIP */
941941
t->passed = 1;
942942
t->skip = 1;
@@ -949,7 +949,7 @@ void __wait_for_test(struct __test_metadata *t)
949949
} else {
950950
switch (WEXITSTATUS(status)) {
951951
/* Success */
952-
case 0:
952+
case KSFT_PASS:
953953
t->passed = 1;
954954
break;
955955
/* Failure */
@@ -1128,11 +1128,10 @@ void __run_test(struct __fixture_metadata *f,
11281128
setpgrp();
11291129
t->fn(t, variant);
11301130
if (t->skip)
1131-
_exit(255);
1132-
/* Pass is exit 0 */
1131+
_exit(KSFT_SKIP);
11331132
if (t->passed)
1134-
_exit(0);
1135-
_exit(1);
1133+
_exit(KSFT_PASS);
1134+
_exit(KSFT_FAIL);
11361135
} else {
11371136
__wait_for_test(t);
11381137
}

0 commit comments

Comments
 (0)