Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Petr Machata and committed by
David S. Miller
db2c5bfc 3dc178a9

+1
+1
tools/testing/selftests/net/forwarding/mirror_lib.sh
··· 34 34 ip vrf exec $vrf_name \ 35 35 ${PING} ${sip:+-I $sip} $dip -c 10 -i 0.5 -w $ping_timeout \ 36 36 &> /dev/null 37 + sleep 0.5 37 38 local t1=$(tc_rule_stats_get $dev $pref) 38 39 local delta=$((t1 - t0)) 39 40 # Tolerate a couple stray extra packets.