mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] selftests/futex: skip tests if shmget unsupported
@ 2025-10-16 16:19 Carlos Llamas
  2025-11-14 13:44 ` [tip: locking/futex] selftests/futex: Skip " tip-bot2 for Carlos Llamas
  0 siblings, 1 reply; 2+ messages in thread
From: Carlos Llamas @ 2025-10-16 16:19 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
	Davidlohr Bueso, André Almeida, Shuah Khan, Carlos Llamas
  Cc: kernel-team, linux-kernel, open list:KERNEL SELFTEST FRAMEWORK

On systems where the shmget() syscall is not supported, tests like
anon_page and shared_waitv will fail. Skip these tests in such cases to
allow the rest of the test suite to run.

Signed-off-by: Carlos Llamas <cmllamas@google.com>
---
 tools/testing/selftests/futex/functional/futex_wait.c  | 2 ++
 tools/testing/selftests/futex/functional/futex_waitv.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/tools/testing/selftests/futex/functional/futex_wait.c b/tools/testing/selftests/futex/functional/futex_wait.c
index 152ca4612886..1269642bb662 100644
--- a/tools/testing/selftests/futex/functional/futex_wait.c
+++ b/tools/testing/selftests/futex/functional/futex_wait.c
@@ -71,6 +71,8 @@ TEST(anon_page)
 	/* Testing an anon page shared memory */
 	shm_id = shmget(IPC_PRIVATE, 4096, IPC_CREAT | 0666);
 	if (shm_id < 0) {
+		if (errno == ENOSYS)
+			ksft_exit_skip("shmget syscall not supported\n");
 		perror("shmget");
 		exit(1);
 	}
diff --git a/tools/testing/selftests/futex/functional/futex_waitv.c b/tools/testing/selftests/futex/functional/futex_waitv.c
index c684b10eb76e..3bc4e5dc70e7 100644
--- a/tools/testing/selftests/futex/functional/futex_waitv.c
+++ b/tools/testing/selftests/futex/functional/futex_waitv.c
@@ -86,6 +86,8 @@ TEST(shared_waitv)
 		int shm_id = shmget(IPC_PRIVATE, 4096, IPC_CREAT | 0666);
 
 		if (shm_id < 0) {
+			if (errno == ENOSYS)
+				ksft_exit_skip("shmget syscall not supported\n");
 			perror("shmget");
 			exit(1);
 		}
-- 
2.51.0.869.ge66316f041-goog


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

* [tip: locking/futex] selftests/futex: Skip tests if shmget unsupported
  2025-10-16 16:19 [PATCH] selftests/futex: skip tests if shmget unsupported Carlos Llamas
@ 2025-11-14 13:44 ` tip-bot2 for Carlos Llamas
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Carlos Llamas @ 2025-11-14 13:44 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Carlos Llamas, Thomas Gleixner, x86, linux-kernel

The following commit has been merged into the locking/futex branch of tip:

Commit-ID:     275498b88104b36a0f7f913da53dc81c1daed277
Gitweb:        https://git.kernel.org/tip/275498b88104b36a0f7f913da53dc81c1daed277
Author:        Carlos Llamas <cmllamas@google.com>
AuthorDate:    Thu, 16 Oct 2025 16:19:41 
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 14 Nov 2025 14:39:36 +01:00

selftests/futex: Skip tests if shmget unsupported

On systems where the shmget() syscall is not supported, tests like
anon_page and shared_waitv will fail. Skip these tests in such cases to
allow the rest of the test suite to run.

Signed-off-by: Carlos Llamas <cmllamas@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://patch.msgid.link/20251016162009.3270784-1-cmllamas@google.com
---
 tools/testing/selftests/futex/functional/futex_wait.c  | 2 ++
 tools/testing/selftests/futex/functional/futex_waitv.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/tools/testing/selftests/futex/functional/futex_wait.c b/tools/testing/selftests/futex/functional/futex_wait.c
index 4cd87f2..1eb1633 100644
--- a/tools/testing/selftests/futex/functional/futex_wait.c
+++ b/tools/testing/selftests/futex/functional/futex_wait.c
@@ -71,6 +71,8 @@ TEST(anon_page)
 	/* Testing an anon page shared memory */
 	shm_id = shmget(IPC_PRIVATE, 4096, IPC_CREAT | 0666);
 	if (shm_id < 0) {
+		if (errno == ENOSYS)
+			ksft_exit_skip("shmget syscall not supported\n");
 		perror("shmget");
 		exit(1);
 	}
diff --git a/tools/testing/selftests/futex/functional/futex_waitv.c b/tools/testing/selftests/futex/functional/futex_waitv.c
index c684b10..3bc4e5d 100644
--- a/tools/testing/selftests/futex/functional/futex_waitv.c
+++ b/tools/testing/selftests/futex/functional/futex_waitv.c
@@ -86,6 +86,8 @@ TEST(shared_waitv)
 		int shm_id = shmget(IPC_PRIVATE, 4096, IPC_CREAT | 0666);
 
 		if (shm_id < 0) {
+			if (errno == ENOSYS)
+				ksft_exit_skip("shmget syscall not supported\n");
 			perror("shmget");
 			exit(1);
 		}

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-16 16:19 [PATCH] selftests/futex: skip tests if shmget unsupported Carlos Llamas
2025-11-14 13:44 ` [tip: locking/futex] selftests/futex: Skip " tip-bot2 for Carlos Llamas

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

all inboxes | Powered by JetHome®