diff mbox series

[net,2/3] selftests: net: fix available tunnels detection

Message ID cab10e75fda618e6fff8c595b632f47db58b9309.1706635101.git.pabeni@redhat.com (mailing list archive)
State Accepted
Commit e4e4b6d568d2549583cbda3f8ce567e586cb05da
Headers show
Series selftests: net: a few pmtu.sh fixes | expand

Commit Message

Paolo Abeni Jan. 30, 2024, 5:47 p.m. UTC
The pmtu.sh test tries to detect the tunnel protocols available
in the running kernel and properly skip the unsupported cases.

In a few more complex setup, such detection is unsuccessful, as
the script currently ignores some intermediate error code at
setup time.

Before:
  # which: no nettest in (/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin)
  # TEST: vti6: PMTU exceptions (ESP-in-UDP)                            [FAIL]
  #   PMTU exception wasn't created after creating tunnel exceeding link layer MTU
  # ./pmtu.sh: line 931: kill: (7543) - No such process
  # ./pmtu.sh: line 931: kill: (7544) - No such process

After:
  #   xfrm4 not supported
  # TEST: vti4: PMTU exceptions                                         [SKIP]

Fixes: ece1278a9b81 ("selftests: net: add ESP-in-UDP PMTU test")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 tools/testing/selftests/net/pmtu.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Guillaume Nault Jan. 30, 2024, 7:38 p.m. UTC | #1
On Tue, Jan 30, 2024 at 06:47:17PM +0100, Paolo Abeni wrote:
> The pmtu.sh test tries to detect the tunnel protocols available
> in the running kernel and properly skip the unsupported cases.
> 
> In a few more complex setup, such detection is unsuccessful, as
> the script currently ignores some intermediate error code at
> setup time.
> 
> Before:
>   # which: no nettest in (/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin)
>   # TEST: vti6: PMTU exceptions (ESP-in-UDP)                            [FAIL]
>   #   PMTU exception wasn't created after creating tunnel exceeding link layer MTU
>   # ./pmtu.sh: line 931: kill: (7543) - No such process
>   # ./pmtu.sh: line 931: kill: (7544) - No such process
> 
> After:
>   #   xfrm4 not supported
>   # TEST: vti4: PMTU exceptions                                         [SKIP]
> 

Reviewed-by: Guillaume Nault <gnault@redhat.com>
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
index f10879788f61..31892b366913 100755
--- a/tools/testing/selftests/net/pmtu.sh
+++ b/tools/testing/selftests/net/pmtu.sh
@@ -707,23 +707,23 @@  setup_xfrm6() {
 }
 
 setup_xfrm4udp() {
-	setup_xfrm 4 ${veth4_a_addr} ${veth4_b_addr} "encap espinudp 4500 4500 0.0.0.0"
-	setup_nettest_xfrm 4 4500
+	setup_xfrm 4 ${veth4_a_addr} ${veth4_b_addr} "encap espinudp 4500 4500 0.0.0.0" && \
+		setup_nettest_xfrm 4 4500
 }
 
 setup_xfrm6udp() {
-	setup_xfrm 6 ${veth6_a_addr} ${veth6_b_addr} "encap espinudp 4500 4500 0.0.0.0"
-	setup_nettest_xfrm 6 4500
+	setup_xfrm 6 ${veth6_a_addr} ${veth6_b_addr} "encap espinudp 4500 4500 0.0.0.0" && \
+		setup_nettest_xfrm 6 4500
 }
 
 setup_xfrm4udprouted() {
-	setup_xfrm 4 ${prefix4}.${a_r1}.1 ${prefix4}.${b_r1}.1 "encap espinudp 4500 4500 0.0.0.0"
-	setup_nettest_xfrm 4 4500
+	setup_xfrm 4 ${prefix4}.${a_r1}.1 ${prefix4}.${b_r1}.1 "encap espinudp 4500 4500 0.0.0.0" && \
+		setup_nettest_xfrm 4 4500
 }
 
 setup_xfrm6udprouted() {
-	setup_xfrm 6 ${prefix6}:${a_r1}::1 ${prefix6}:${b_r1}::1 "encap espinudp 4500 4500 0.0.0.0"
-	setup_nettest_xfrm 6 4500
+	setup_xfrm 6 ${prefix6}:${a_r1}::1 ${prefix6}:${b_r1}::1 "encap espinudp 4500 4500 0.0.0.0" && \
+		setup_nettest_xfrm 6 4500
 }
 
 setup_routing_old() {