Linux Test Project
 help / color / mirror / Atom feed
From: Avinesh Kumar via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] openposix: timer_*/speculative: Skip untestable optional behavior on Linux
Date: Wed, 19 Aug 2026 11:31:59 +0200	[thread overview]
Message-ID: <20260819093210.24342-1-avinesh.kumar@suse.com> (raw)

From: Avinesh Kumar <avinesh.kumar@suse.com>

timer_delete/speculative/5-{1,2}, timer_getoverrun/speculative/6-{1,2,3},
timer_gettime/speculative/6-{1,2,3}, and timer_settime/speculative/12-{1,2,3}
all test EINVAL for an invalid timerid, which POSIX Issue 6/TC2 made
optional rather than required.[0][1]
Linux does not implement this optional behavior, so skip it there with
PTS_UNSUPPORTED and leave the test intact for implementations that do.

[0] https://pubs.opengroup.org/onlinepubs/9799919799/functions/timer_getoverrun.html
[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/timer_delete.html

Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
---
 .../conformance/interfaces/timer_delete/speculative/5-1.c    | 5 +++++
 .../conformance/interfaces/timer_delete/speculative/5-2.c    | 5 +++++
 .../interfaces/timer_getoverrun/speculative/6-1.c            | 5 +++++
 .../interfaces/timer_getoverrun/speculative/6-2.c            | 5 +++++
 .../interfaces/timer_getoverrun/speculative/6-3.c            | 5 +++++
 .../conformance/interfaces/timer_gettime/speculative/6-1.c   | 5 +++++
 .../conformance/interfaces/timer_gettime/speculative/6-2.c   | 5 +++++
 .../conformance/interfaces/timer_gettime/speculative/6-3.c   | 5 +++++
 .../conformance/interfaces/timer_settime/speculative/12-1.c  | 5 +++++
 .../conformance/interfaces/timer_settime/speculative/12-2.c  | 5 +++++
 .../conformance/interfaces/timer_settime/speculative/12-3.c  | 5 +++++
 11 files changed, 55 insertions(+)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-1.c
index 912cf5800e6f..7c776236d31d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-1.c
@@ -19,6 +19,10 @@
 
 int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 {
+#ifdef __linux__
+	printf("Linux does not implement this optional behavior\n");
+	return PTS_UNSUPPORTED;
+#else
 	timer_t tid;
 	int tval = BOGUSTIMERID;
 	tid = (timer_t) & tval;
@@ -37,4 +41,5 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 
 	printf("timer_delete() did not return -1\n");
 	return PTS_PASS;
+#endif
 }
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-2.c b/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-2.c
index 74eeb46793b2..63574bfd58f7 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-2.c
@@ -34,6 +34,10 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED)
 
 int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 {
+#ifdef __linux__
+	printf("Linux does not implement this optional behavior\n");
+	return PTS_UNSUPPORTED;
+#else
 	struct sigevent ev;
 	struct sigaction act;
 	timer_t tid;
@@ -91,4 +95,5 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 
 	printf("fcn did not return -1\n");
 	return PTS_PASS;
+#endif
 }
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-1.c
index 6e18560e5084..31c8a4df3d17 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-1.c
@@ -19,6 +19,10 @@
 
 int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 {
+#ifdef __linux__
+	printf("Linux does not implement this optional behavior\n");
+	return PTS_UNSUPPORTED;
+#else
 	timer_t tid;
 	int tval = BOGUSTID;
 	tid = (timer_t) & tval;
@@ -36,4 +40,5 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 
 	printf("fcn did not return -1\n");
 	return PTS_PASS;
+#endif
 }
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-2.c
index 2d7f3967ced1..3004b1eb80ba 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-2.c
@@ -26,6 +26,10 @@
 
 int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 {
+#ifdef __linux__
+	printf("Linux does not implement this optional behavior\n");
+	return PTS_UNSUPPORTED;
+#else
 	struct sigevent ev;
 	timer_t tid;
 
@@ -55,4 +59,5 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 
 	printf("fcn did not return -1\n");
 	return PTS_PASS;
+#endif
 }
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-3.c b/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-3.c
index 933a31dcd3e7..bd443e7629aa 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-3.c
@@ -23,6 +23,10 @@
 
 int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 {
+#ifdef __linux__
+	printf("Linux does not implement this optional behavior\n");
+	return PTS_UNSUPPORTED;
+#else
 	struct sigevent ev;
 	timer_t tid;
 
@@ -47,4 +51,5 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 
 	printf("fcn did not return -1\n");
 	return PTS_PASS;
+#endif
 }
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c
index d09c2f70901d..82a2f0b508dd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c
@@ -19,6 +19,10 @@
 
 int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 {
+#ifdef __linux__
+	printf("Linux does not implement this optional behavior\n");
+	return PTS_UNSUPPORTED;
+#else
 	timer_t tid;
 	struct itimerspec its;
 	int tval = BOGUSTID;
@@ -35,4 +39,5 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 	}
 	printf("fcn did not return -1\n");
 	return PTS_PASS;
+#endif
 }
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-2.c
index 88a8d221914b..df103dd78b9d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-2.c
@@ -21,6 +21,10 @@
 
 int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 {
+#ifdef __linux__
+	printf("Linux does not implement this optional behavior\n");
+	return PTS_UNSUPPORTED;
+#else
 	struct sigevent ev;
 	timer_t tid;
 	struct itimerspec its;
@@ -45,4 +49,5 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 	}
 	printf("fcn did not return -1\n");
 	return PTS_PASS;
+#endif
 }
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-3.c b/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-3.c
index ef7c37f5eb99..4b901e0d4329 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-3.c
@@ -21,6 +21,10 @@
 
 int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 {
+#ifdef __linux__
+	printf("Linux does not implement this optional behavior\n");
+	return PTS_UNSUPPORTED;
+#else
 	struct sigevent ev;
 	timer_t tid;
 	struct itimerspec its;
@@ -49,4 +53,5 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 	}
 	printf("fcn did not return -1\n");
 	return PTS_PASS;
+#endif
 }
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-1.c
index 5d4e1dda30ba..e20766ba5838 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-1.c
@@ -18,6 +18,10 @@
 
 int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 {
+#ifdef __linux__
+	printf("Linux does not implement this optional behavior\n");
+	return PTS_UNSUPPORTED;
+#else
 	timer_t tid;
 	struct itimerspec its;
 	int tval = BOGUSTID;
@@ -39,4 +43,5 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 	}
 	printf("fcn did not return -1\n");
 	return PTS_PASS;
+#endif
 }
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-2.c b/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-2.c
index 3b6901c25dc7..83c7aa10c7ce 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-2.c
@@ -25,6 +25,10 @@
 
 int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 {
+#ifdef __linux__
+	printf("Linux does not implement this optional behavior\n");
+	return PTS_UNSUPPORTED;
+#else
 	struct sigevent ev;
 	timer_t tid;
 	struct itimerspec its;
@@ -54,4 +58,5 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 	}
 	printf("fcn did not return -1\n");
 	return PTS_PASS;
+#endif
 }
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-3.c b/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-3.c
index 04ceb2745af3..c4c469410874 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-3.c
@@ -23,6 +23,10 @@
 
 int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 {
+#ifdef __linux__
+	printf("Linux does not implement this optional behavior\n");
+	return PTS_UNSUPPORTED;
+#else
 	struct sigevent ev;
 	timer_t tid;
 	struct itimerspec its;
@@ -56,4 +60,5 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
 	}
 	printf("fcn did not return -1\n");
 	return PTS_PASS;
+#endif
 }
-- 
2.55.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

             reply	other threads:[~2026-08-19  9:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19  9:31 Avinesh Kumar via ltp [this message]
2026-08-19 10:33 ` [LTP] openposix: timer_*/speculative: Skip untestable optional behavior on Linux linuxtestproject.agent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260819093210.24342-1-avinesh.kumar@suse.com \
    --to=ltp@lists.linux.it \
    --cc=avinesh.kumar@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox