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

selftests: forwarding: mirror_gre_vlan_bridge_1q: Fix roaming test

ARP or ND traffic can cause spurious migration of FDB back to $swp3.
Mirroring is then updated in accordance with the change, and mirrored
packets are seen at h3, causing a failure.

Detect the case of this spurious roaming, and retry 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
ccdb66dd 35036b0b

+18 -5
+18 -5
tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
··· 269 269 mirror_install $swp1 ingress $tundev "matchall $tcflags" 270 270 quick_test_span_gre_dir $tundev ingress 271 271 272 - bridge fdb del dev $swp3 $h3mac vlan 555 master 273 - bridge fdb add dev $swp2 $h3mac vlan 555 master 274 - sleep 1 275 - fail_test_span_gre_dir $tundev ingress 272 + while ((RET == 0)); do 273 + bridge fdb del dev $swp3 $h3mac vlan 555 master 2>/dev/null 274 + bridge fdb add dev $swp2 $h3mac vlan 555 master 275 + sleep 1 276 + fail_test_span_gre_dir $tundev ingress 276 277 277 - bridge fdb del dev $swp2 $h3mac vlan 555 master 278 + if ! bridge fdb sh dev $swp2 vlan 555 master \ 279 + | grep -q $h3mac; then 280 + printf "TEST: %-60s [RETRY]\n" \ 281 + "$what: MAC roaming ($tcflags)" 282 + # ARP or ND probably reprimed the FDB while the test 283 + # was running. We would get a spurious failure. 284 + RET=0 285 + continue 286 + fi 287 + break 288 + done 289 + 290 + bridge fdb del dev $swp2 $h3mac vlan 555 master 2>/dev/null 278 291 # Re-prime FDB 279 292 $ARPING -I br1.555 192.0.2.130 -fqc 1 280 293 sleep 1