]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
selftests: netfilter: nft_flowtable.sh: re-run with random mtu sizes
authorFlorian Westphal <fw@strlen.de>
Tue, 23 Apr 2024 13:05:47 +0000 (15:05 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Apr 2024 00:12:45 +0000 (17:12 -0700)
Now that the test runs much faster, also re-run it with random MTU sizes
for the different link legs.  flowtable should pass ip fragments, if
any, up to the normal forwarding path.

Signed-off-by: Florian Westphal <fw@strlen.de>
Link: https://lore.kernel.org/r/20240423130604.7013-5-fw@strlen.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/netfilter/nft_flowtable.sh

index d765c65c31f313232bf412be142d84253c2aeb06..8b5a3a7e22f0c390282290ff0bd637dfe9e43e09 100755 (executable)
@@ -100,6 +100,14 @@ if ! ip -net $nsr2 link set veth1 mtu $rmtu; then
        exit 1
 fi
 
+if ! ip -net "$nsr1" link set veth1 mtu "$lmtu"; then
+       exit 1
+fi
+
+if ! ip -net "$nsr2" link set veth0 mtu "$lmtu"; then
+       exit 1
+fi
+
 ip -net $ns2 link set eth0 mtu $rmtu
 
 # transfer-net between nsr1 and nsr2.
@@ -633,4 +641,15 @@ else
        ip netns exec "$nsr1" cat /proc/net/xfrm_stat 1>&2
 fi
 
+if [ x"$1" = x ]; then
+       low=1280
+       mtu=$((65536 - low))
+       o=$(((RANDOM%mtu) + low))
+       l=$(((RANDOM%mtu) + low))
+       r=$(((RANDOM%mtu) + low))
+
+       echo "re-run with random mtus: -o $o -l $l -r $r"
+       $0 -o "$o" -l "$l" -r "$r"
+fi
+
 exit $ret