All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] selftests: af_unix: skip scm_inq tests when SO_INQ is unsupported
@ 2026-07-30 14:46 Sebastian Chlad
  2026-07-30 18:27 ` Kuniyuki Iwashima
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Chlad @ 2026-07-30 14:46 UTC (permalink / raw)
  To: netdev; +Cc: Kuniyuki Iwashima, Sebastian Chlad

SO_INQ was added in df30285b3670 ("af_unix: Introduce SO_INQ."). On
older kernels this returns -ENOPROTOOPT for SOCK_STREAM too, which
scm_inq.basic/partial_read currently treat as a failure.

Enabling SO_INQ here is only a precondition for the actual test: the
SCM_INQ/ioctl(SIOCINQ) consistency checks that follow. SKIP when the
precondition itself isn't met, rather than asserting it succeeds.

Signed-off-by: Sebastian Chlad <sebastian.chlad@suse.com>
---
 tools/testing/selftests/net/af_unix/scm_inq.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/testing/selftests/net/af_unix/scm_inq.c b/tools/testing/selftests/net/af_unix/scm_inq.c
index 6268b5bf50be..2868cce61a9a 100644
--- a/tools/testing/selftests/net/af_unix/scm_inq.c
+++ b/tools/testing/selftests/net/af_unix/scm_inq.c
@@ -111,6 +111,9 @@ TEST_F(scm_inq, basic)
 		return;
 	}
 
+	if (err && errno == ENOPROTOOPT)
+		SKIP(return, "SO_INQ is not supported");
+
 	ASSERT_EQ(0, err);
 
 	err = ioctl(self->fd[1], SIOCINQ, &inq);
@@ -136,6 +139,10 @@ TEST_F(scm_inq, partial_read)
 		ASSERT_EQ(-ENOPROTOOPT, -errno);
 		return;
 	}
+
+	if (err && errno == ENOPROTOOPT)
+		SKIP(return, "SO_INQ is not supported");
+
 	ASSERT_EQ(0, err);
 
 	ret = send(self->fd[0], buf, sizeof(buf), 0);
-- 
2.51.0


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

end of thread, other threads:[~2026-08-31 15:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-30 14:46 [PATCH net] selftests: af_unix: skip scm_inq tests when SO_INQ is unsupported Sebastian Chlad
2026-07-30 18:27 ` Kuniyuki Iwashima
2026-07-31  5:41   ` Sebastian Chlad
2026-07-31  5:53     ` Kuniyuki Iwashima
2026-07-31  5:57       ` Sebastian Chlad
2026-08-31 15:57       ` Michal Koutný

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.