Skip to content

Commit aa085ea

Browse files
Florian Westphalummakynes
authored andcommitted
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 <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 78a5883 commit aa085ea

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tools/testing/selftests/net/netfilter/conntrack_resize.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,22 @@ EOF
177177
done
178178
}
179179

180+
ct_udpclash()
181+
{
182+
local ns="$1"
183+
local duration="$2"
184+
local now=$(date +%s)
185+
local end=$((now + duration))
186+
187+
[ -x udpclash ] || return
188+
189+
while [ $now -lt $end ]; do
190+
ip netns exec "$ns" ./udpclash 127.0.0.1 $((RANDOM%65536)) > /dev/null 2>&1
191+
192+
now=$(date +%s)
193+
done
194+
}
195+
180196
# dump to /dev/null. We don't want dumps to cause infinite loops
181197
# or use-after-free even when conntrack table is altered while dumps
182198
# are in progress.
@@ -267,6 +283,7 @@ insert_flood()
267283

268284
ct_pingflood "$n" "$timeout" "floodresize" &
269285
ct_udpflood "$n" "$timeout" &
286+
ct_udpclash "$n" "$timeout" &
270287

271288
insert_ctnetlink "$n" "$r" &
272289
ctflush "$n" "$timeout" &

0 commit comments

Comments
 (0)