selftests: forwarding: mirror_gre_changes: Fix waiting for neighbor

When running the test on soft devices, there's no mechanism to
gratuitously start resolving the neighbor for remote tunnel endpoint.
So instead of passively waiting, wait for the device to be up, and then
probe the neighbor with a ping.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Petr Machata 2018-06-28 18:56:39 +02:00 committed by David S. Miller
parent ec9fdc99f5
commit 4e74cc7c5d

View file

@ -122,15 +122,8 @@ test_span_gre_egress_up()
# After setting the device up, wait for neighbor to get resolved so that # After setting the device up, wait for neighbor to get resolved so that
# we can expect mirroring to work. # we can expect mirroring to work.
ip link set dev $swp3 up ip link set dev $swp3 up
while true; do setup_wait_dev $swp3
ip neigh sh dev $swp3 $remote_ip nud reachable | ping -c 1 -I $swp3 $remote_ip &>/dev/null
grep -q ^
if [[ $? -ne 0 ]]; then
sleep 1
else
break
fi
done
quick_test_span_gre_dir $tundev ingress quick_test_span_gre_dir $tundev ingress
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress