selftests: netfilter: avoid test timeouts on debug kernels
authorFlorian Westphal <fw@strlen.de>
Mon, 29 Apr 2024 10:57:28 +0000 (12:57 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 30 Apr 2024 15:15:23 +0000 (08:15 -0700)
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>
Link: https://lore.kernel.org/r/20240429105736.22677-1-fw@strlen.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/netfilter/br_netfilter.sh
tools/testing/selftests/net/netfilter/nft_nat_zones.sh
tools/testing/selftests/net/netfilter/nft_zones_many.sh
tools/testing/selftests/net/netfilter/settings

index d7806753f5de2d13d82fb4b5a0fa76d52fd3bf07..c28379a965d838d55f6e4b427bb9d8f249601eb4 100755 (executable)
@@ -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
index 549f264b41f314b53798814eaa03aade9df02476..3b81d88bdde35b6181c37a07a75e5fe88120cb14 100755 (executable)
@@ -13,6 +13,7 @@ maxclients=100
 have_socat=0
 ret=0
 
+[ "$KSFT_MACHINE_SLOW" = yes ] && maxclients=40
 # client1---.
 #            veth1-.
 #                  |
index 4ad75038f6ff74b8ef551f282d42c87ff45f6eba..7db9982ba5a657374abebb10dca853b5fab2d556 100755 (executable)
@@ -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
index 288bd9704773a93b9822bdf58046c27ce8507c79..abc5648b59abde537dca90791404691050c759e2 100644 (file)
@@ -1 +1 @@
-timeout=500
+timeout=1800