From: Florian Westphal Date: Mon, 29 Apr 2024 10:57:28 +0000 (+0200) Subject: selftests: netfilter: avoid test timeouts on debug kernels X-Git-Tag: v6.10-rc1~153^2~116 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f581bcf02f0e0b42516bfeb3e34860919b9e78d2;p=thirdparty%2Fkernel%2Flinux.git 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. Signed-off-by: Florian Westphal Link: https://lore.kernel.org/r/20240429105736.22677-1-fw@strlen.de Signed-off-by: Jakub Kicinski --- diff --git a/tools/testing/selftests/net/netfilter/br_netfilter.sh b/tools/testing/selftests/net/netfilter/br_netfilter.sh index d7806753f5de2..c28379a965d83 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 549f264b41f31..3b81d88bdde35 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 4ad75038f6ff7..7db9982ba5a65 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 288bd9704773a..abc5648b59abd 100644 --- a/tools/testing/selftests/net/netfilter/settings +++ b/tools/testing/selftests/net/netfilter/settings @@ -1 +1 @@ -timeout=500 +timeout=1800