netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] selftests: netfilter: run conntrack_dump_flush in netns
@ 2024-11-04 14:25 Florian Westphal
  2024-11-06  2:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Westphal @ 2024-11-04 14:25 UTC (permalink / raw)
  To: netdev; +Cc: netfilter-devel, Florian Westphal

This test will fail if the initial namespace has conntrack
active due to unexpected number of flows returned on dump:

  conntrack_dump_flush.c:451:test_flush_by_zone:Expected ret (7) == 2 (2)
  test_flush_by_zone: Test failed
  FAIL  conntrack_dump_flush.test_flush_by_zone
  not ok 2 conntrack_dump_flush.test_flush_by_zone

Add a wrapper that unshares this program to avoid this problem.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 tools/testing/selftests/net/netfilter/Makefile                | 4 ++--
 tools/testing/selftests/net/netfilter/conntrack_dump_flush.sh | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)
 create mode 100755 tools/testing/selftests/net/netfilter/conntrack_dump_flush.sh

diff --git a/tools/testing/selftests/net/netfilter/Makefile b/tools/testing/selftests/net/netfilter/Makefile
index e6c9e777fead..ab543625d6a0 100644
--- a/tools/testing/selftests/net/netfilter/Makefile
+++ b/tools/testing/selftests/net/netfilter/Makefile
@@ -8,6 +8,7 @@ MNL_LDLIBS := $(shell $(HOSTPKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl)
 
 TEST_PROGS := br_netfilter.sh bridge_brouter.sh
 TEST_PROGS += br_netfilter_queue.sh
+TEST_PROGS += conntrack_dump_flush.sh
 TEST_PROGS += conntrack_icmp_related.sh
 TEST_PROGS += conntrack_ipip_mtu.sh
 TEST_PROGS += conntrack_tcp_unreplied.sh
@@ -35,10 +36,9 @@ TEST_PROGS += xt_string.sh
 
 TEST_PROGS_EXTENDED = nft_concat_range_perf.sh
 
-TEST_GEN_PROGS = conntrack_dump_flush
-
 TEST_GEN_FILES = audit_logread
 TEST_GEN_FILES += connect_close nf_queue
+TEST_GEN_FILES += conntrack_dump_flush
 TEST_GEN_FILES += conntrack_reverse_clash
 TEST_GEN_FILES += sctp_collision
 
diff --git a/tools/testing/selftests/net/netfilter/conntrack_dump_flush.sh b/tools/testing/selftests/net/netfilter/conntrack_dump_flush.sh
new file mode 100755
index 000000000000..8b0935385849
--- /dev/null
+++ b/tools/testing/selftests/net/netfilter/conntrack_dump_flush.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+exec unshare -n ./conntrack_dump_flush
-- 
2.45.2


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

* Re: [PATCH net-next] selftests: netfilter: run conntrack_dump_flush in netns
  2024-11-04 14:25 [PATCH net-next] selftests: netfilter: run conntrack_dump_flush in netns Florian Westphal
@ 2024-11-06  2:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-11-06  2:20 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netdev, netfilter-devel

Hello:

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

On Mon,  4 Nov 2024 15:25:24 +0100 you wrote:
> This test will fail if the initial namespace has conntrack
> active due to unexpected number of flows returned on dump:
> 
>   conntrack_dump_flush.c:451:test_flush_by_zone:Expected ret (7) == 2 (2)
>   test_flush_by_zone: Test failed
>   FAIL  conntrack_dump_flush.test_flush_by_zone
>   not ok 2 conntrack_dump_flush.test_flush_by_zone
> 
> [...]

Here is the summary with links:
  - [net-next] selftests: netfilter: run conntrack_dump_flush in netns
    https://git.kernel.org/netdev/net-next/c/fc49b804967e

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-11-06  2:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-04 14:25 [PATCH net-next] selftests: netfilter: run conntrack_dump_flush in netns Florian Westphal
2024-11-06  2:20 ` 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).