netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] selftests: netfilter: fix conntrack_dump_flush retval on unsupported kernel
@ 2024-04-22 10:33 Florian Westphal
  2024-04-25  0:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Westphal @ 2024-04-22 10:33 UTC (permalink / raw)
  To: netdev
  Cc: Paolo Abeni, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netfilter-devel, pablo

With CONFIG_NETFILTER=n test passes instead of skip.  Before:

 ./run_kselftest.sh -t net/netfilter:conntrack_dump_flush
[..]
 # Starting 3 tests from 1 test cases.
 #  RUN           conntrack_dump_flush.test_dump_by_zone ...
 mnl_socket_open: Protocol not supported
[..]
 ok 3 conntrack_dump_flush.test_flush_by_zone_default
 # PASSED: 3 / 3 tests passed.
 # Totals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0

After:
  mnl_socket_open: Protocol not supported
[..]
  ok 3 conntrack_dump_flush.test_flush_by_zone_default # SKIP cannot open netlink_netfilter socket
  # PASSED: 3 / 3 tests passed.
  # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:3 error:0

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 .../selftests/net/netfilter/conntrack_dump_flush.c        | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/testing/selftests/net/netfilter/conntrack_dump_flush.c b/tools/testing/selftests/net/netfilter/conntrack_dump_flush.c
index ca8d6b976c42..bd9317bf5ada 100644
--- a/tools/testing/selftests/net/netfilter/conntrack_dump_flush.c
+++ b/tools/testing/selftests/net/netfilter/conntrack_dump_flush.c
@@ -313,13 +313,11 @@ FIXTURE_SETUP(conntrack_dump_flush)
 	self->sock = mnl_socket_open(NETLINK_NETFILTER);
 	if (!self->sock) {
 		perror("mnl_socket_open");
-		exit(EXIT_FAILURE);
+		SKIP(return, "cannot open netlink_netfilter socket");
 	}
 
-	if (mnl_socket_bind(self->sock, 0, MNL_SOCKET_AUTOPID) < 0) {
-		perror("mnl_socket_bind");
-		exit(EXIT_FAILURE);
-	}
+	ret = mnl_socket_bind(self->sock, 0, MNL_SOCKET_AUTOPID);
+	EXPECT_EQ(ret, 0);
 
 	ret = conntracK_count_zone(self->sock, TEST_ZONE_ID);
 	if (ret < 0 && errno == EPERM)
-- 
2.43.2


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

* Re: [PATCH net-next] selftests: netfilter: fix conntrack_dump_flush retval on unsupported kernel
  2024-04-22 10:33 [PATCH net-next] selftests: netfilter: fix conntrack_dump_flush retval on unsupported kernel Florian Westphal
@ 2024-04-25  0:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-25  0:30 UTC (permalink / raw)
  To: Florian Westphal
  Cc: netdev, pabeni, davem, edumazet, kuba, netfilter-devel, pablo

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 22 Apr 2024 12:33:53 +0200 you wrote:
> With CONFIG_NETFILTER=n test passes instead of skip.  Before:
> 
>  ./run_kselftest.sh -t net/netfilter:conntrack_dump_flush
> [..]
>  # Starting 3 tests from 1 test cases.
>  #  RUN           conntrack_dump_flush.test_dump_by_zone ...
>  mnl_socket_open: Protocol not supported
> [..]
>  ok 3 conntrack_dump_flush.test_flush_by_zone_default
>  # PASSED: 3 / 3 tests passed.
>  # Totals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0
> 
> [...]

Here is the summary with links:
  - [net-next] selftests: netfilter: fix conntrack_dump_flush retval on unsupported kernel
    https://git.kernel.org/netdev/net-next/c/dd99c29e83e4

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2024-04-25  0:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-22 10:33 [PATCH net-next] selftests: netfilter: fix conntrack_dump_flush retval on unsupported kernel Florian Westphal
2024-04-25  0:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).