Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <shuah@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Will Drewry <wad@chromium.org>
Cc: linux-kselftest@vger.kernel.org
Fixes: 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP")
Signed-off-by: Kees Cook <keescook@chromium.org>

+5 -6
+5 -6
tools/testing/selftests/kselftest_harness.h
··· 938 938 fprintf(TH_LOG_STREAM, 939 939 "# %s: Test terminated by timeout\n", t->name); 940 940 } 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) { 942 946 t->passed = 0; 943 947 fprintf(TH_LOG_STREAM, 944 948 "# %s: Test exited normally instead of by signal (code: %d)\n", ··· 953 949 /* Success */ 954 950 case 0: 955 951 t->passed = 1; 956 - break; 957 - /* SKIP */ 958 - case 255: 959 - t->passed = 1; 960 - t->skip = 1; 961 952 break; 962 953 /* Other failure, assume step report. */ 963 954 default: