Skip to contentSkip to conversation

selftests: net: amt: wait longer for connection before sending packets

PATCH Superseded Taehee Yoo 2 participants 3 messages Jan 18 – Jan 19

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Taehee Yoo

author
#0 lore raw

PATCH 1/1 selftests: net: amt: wait longer for connection before sending packets

There is a sleep 2 in send_mcast4() to wait for the connection to be established between the gateway and the relay.

However, some tests fail because packets are sometimes sent before the connection is fully established.

So, increase the waiting time to make the tests more reliable.

Fixes c08e8baea78e ("selftests: add amt interface selftest script")
---
 tools/testing/selftests/net/amt.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/amt.sh +1 -1
index 3ef209cacb8e..fe2497d9caff 100755
@@ -246,7 +246,7 @@ test_ipv6_forward()
 
 send_mcast4()
 {
-	sleep 2
+	sleep 5
 	ip netns exec "${SOURCE}" bash -c \
 		'printf "%s %128s" 172.17.0.2 | nc -w 1 -u 239.0.0.1 4000' &
 }
Signature · 1 line
2.43.0
#1 lore raw
Quoted 20 lines · Taehee Yoo

There is a sleep 2 in send_mcast4() to wait for the connection to be established between the gateway and the relay.

However, some tests fail because packets are sometimes sent before the connection is fully established.

So, increase the waiting time to make the tests more reliable.

Fixes c08e8baea78e ("selftests: add amt interface selftest script")
---
 tools/testing/selftests/net/amt.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/amt.sh +0 -0
index 3ef209cacb8e..fe2497d9caff 100755

tools/testing/selftests/net/amt.sh test_ipv6_forward() · line 249

Quoted 5 lines
tools/testing/selftests/net/amt.sh +1 -1
@@ -246,7 +246,7 @@ test_ipv6_forward()
 
 send_mcast4()
 {
-       sleep 2
+       sleep 5

1) Have you considered using wait_local_port_listen instead ?

2) What about send_mcast6() ?

Quoted 6 lines
tools/testing/selftests/net/amt.sh +0 -1
        ip netns exec "${SOURCE}" bash -c \
                'printf "%s %128s" 172.17.0.2 | nc -w 1 -u 239.0.0.1 4000' &
 }
--

2.43.0

author
#2 lore raw
Quoted 1 line · Eric Dumazet

Hi Eric,
Thanks a lot for the review!

Quoted 22 lines · Taehee Yoo
Quoted 21 lines

There is a sleep 2 in send_mcast4() to wait for the connection to be established between the gateway and the relay.

However, some tests fail because packets are sometimes sent before the connection is fully established.

So, increase the waiting time to make the tests more reliable.

Fixes c08e8baea78e ("selftests: add amt interface selftest script")
---
 tools/testing/selftests/net/amt.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/amt.sh +0 -0
index 3ef209cacb8e..fe2497d9caff 100755
@@ -246,7 +246,7 @@ test_ipv6_forward()
 
Quoted 9 lines

tools/testing/selftests/net/amt.sh test_ipv6_forward() · line 249

Quoted 4 lines
tools/testing/selftests/net/amt.sh +1 -1
 send_mcast4()
 {
-       sleep 2
+       sleep 5

1) Have you considered using wait_local_port_listen instead ?

2) What about send_mcast6() ?

Thanks, I've testing using use wait_local_port_listen instead of sleep, it's working very well.
So, I will add the wait_local_port_listen() to send_mcast4() and replace sleep with wait_local_port_listen in the send_mcast6() in the v2. The sleep in send_mcast4() is still needed because of waiting for establishment of amt tunnel.

Thanks a lot!
Taehee Yoo

Quoted 6 lines
Quoted 6 lines
tools/testing/selftests/net/amt.sh +0 -1
        ip netns exec "${SOURCE}" bash -c \
                'printf "%s %128s" 172.17.0.2 | nc -w 1 -u 239.0.0.1 4000' &
 }
--

2.43.0