diff mbox series

[net-next] selftests: netfilter: avoid test timeouts on debug kernels

Message ID 20240429105736.22677-1-fw@strlen.de (mailing list archive)
State Accepted
Commit f581bcf02f0e0b42516bfeb3e34860919b9e78d2
Delegated to: Netdev Maintainers
Headers show
Series [net-next] selftests: netfilter: avoid test timeouts on debug kernels | 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: 8 this patch: 8
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: 8 this patch: 8
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: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 37 lines checked
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-29--15-00 (tests: 994)

Commit Message

Florian Westphal April 29, 2024, 10:57 a.m. UTC
Jakub reports that some tests fail on netdev CI when executed in a debug
kernel.

Increase test timeout to 30m, this should hopefully be enough.
Also reduce test duration where possible for "slow" machines.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 tools/testing/selftests/net/netfilter/br_netfilter.sh   | 6 +++++-
 tools/testing/selftests/net/netfilter/nft_nat_zones.sh  | 1 +
 tools/testing/selftests/net/netfilter/nft_zones_many.sh | 4 +++-
 tools/testing/selftests/net/netfilter/settings          | 2 +-
 4 files changed, 10 insertions(+), 3 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org April 30, 2024, 3:20 p.m. UTC | #1
Hello:

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

On Mon, 29 Apr 2024 12:57:28 +0200 you wrote:
> Jakub reports that some tests fail on netdev CI when executed in a debug
> kernel.
> 
> Increase test timeout to 30m, this should hopefully be enough.
> Also reduce test duration where possible for "slow" machines.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>
> 
> [...]

Here is the summary with links:
  - [net-next] selftests: netfilter: avoid test timeouts on debug kernels
    https://git.kernel.org/netdev/net-next/c/f581bcf02f0e

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/netfilter/br_netfilter.sh b/tools/testing/selftests/net/netfilter/br_netfilter.sh
index d7806753f5de..c28379a965d8 100755
--- a/tools/testing/selftests/net/netfilter/br_netfilter.sh
+++ b/tools/testing/selftests/net/netfilter/br_netfilter.sh
@@ -40,7 +40,11 @@  bcast_ping()
 	fromns="$1"
 	dstip="$2"
 
-	for i in $(seq 1 500); do
+	local packets=500
+
+	[ "$KSFT_MACHINE_SLOW" = yes ] && packets=100
+
+	for i in $(seq 1 $packets); do
 		if ! ip netns exec "$fromns" ping -q -f -b -c 1 -q "$dstip" > /dev/null 2>&1; then
 			echo "ERROR: ping -b from $fromns to $dstip"
 			ip netns exec "$ns0" nft list ruleset
diff --git a/tools/testing/selftests/net/netfilter/nft_nat_zones.sh b/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
index 549f264b41f3..3b81d88bdde3 100755
--- a/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
+++ b/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
@@ -13,6 +13,7 @@  maxclients=100
 have_socat=0
 ret=0
 
+[ "$KSFT_MACHINE_SLOW" = yes ] && maxclients=40
 # client1---.
 #            veth1-.
 #                  |
diff --git a/tools/testing/selftests/net/netfilter/nft_zones_many.sh b/tools/testing/selftests/net/netfilter/nft_zones_many.sh
index 4ad75038f6ff..7db9982ba5a6 100755
--- a/tools/testing/selftests/net/netfilter/nft_zones_many.sh
+++ b/tools/testing/selftests/net/netfilter/nft_zones_many.sh
@@ -6,6 +6,8 @@ 
 source lib.sh
 
 zones=2000
+[ "$KSFT_MACHINE_SLOW" = yes ] && zones=500
+
 have_ct_tool=0
 ret=0
 
@@ -89,7 +91,7 @@  fi
 		count=$(ip netns exec "$ns1" conntrack -C)
 		duration=$((stop-outerstart))
 
-		if [ "$count" -eq "$max_zones" ]; then
+		if [ "$count" -ge "$max_zones" ]; then
 			echo "PASS: inserted $count entries from packet path in $duration ms total"
 		else
 			ip netns exec "$ns1" conntrack -S 1>&2
diff --git a/tools/testing/selftests/net/netfilter/settings b/tools/testing/selftests/net/netfilter/settings
index 288bd9704773..abc5648b59ab 100644
--- a/tools/testing/selftests/net/netfilter/settings
+++ b/tools/testing/selftests/net/netfilter/settings
@@ -1 +1 @@ 
-timeout=500
+timeout=1800