Skip to content

Commit b3d46e1

Browse files
committed
selftests/harness: Actually report SKIP for signal tests
Tests that were expecting a signal were not correctly checking for a SKIP condition. Move the check before the signal checking when processing test result. Cc: Shuah Khan <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Will Drewry <[email protected]> Cc: [email protected] Fixes: 9847d24 ("selftests/harness: Refactor XFAIL into SKIP") Signed-off-by: Kees Cook <[email protected]>
1 parent fcce1c6 commit b3d46e1

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
@@ -938,7 +938,11 @@ void __wait_for_test(struct __test_metadata *t)
938938
fprintf(TH_LOG_STREAM,
939939
"# %s: Test terminated by timeout\n", t->name);
940940
} else if (WIFEXITED(status)) {
941-
if (t->termsig != -1) {
941+
if (WEXITSTATUS(status) == 255) {
942+
/* SKIP */
943+
t->passed = 1;
944+
t->skip = 1;
945+
} else if (t->termsig != -1) {
942946
t->passed = 0;
943947
fprintf(TH_LOG_STREAM,
944948
"# %s: Test exited normally instead of by signal (code: %d)\n",
@@ -950,11 +954,6 @@ void __wait_for_test(struct __test_metadata *t)
950954
case 0:
951955
t->passed = 1;
952956
break;
953-
/* SKIP */
954-
case 255:
955-
t->passed = 1;
956-
t->skip = 1;
957-
break;
958957
/* Other failure, assume step report. */
959958
default:
960959
t->passed = 0;

0 commit comments

Comments
 (0)