Commit db2c5bfc authored by Petr Machata's avatar Petr Machata Committed by David S. Miller

selftests: forwarding: mirror_lib: Wait for tardy mirrored packets

When running in an environment with poor performance (such as a
simulator), processing mirrored packets can take a while. Evaluating the
condition too soon leads to spurious "seen 9, expected 10" failures as
the last packet doesn't have enough time to get mirrored and the mirror
to arrive and bump the observed counters.

Wait for one ping interval before evaluating the test.
Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3dc178a9
......@@ -34,6 +34,7 @@ mirror_test()
ip vrf exec $vrf_name \
${PING} ${sip:+-I $sip} $dip -c 10 -i 0.5 -w $ping_timeout \
&> /dev/null
sleep 0.5
local t1=$(tc_rule_stats_get $dev $pref)
local delta=$((t1 - t0))
# Tolerate a couple stray extra packets.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment