Skip to content

Commit 1c0522b

Browse files
pmachatadavem330
authored andcommitted
selftests: forwarding: mirror_lib: Use mausezahn
Using ping in tests is error-prone, because ping is too smart. On a flaky system (notably in a simulator), when packets don't come quickly enough, more pings are sent, and that throws off counters. Instead use mausezahn to generate ICMP echo request packets. That allows us to send them in quicker succession as well, because the reason the ping was made slow in the first place was to make the tests work on simulated systems. Signed-off-by: Petr Machata <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 193025e commit 1c0522b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tools/testing/selftests/net/forwarding/mirror_lib.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ mirror_test()
2929
local pref=$1; shift
3030
local expect=$1; shift
3131

32-
local ping_timeout=$((PING_TIMEOUT * 5))
3332
local t0=$(tc_rule_stats_get $dev $pref)
34-
ip vrf exec $vrf_name \
35-
${PING} ${sip:+-I $sip} $dip -c 10 -i 0.5 -w $ping_timeout \
36-
&> /dev/null
33+
$MZ $vrf_name ${sip:+-A $sip} -B $dip -a own -b bc -q \
34+
-c 10 -d 100ms -t icmp type=8
3735
sleep 0.5
3836
local t1=$(tc_rule_stats_get $dev $pref)
3937
local delta=$((t1 - t0))

0 commit comments

Comments
 (0)