Skip to contentSkip to conversation

selftests: af_unix: don't use SKIP for expected failures

PATCH Applied Jakub Kicinski 3 participants 3 messages Nov 23, 2025 – Nov 25, 2025

Subsystems (4)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 selftests: af_unix: don't use SKIP for expected failures

netdev CI reserves SKIP in selftests for cases which can't be executed due to setup issues, like missing or old commands. Tests which are expected to fail must use XFAIL.

---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

---
 tools/testing/selftests/net/af_unix/unix_connreset.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
tools/testing/selftests/net/af_unix/unix_connreset.c +6 -2
index bffef2b54bfd..6eb936207b31 100644
@@ -161,8 +161,12 @@ TEST_F(unix_sock, reset_closed_embryo)
 	char buf[16] = {};
 	ssize_t n;
 
-	if (variant->socket_type == SOCK_DGRAM)
-		SKIP(return, "This test only applies to SOCK_STREAM and SOCK_SEQPACKET");
+	if (variant->socket_type == SOCK_DGRAM) {
+		snprintf(_metadata->results->reason,
+			 sizeof(_metadata->results->reason),
+			 "Test only applies to SOCK_STREAM and SOCK_SEQPACKET");
+		exit(KSFT_XFAIL);
+	}
 
 	/* Close server without accept()ing */
 	close(self->server);
Signature · 1 line
2.51.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jakub Kicinski

netdev CI reserves SKIP in selftests for cases which can't be executed due to setup issues, like missing or old commands. Tests which are expected to fail must use XFAIL.

Good to know that, thanks !

Quoted 31 lines

---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

---
 tools/testing/selftests/net/af_unix/unix_connreset.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
tools/testing/selftests/net/af_unix/unix_connreset.c +6 -3
index bffef2b54bfd..6eb936207b31 100644
@@ -161,8 +161,12 @@ TEST_F(unix_sock, reset_closed_embryo)
        char buf[16] = {};
        ssize_t n;
 
-       if (variant->socket_type == SOCK_DGRAM)
-               SKIP(return, "This test only applies to SOCK_STREAM and SOCK_SEQPACKET");
+       if (variant->socket_type == SOCK_DGRAM) {
+               snprintf(_metadata->results->reason,
+                        sizeof(_metadata->results->reason),
+                        "Test only applies to SOCK_STREAM and SOCK_SEQPACKET");
+               exit(KSFT_XFAIL);
+       }
 
        /* Close server without accept()ing */
        close(self->server);
--

2.51.1

#2 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 4 lines · On Sat, 22 Nov 2025 18:16:01 -0800 you wrote:

netdev CI reserves SKIP in selftests for cases which can't be executed due to setup issues, like missing or old commands. Tests which are expected to fail must use XFAIL.

Quoted 8 lines

---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

[...]

Here is the summary with links:
- [net-next] selftests: af_unix: don't use SKIP for expected failures

    https://git.kernel.org/netdev/net-next/c/e254c212cd9c

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html