]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: net: use slowwait to make sure IPv6 setup finished
authorHangbin Liu <liuhangbin@gmail.com>
Tue, 17 Jun 2025 10:51:00 +0000 (10:51 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 19 Jun 2025 13:24:09 +0000 (15:24 +0200)
Sometimes the vxlan vnifiltering test failed on slow machines due to
network setup not finished. e.g.

  TEST: VM connectivity over vnifiltering vxlan (ipv4 default rdst)   [ OK ]
  TEST: VM connectivity over vnifiltering vxlan (ipv6 default rdst)   [FAIL]

Let's use slowwait to make sure the connection is finished.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250617105101.433718-3-liuhangbin@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/net/test_vxlan_vnifiltering.sh

index 6127a78ee988be9400edacced88dcc85b713c573..8deacc565afa17a7f2bad19ceab7749336c61e29 100755 (executable)
@@ -146,18 +146,17 @@ run_cmd()
 }
 
 check_hv_connectivity() {
-       ip netns exec $hv_1 ping -c 1 -W 1 $1 &>/dev/null
-       sleep 1
-       ip netns exec $hv_1 ping -c 1 -W 1 $2 &>/dev/null
+       slowwait 5 ip netns exec $hv_1 ping -c 1 -W 1 $1 &>/dev/null
+       slowwait 5 ip netns exec $hv_1 ping -c 1 -W 1 $2 &>/dev/null
 
        return $?
 }
 
 check_vm_connectivity() {
-       run_cmd "ip netns exec $vm_11 ping -c 1 -W 1 10.0.10.12"
+       slowwait 5 run_cmd "ip netns exec $vm_11 ping -c 1 -W 1 10.0.10.12"
        log_test $? 0 "VM connectivity over $1 (ipv4 default rdst)"
 
-       run_cmd "ip netns exec $vm_21 ping -c 1 -W 1 10.0.10.22"
+       slowwait 5 run_cmd "ip netns exec $vm_21 ping -c 1 -W 1 10.0.10.22"
        log_test $? 0 "VM connectivity over $1 (ipv6 default rdst)"
 }