Skip to contentSkip to conversation

selftests: net: use slowwait to make sure setup finished

PATCH Applied Hangbin Liu 3 participants 6 messages Jun 17, 2025 – Jun 19, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover selftests: net: use slowwait to make sure setup finished

The two updated tests sometimes failed because the network setup hadn't completed. Used slowwait to ensure the setup finished and the tests always passed. I ran both tests 50 times, and all of them passed.

Hangbin Liu (2):
selftests: net: use slowwait to stabilize vrf_route_leaking test
selftests: net: use slowwait to make sure IPv6 setup finished

 tools/testing/selftests/net/test_vxlan_vnifiltering.sh | 9 ++++-----
 tools/testing/selftests/net/vrf_route_leaking.sh       | 4 ++--
 2 files changed, 6 insertions(+), 7 deletions(-)
Signature · 1 line
2.46.0
#1 lore raw

PATCH 1/2 selftests: net: use slowwait to stabilize vrf_route_leaking test

The vrf_route_leaking test occasionally fails due to connectivity issues in our testing environment. A sample failure message shows that the ping check fails intermittently

PING 2001:db8:16:2::2 (2001:db8:16:2::2) 56 data bytes

--- 2001:db8:16:2::2 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

TEST: Basic IPv6 connectivity [FAIL]

This is likely due to insufficient wait time on slower machines. To address this, switch to using slowwait, which provides a longer and more reliable wait for setup completion.

Before this change, the test failed 3 out of 10 times. After applying this fix, the test was run 30 times without any failure.

---
 tools/testing/selftests/net/vrf_route_leaking.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/net/vrf_route_leaking.sh +2 -2
index e9c2f71da207..ce34cb2e6e0b 100755
@@ -275,7 +275,7 @@ setup_sym()
 
 
 	# Wait for ip config to settle
-	sleep 2
+	slowwait 5 ip netns exec $h1 "${ping6}" -c1 -w1 ${H2_N2_IP6} >/dev/null 2>&1
 }
 
 setup_asym()
@@ -370,7 +370,7 @@ setup_asym()
 	ip -netns $r2 -6 addr add dev eth1 ${R2_N2_IP6}/64 nodad
 
 	# Wait for ip config to settle
-	sleep 2
+	slowwait 5 ip netns exec $h1 "${ping6}" -c1 -w1 ${H2_N2_IP6} >/dev/null 2>&1
 }
 
 check_connectivity()
Signature · 1 line
2.46.0
reviewer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH net-next 1/2] selftests: net: use slowwait to stabilize vrf_route_leaking test

Quoted 11 lines · Hangbin Liu

The vrf_route_leaking test occasionally fails due to connectivity issues in our testing environment. A sample failure message shows that the ping check fails intermittently

PING 2001:db8:16:2::2 (2001:db8:16:2::2) 56 data bytes

--- 2001:db8:16:2::2 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

TEST: Basic IPv6 connectivity [FAIL]

Quoted 8 lines

This is likely due to insufficient wait time on slower machines. To address this, switch to using slowwait, which provides a longer and more reliable wait for setup completion.

Before this change, the test failed 3 out of 10 times. After applying this fix, the test was run 30 times without any failure.

#3 lore raw

PATCH 2/2 selftests: net: use slowwait to make sure IPv6 setup finished

In reply to Hangbin Liu

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.

---
 tools/testing/selftests/net/test_vxlan_vnifiltering.sh | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
tools/testing/selftests/net/test_vxlan_vnifiltering.sh +4 -5
index 6127a78ee988..8deacc565afa 100755
@@ -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)"
 }
 
Signature · 1 line
2.46.0
reviewer Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH net-next 2/2] selftests: net: use slowwait to make sure IPv6 setup finished

Quoted 9 lines · Hangbin Liu

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.

#5 lore raw
In reply to Hangbin Liu
This series was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 9 lines · On Tue, 17 Jun 2025 10:50:58 +0000 you wrote:

The two updated tests sometimes failed because the network setup hadn't completed. Used slowwait to ensure the setup finished and the tests always passed. I ran both tests 50 times, and all of them passed.

Hangbin Liu (2):
selftests: net: use slowwait to stabilize vrf_route_leaking test
selftests: net: use slowwait to make sure IPv6 setup finished

[...]

Here is the summary with links:
- [net-next,1/2] selftests: net: use slowwait to stabilize vrf_route_leaking test

    https://git.kernel.org/netdev/net-next/c/d83a58067592
  - [net-next,2/2] selftests: net: use slowwait to make sure IPv6 setup finished
    https://git.kernel.org/netdev/net-next/c/948670361c0c

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html