Skip to contentSkip to conversation

selftests: netfilter: avoid test timeouts on debug kernels

PATCH Applied Florian Westphal 2 participants 2 messages Apr 29, 2024 – Apr 30, 2024

Subsystems (4)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 selftests: netfilter: avoid test timeouts on debug kernels

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.

---
 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(-)
tools/testing/selftests/net/netfilter/br_netfilter.sh +5 -1
index d7806753f5de..c28379a965d8 100755
@@ -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
tools/testing/selftests/net/netfilter/nft_nat_zones.sh +1 -0
index 549f264b41f3..3b81d88bdde3 100755
@@ -13,6 +13,7 @@ maxclients=100
 have_socat=0
 ret=0
 
+[ "$KSFT_MACHINE_SLOW" = yes ] && maxclients=40
 # client1---.
 #            veth1-.
 #                  |
tools/testing/selftests/net/netfilter/nft_zones_many.sh +3 -1
index 4ad75038f6ff..7db9982ba5a6 100755
@@ -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
tools/testing/selftests/net/netfilter/settings +1 -1
index 288bd9704773..abc5648b59ab 100644
@@ -1 +1 @@
-timeout=500
+timeout=1800
Signature · 1 line
2.44.0
#1 lore raw
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 9 lines · 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.

[...]

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!

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