summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTianyi Chen <hi@tychen.cc>2026-09-06 21:54:55 +0800
committerTejun Heo <tj@kernel.org>2026-09-08 07:58:14 -1000
commit7036264dcd46ab641768ef97ab74f91bce5701c8 (patch)
treee2fdf217845bf93e34c94c1fa872069730cc662e
parent97c50e21e4ddfc91185d548c29c33ba631acbdc8 (diff)
downloadlinux-next-7036264dcd46ab641768ef97ab74f91bce5701c8.tar.gz
linux-next-7036264dcd46ab641768ef97ab74f91bce5701c8.zip
selftests/sched_ext: Fail interrupted test runs
SIGINT and SIGTERM set exit_req, causing the runner to stop before executing the remaining tests. However, the exit status only reflects the number of failed tests, so an interrupted run returns success when none of the completed tests failed. Include exit_req in the failure condition so callers can distinguish an interrupted run from a successful run. Keep the result counts limited to the tests that actually ran. Tested the actual runner under GDB, delivering each signal before the first test and after the example test passed. The original runner returns 0 in all four cases; the fixed runner returns 1. Normal -h, -l and -t example invocations still return 0. Fixes: 9d851afa4826 ("selftests/sched_ext: Abort test loop on signal") Assisted-by: LLM Signed-off-by: Tianyi Chen <hi@tychen.cc> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--tools/testing/selftests/sched_ext/runner.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/sched_ext/runner.c b/tools/testing/selftests/sched_ext/runner.c
index c264807caa91..57dda75384f1 100644
--- a/tools/testing/selftests/sched_ext/runner.c
+++ b/tools/testing/selftests/sched_ext/runner.c
@@ -243,7 +243,7 @@ int main(int argc, char **argv)
printf(" - %s\n", failed_tests[i]);
}
- return failed > 0 ? 1 : 0;
+ return failed > 0 || exit_req ? 1 : 0;
}
void scx_test_register(struct scx_test *test)