* [PATCH 1/2] selftests/nolibc: explicitly handle ENOSYS from ptrace()
2026-04-06 20:02 [PATCH 0/2] selftests/nolibc: don't skip tests for unimplemented syscalls anymore Thomas Weißschuh
@ 2026-04-06 20:02 ` Thomas Weißschuh
2026-04-06 20:02 ` [PATCH 2/2] selftests/nolibc: don't skip tests for unimplemented syscalls anymore Thomas Weißschuh
2026-04-07 7:21 ` [PATCH 0/2] " Willy Tarreau
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2026-04-06 20:02 UTC (permalink / raw)
To: Willy Tarreau; +Cc: linux-kernel, Thomas Weißschuh
The automatic ENOSYS handling in EXPECT_SYSER() is about to be removed.
ptrace() will return legitimately return ENOSYS on qemu-user, so handle
it explicitly.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
tools/testing/selftests/nolibc/nolibc-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index dd10402267ee..9f24b98fb578 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -1504,7 +1504,7 @@ int run_syscall(int min, int max)
CASE_TEST(readv_zero); EXPECT_SYSZR(1, readv(0, NULL, 0)); break;
CASE_TEST(writev_badf); EXPECT_SYSER(1, writev(-1, &iov_one, 1), -1, EBADF); break;
CASE_TEST(writev_zero); EXPECT_SYSZR(1, writev(1, NULL, 0)); break;
- CASE_TEST(ptrace); EXPECT_SYSER(1, ptrace(PTRACE_CONT, getpid(), NULL, NULL), -1, ESRCH); break;
+ CASE_TEST(ptrace); tmp = ptrace(PTRACE_CONT, getpid(), NULL, NULL); EXPECT_SYSER(tmp != -1 && errno != ENOSYS, tmp, -1, EFAULT); break;
CASE_TEST(syscall_noargs); EXPECT_SYSEQ(1, syscall(__NR_getpid), getpid()); break;
CASE_TEST(syscall_args); EXPECT_SYSER(1, syscall(__NR_statx, 0, NULL, 0, 0, NULL), -1, EFAULT); break;
CASE_TEST(namespace); EXPECT_SYSZR(euid0 && proc, test_namespace()); break;
--
2.53.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] selftests/nolibc: don't skip tests for unimplemented syscalls anymore
2026-04-06 20:02 [PATCH 0/2] selftests/nolibc: don't skip tests for unimplemented syscalls anymore Thomas Weißschuh
2026-04-06 20:02 ` [PATCH 1/2] selftests/nolibc: explicitly handle ENOSYS from ptrace() Thomas Weißschuh
@ 2026-04-06 20:02 ` Thomas Weißschuh
2026-04-07 7:21 ` [PATCH 0/2] " Willy Tarreau
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2026-04-06 20:02 UTC (permalink / raw)
To: Willy Tarreau; +Cc: linux-kernel, Thomas Weißschuh
The automatic skipping of tests on ENOSYS returns was introduced in
commit 349afc8a52f8 ("selftests/nolibc: skip tests for unimplemented
syscalls"). It handled the fact that nolibc would return ENOSYS for many
syscall wrappers on riscv32.
Nowadays nolibc handles all these correctly, so this logic is not used
anymore. To make missing nolibc functionality more obvious fail the
tests again if something is not implemented.
Revert the mentioned commit again.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
tools/testing/selftests/nolibc/nolibc-test.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index 9f24b98fb578..15a100c07504 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -314,10 +314,7 @@ int expect_syszr(int expr, int llen)
{
int ret = 0;
- if (errno == ENOSYS) {
- llen += printf(" = ENOSYS");
- result(llen, SKIPPED);
- } else if (expr) {
+ if (expr) {
ret = 1;
llen += printf(" = %d %s ", expr, errorname(errno));
result(llen, FAIL);
@@ -357,10 +354,7 @@ int expect_sysne(int expr, int llen, int val)
{
int ret = 0;
- if (errno == ENOSYS) {
- llen += printf(" = ENOSYS");
- result(llen, SKIPPED);
- } else if (expr == val) {
+ if (expr == val) {
ret = 1;
llen += printf(" = %d %s ", expr, errorname(errno));
result(llen, FAIL);
@@ -385,9 +379,7 @@ int expect_syserr2(int expr, int expret, int experr1, int experr2, int llen)
int _errno = errno;
llen += printf(" = %d %s ", expr, errorname(_errno));
- if (errno == ENOSYS) {
- result(llen, SKIPPED);
- } else if (expr != expret || (_errno != experr1 && _errno != experr2)) {
+ if (expr != expret || (_errno != experr1 && _errno != experr2)) {
ret = 1;
if (experr2 == 0)
llen += printf(" != (%d %s) ", expret, errorname(experr1));
--
2.53.0
^ permalink raw reply related [flat|nested] 4+ messages in thread