public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/timers: Skip some posix_timers tests on kernels < 6.13
@ 2025-08-07  8:50 Wake Liu
  2025-09-21  7:59 ` Thomas Gleixner
  0 siblings, 1 reply; 4+ messages in thread
From: Wake Liu @ 2025-08-07  8:50 UTC (permalink / raw)
  To: John Stultz, Thomas Gleixner, Anna-Maria Behnsen,
	Frederic Weisbecker, Shuah Khan
  Cc: Stephen Boyd, linux-kernel, linux-kselftest, wakel

Several tests in the posix_timers selftest fail on kernels older
than 6.13. These tests check for timer behavior related to SIG_IGN,
which was refactored in the 6.13 kernel cycle, notably by
commit caf77435dd8a ("signal: Handle ignored signals in
do_sigaction(action != SIG_IGN)").

To ensure the selftests pass on older, stable kernels, gate the
affected tests with a ksft_min_kernel_version(6, 13) check.

Signed-off-by: Wake Liu <wakel@google.com>
---
 tools/testing/selftests/timers/posix_timers.c | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tools/testing/selftests/timers/posix_timers.c b/tools/testing/selftests/timers/posix_timers.c
index f0eceb0faf34..f228e51f8b58 100644
--- a/tools/testing/selftests/timers/posix_timers.c
+++ b/tools/testing/selftests/timers/posix_timers.c
@@ -256,6 +256,11 @@ static void *ignore_thread(void *arg)
 
 static void check_sig_ign(int thread)
 {
+	if (!ksft_min_kernel_version(6, 13)) {
+		// see caf77435dd8a
+		ksft_test_result_skip("Depends on refactor of posix timers in 6.13\n");
+		return;
+	}
 	struct tmrsig tsig = { };
 	struct itimerspec its;
 	unsigned int tid = 0;
@@ -342,6 +347,10 @@ static void check_sig_ign(int thread)
 
 static void check_rearm(void)
 {
+	if (!ksft_min_kernel_version(6, 13)) {
+		ksft_test_result_skip("Depends on refactor of posix timers in 6.13\n");
+		return;
+	}
 	struct tmrsig tsig = { };
 	struct itimerspec its;
 	struct sigaction sa;
@@ -398,6 +407,10 @@ static void check_rearm(void)
 
 static void check_delete(void)
 {
+	if (!ksft_min_kernel_version(6, 13)) {
+		ksft_test_result_skip("Depends on refactor of posix timers in 6.13\n");
+		return;
+	}
 	struct tmrsig tsig = { };
 	struct itimerspec its;
 	struct sigaction sa;
@@ -455,6 +468,10 @@ static inline int64_t calcdiff_ns(struct timespec t1, struct timespec t2)
 
 static void check_sigev_none(int which, const char *name)
 {
+	if (!ksft_min_kernel_version(6, 13)) {
+		ksft_test_result_skip("Depends on refactor of posix timers in 6.13\n");
+		return;
+	}
 	struct timespec start, now;
 	struct itimerspec its;
 	struct sigevent sev;
@@ -493,6 +510,10 @@ static void check_sigev_none(int which, const char *name)
 
 static void check_gettime(int which, const char *name)
 {
+	if (!ksft_min_kernel_version(6, 13)) {
+		ksft_test_result_skip("Depends on refactor of posix timers in 6.13\n");
+		return;
+	}
 	struct itimerspec its, prev;
 	struct timespec start, now;
 	struct sigevent sev;
-- 
2.50.1.703.g449372360f-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-11-14 19:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07  8:50 [PATCH] selftests/timers: Skip some posix_timers tests on kernels < 6.13 Wake Liu
2025-09-21  7:59 ` Thomas Gleixner
2025-11-03 11:45   ` [PATCH v2] selftests/timers: Clean up kernel version check in posix_timers Wake Liu
2025-11-14 19:39     ` [tip: timers/core] " tip-bot2 for Wake Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox