diff mbox series

[net-next] tools: testing: selftests: switch conntrack_dump_flush to TEST_PROGS

Message ID 20240422152701.13518-1-fw@strlen.de (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net-next] tools: testing: selftests: switch conntrack_dump_flush to TEST_PROGS | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 932 this patch: 932
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 4 maintainers not CCed: kadlec@netfilter.org linux-kselftest@vger.kernel.org coreteam@netfilter.org shuah@kernel.org
netdev/build_clang success Errors and warnings before: 938 this patch: 938
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 944 this patch: 944
netdev/checkpatch warning WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-24--00-00 (tests: 994)

Commit Message

Florian Westphal April 22, 2024, 3:26 p.m. UTC
Currently conntrack_dump_flush test program always runs when passing
TEST_PROGS argument:

% make -C tools/testing/selftests TARGETS=net/netfilter TEST_PROGS=conntrack_ipip_mtu.sh run_tests
make: Entering [..]
TAP version 13
1..2 [..]
  selftests: net/netfilter: conntrack_dump_flush [..]

Move away from TEST_CUSTOM_PROGS to avoid this.  After this,
above command will only run the program specified in TEST_PROGS.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 I noticed that conntrack_dump_flush test case runs on each test
 iteration in the netdev test infra, hence this patch.

 Alternative would be to also pass TEST_CUSTOM_PROGS="", but I guess
 its better to stop using this feature, no other net subtests do this.

 tools/testing/selftests/net/netfilter/Makefile                | 3 +--
 tools/testing/selftests/net/netfilter/conntrack_dump_flush.sh | 4 ++++
 2 files changed, 5 insertions(+), 2 deletions(-)
 create mode 100755 tools/testing/selftests/net/netfilter/conntrack_dump_flush.sh

Comments

Jakub Kicinski April 24, 2024, 2:16 a.m. UTC | #1
On Mon, 22 Apr 2024 17:26:59 +0200 Florian Westphal wrote:
> Currently conntrack_dump_flush test program always runs when passing
> TEST_PROGS argument:
> 
> % make -C tools/testing/selftests TARGETS=net/netfilter TEST_PROGS=conntrack_ipip_mtu.sh run_tests
> make: Entering [..]
> TAP version 13
> 1..2 [..]
>   selftests: net/netfilter: conntrack_dump_flush [..]
> 
> Move away from TEST_CUSTOM_PROGS to avoid this.  After this,
> above command will only run the program specified in TEST_PROGS.

Hm, but why TEST_CUSTOM_PROGS in the first place?
What's special about it? I think TEST_GEN_PROGS would work
Florian Westphal April 24, 2024, 9:55 a.m. UTC | #2
Jakub Kicinski <kuba@kernel.org> wrote:
> On Mon, 22 Apr 2024 17:26:59 +0200 Florian Westphal wrote:
> > Currently conntrack_dump_flush test program always runs when passing
> > TEST_PROGS argument:
> > 
> > % make -C tools/testing/selftests TARGETS=net/netfilter TEST_PROGS=conntrack_ipip_mtu.sh run_tests
> > make: Entering [..]
> > TAP version 13
> > 1..2 [..]
> >   selftests: net/netfilter: conntrack_dump_flush [..]
> > 
> > Move away from TEST_CUSTOM_PROGS to avoid this.  After this,
> > above command will only run the program specified in TEST_PROGS.
> 
> Hm, but why TEST_CUSTOM_PROGS in the first place?
> What's special about it? I think TEST_GEN_PROGS would work

It works iff I run 'make -C tools/testing/selftests TARGETS=net/netfilter'
before running vng ... make -C tools/testing/selftests
TARGETS=net/netfilter  TEST_PROGS=conntrack_dump_flush TEST_GEN_PROGS="" run_tests.

I'll send a v2, will check if it works in the CI or not.
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/netfilter/Makefile b/tools/testing/selftests/net/netfilter/Makefile
index 68e4780edfdc..15d2f2087aee 100644
--- a/tools/testing/selftests/net/netfilter/Makefile
+++ b/tools/testing/selftests/net/netfilter/Makefile
@@ -7,6 +7,7 @@  MNL_CFLAGS := $(shell $(HOSTPKG_CONFIG) --cflags libmnl 2>/dev/null)
 MNL_LDLIBS := $(shell $(HOSTPKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl)
 
 TEST_PROGS := br_netfilter.sh bridge_brouter.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
@@ -28,8 +29,6 @@  TEST_PROGS += nft_zones_many.sh
 TEST_PROGS += rpath.sh
 TEST_PROGS += xt_string.sh
 
-TEST_CUSTOM_PROGS += conntrack_dump_flush
-
 TEST_GEN_FILES = audit_logread
 TEST_GEN_FILES += conntrack_dump_flush
 TEST_GEN_FILES += connect_close nf_queue
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..5e81c8284aa9
--- /dev/null
+++ b/tools/testing/selftests/net/netfilter/conntrack_dump_flush.sh
@@ -0,0 +1,4 @@ 
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+exec ./conntrack_dump_flush