diff options
author | Florian Westphal <fw@strlen.de> | 2025-06-27 16:27:52 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2025-07-14 15:21:33 +0200 |
commit | aa085ea1a68d27d34f14db1f4026c35aa6b1ecc8 (patch) | |
tree | 43bdbb65955289d7a22cff8a5c363d2a7bf51f82 | |
parent | 78a58836358783995884784cb20021db6f6a29df (diff) |
selftests: netfilter: conntrack_resize.sh: also use udpclash tool
Previous patch added a new clash resolution test case.
Also use this during conntrack resize stress test in addition
to icmp ping flood.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rwxr-xr-x | tools/testing/selftests/net/netfilter/conntrack_resize.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/netfilter/conntrack_resize.sh b/tools/testing/selftests/net/netfilter/conntrack_resize.sh index aa1ba07eaf50..788cd56ea4a0 100755 --- a/tools/testing/selftests/net/netfilter/conntrack_resize.sh +++ b/tools/testing/selftests/net/netfilter/conntrack_resize.sh @@ -177,6 +177,22 @@ EOF done } +ct_udpclash() +{ + local ns="$1" + local duration="$2" + local now=$(date +%s) + local end=$((now + duration)) + + [ -x udpclash ] || return + + while [ $now -lt $end ]; do + ip netns exec "$ns" ./udpclash 127.0.0.1 $((RANDOM%65536)) > /dev/null 2>&1 + + now=$(date +%s) + done +} + # dump to /dev/null. We don't want dumps to cause infinite loops # or use-after-free even when conntrack table is altered while dumps # are in progress. @@ -267,6 +283,7 @@ insert_flood() ct_pingflood "$n" "$timeout" "floodresize" & ct_udpflood "$n" "$timeout" & + ct_udpclash "$n" "$timeout" & insert_ctnetlink "$n" "$r" & ctflush "$n" "$timeout" & |