]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/timers: Clean up kernel version check in posix_timers
authorWake Liu <wakel@google.com>
Mon, 3 Nov 2025 11:45:02 +0000 (19:45 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 14 Nov 2025 19:34:50 +0000 (20:34 +0100)
commit05d89fe7e46a52bb5dde7ac3f07b383895fab528
treeb120f325a2629005d36b730240122c43e1a55485
parent4518767be9089ea4f54754ad27364d6134fc46e2
selftests/timers: Clean up kernel version check in posix_timers

Several tests in the posix_timers selftest which test timer behavior
related to SIG_IGN fail on kernels older than 6.13. This is due to
a refactoring of signal handling in commit caf77435dd8a ("signal:
Handle ignored signals in do_sigaction(action != SIG_IGN)").

A previous attempt to fix this by adding a kernel version check to each
of the nine affected tests was suboptimal, as it resulted in emitting
the same skip message nine times.

Following the suggestion from Thomas Gleixner, this is refactored to
perform a single version check in main(). To satisfy the kselftest
framework's requirement for the test count to match the declared plan,
the plan is now conditionally set to 10 (for older kernels) or 19.

While setting the plan conditionally may seem complex, it is the
better approach to avoid the alternatives: either running tests on
unsupported kernels that are known to fail, or emitting a noisy series
of nine identical skip messages. A single informational message is now
printed instead when the tests are skipped.

Signed-off-by: Wake Liu <wakel@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250807085042.1690931-1-wakel@google.com/
Link: https://patch.msgid.link/20251103114502.584940-1-wakel@google.com
tools/testing/selftests/timers/posix_timers.c