Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH] selftests/proc: skip setns-dcache if CONFIG_UNIX is disabled
@ 2026-08-15 21:16 Manish Baing
  0 siblings, 0 replies; only message in thread
From: Manish Baing @ 2026-08-15 21:16 UTC (permalink / raw)
  To: shuah; +Cc: linux-fsdevel, linux-kselftest, linux-kernel, manishbaing2789

The setns-dcache test looks for /proc/net/unix, which doesn't exist
if CONFIG_UNIX is disabled in the kernel, causing the test to fail.

Fixed this by checking if the file exists right at the start of the
test. If it's missing, skip the test cleanly. This also removes
the old FIXME note.

Signed-off-by: Manish Baing <manishbaing2789@gmail.com>
---
 tools/testing/selftests/proc/setns-dcache.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/proc/setns-dcache.c b/tools/testing/selftests/proc/setns-dcache.c
index 60ab197a73fc..35665e7894b2 100644
--- a/tools/testing/selftests/proc/setns-dcache.c
+++ b/tools/testing/selftests/proc/setns-dcache.c
@@ -17,7 +17,6 @@
  * 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.
  */
 #undef NDEBUG
 #include <assert.h>
@@ -32,6 +31,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <sys/socket.h>
+#include "kselftest.h"
 
 static pid_t pid = -1;
 
@@ -48,6 +48,9 @@ int main(void)
 	char _ = 0;
 	int nsfd;
 
+	if (access("/proc/net/unix", F_OK) != 0)
+		ksft_exit_skip("CONFIG_UNIX is disabled or /proc/net/unix is missing\n");
+
 	atexit(f);
 
 	/* Check for priviledges and syscall availability straight away. */
-- 
2.43.0


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

only message in thread, other threads:[~2026-08-15 21:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-15 21:16 [PATCH] selftests/proc: skip setns-dcache if CONFIG_UNIX is disabled Manish Baing

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