Linux filesystem development
 help / color / mirror / Atom feed
From: Manish Baing <manishbaing2789@gmail.com>
To: shuah@kernel.org
Cc: linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, manishbaing2789@gmail.com
Subject: [PATCH] selftests/proc: skip setns-dcache if CONFIG_UNIX is disabled
Date: Sat, 15 Aug 2026 21:16:48 +0000	[thread overview]
Message-ID: <20260815211648.21510-1-manishbaing2789@gmail.com> (raw)

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


                 reply	other threads:[~2026-08-15 21:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260815211648.21510-1-manishbaing2789@gmail.com \
    --to=manishbaing2789@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /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