mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] selftests/proc: Skip setns-dcache without UNIX sockets
@ 2026-09-14  2:47 Chhabilal Dangal
  0 siblings, 0 replies; only message in thread
From: Chhabilal Dangal @ 2026-09-14  2:47 UTC (permalink / raw)
  To: shuah; +Cc: linux-kselftest, linux-kernel, linux-fsdevel, Chhabilal Dangal

setns-dcache uses an AF_UNIX socket to distinguish network namespaces.
When CONFIG_UNIX is disabled, socket(AF_UNIX, ...) returns
-EAFNOSUPPORT, but the test reports the unsupported configuration as a
failure.

Treat EAFNOSUPPORT as a skip instead.

The change was verified with CONFIG_UNIX=n under QEMU, where the test
now exits with KSFT_SKIP, and with CONFIG_UNIX=y on the host, where the
test continues to pass.

Fixes: 1fde6f21d90f ("proc: fix /proc/net/* after setns(2)")
Signed-off-by: Chhabilal Dangal <yogeshdangal66@gmail.com>
---
 tools/testing/selftests/proc/setns-dcache.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/proc/setns-dcache.c b/tools/testing/selftests/proc/setns-dcache.c
index 60ab197a7..f4e958068 100644
--- a/tools/testing/selftests/proc/setns-dcache.c
+++ b/tools/testing/selftests/proc/setns-dcache.c
@@ -17,7 +17,7 @@
  * Test that setns(CLONE_NEWNET) points to new /proc/net content even
  * if old one is in dcache.
  *
- * FIXME /proc/net/unix is under CONFIG_UNIX which can be disabled.
+ * Skip if CONFIG_UNIX is disabled.
  */
 #undef NDEBUG
 #include <assert.h>
@@ -59,6 +59,8 @@ int main(void)
 	}
 	/* Distinguisher between two otherwise empty net namespaces. */
 	if (socket(AF_UNIX, SOCK_STREAM, 0) == -1) {
+		if (errno == EAFNOSUPPORT)
+			return 4;
 		return 1;
 	}
 
-- 
2.55.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-14  2:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-14  2:47 [PATCH] selftests/proc: Skip setns-dcache without UNIX sockets Chhabilal Dangal

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®