selftests/sched_ext: Fail interrupted test runs
Subsystems (2)
PATCH 1/1 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.
--- tools/testing/selftests/sched_ext/runner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/sched_ext/runner.c +1 -1
@@ -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)
Signature · 1 line
2.55.0
Hello, Tianyi.
Applied to sched_ext/for-7.4.
Thanks.
Signature · 1 line
tejun