Skip to content

Commit

Permalink
selftests/harness: Actually report SKIP for signal tests
Browse files Browse the repository at this point in the history
[ Upstream commit b3d46e1 ]

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]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
kees authored and gregkh committed Sep 13, 2023
1 parent d4ed5bf commit b3547e2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tools/testing/selftests/kselftest_harness.h
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,11 @@ 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 (t->termsig != -1) {
if (WEXITSTATUS(status) == 255) {
/* SKIP */
t->passed = 1;
t->skip = 1;
} else if (t->termsig != -1) {
t->passed = 0;
fprintf(TH_LOG_STREAM,
"# %s: Test exited normally instead of by signal (code: %d)\n",
Expand All @@ -950,11 +954,6 @@ void __wait_for_test(struct __test_metadata *t)
case 0:
t->passed = 1;
break;
/* SKIP */
case 255:
t->passed = 1;
t->skip = 1;
break;
/* Other failure, assume step report. */
default:
t->passed = 0;
Expand Down

0 comments on commit b3547e2

Please sign in to comment.