Skip to contentSkip to conversation

selftests: net: a few pmtu.sh fixes

PATCH Applied Paolo Abeni 4 participants 9 messages Jan 30, 2024 – Feb 1, 2024

Subsystems (3)
lore
Share & tools
lore

Paolo Abeni

author maintainer
#0 lore raw

cover selftests: net: a few pmtu.sh fixes

This series try to address CI failures for the pmtu.sh tests. It does _not_ attempt to enable all the currently skipped cases, to avoid adding more entropy.

Tested with:

make -C tools/testing/selftests/ TARGETS=net install vng --build --config tools/testing/selftests/net/config

vng --run . --user root -- \
	./tools/testing/selftests/kselftest_install/run_kselftest.sh \
	-t net:pmtu.sh

Paolo Abeni (3):
selftests: net: add missing config for pmtu.sh tests
selftests: net: fix available tunnels detection
selftests: net: don't access /dev/stdout in pmtu.sh

 tools/testing/selftests/net/config  |  3 +++
 tools/testing/selftests/net/pmtu.sh | 18 +++++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH 1/3 selftests: net: add missing config for pmtu.sh tests

The mentioned test uses a few Kconfig still missing the net config, add them.

Before:
# Error: Specified qdisc kind is unknown.
# Error: Specified qdisc kind is unknown.
# Error: Qdisc not classful.
# We have an error talking to the kernel
# Error: Qdisc not classful.
# We have an error talking to the kernel
# policy_routing not supported
# TEST: ICMPv4 with DSCP and ECN: PMTU exceptions [SKIP]

After:
# TEST: ICMPv4 with DSCP and ECN: PMTU exceptions [ OK ]

Fixes ec730c3e1f0e ("selftest: net: Test IPv4 PMTU exceptions with DSCP and ECN")
---
 tools/testing/selftests/net/config | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/net/config +3 -0
index d4b38177ed04..88835cdbf0ea 100644
@@ -60,6 +60,7 @@ CONFIG_NET_SCH_HTB=m
 CONFIG_NET_SCH_FQ=m
 CONFIG_NET_SCH_ETF=m
 CONFIG_NET_SCH_NETEM=y
+CONFIG_NET_SCH_PRIO=m
 CONFIG_NFT_COMPAT=m
 CONFIG_NF_FLOW_TABLE=m
 CONFIG_PSAMPLE=m
@@ -77,6 +78,8 @@ CONFIG_NET_SCH_INGRESS=m
 CONFIG_NET_CLS_FLOWER=m
 CONFIG_NET_ACT_TUNNEL_KEY=m
 CONFIG_NET_ACT_MIRRED=m
+CONFIG_NET_ACT_PEDIT=m
+CONFIG_NET_ACT_CSUM=m
 CONFIG_BAREUDP=m
 CONFIG_IPV6_IOAM6_LWTUNNEL=y
 CONFIG_CRYPTO_SM4_GENERIC=y
Signature · 1 line
2.43.0
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH net 1/3] selftests: net: add missing config for pmtu.sh tests

Quoted 13 lines · Paolo Abeni

The mentioned test uses a few Kconfig still missing the net config, add them.

Before:
# Error: Specified qdisc kind is unknown.
# Error: Specified qdisc kind is unknown.
# Error: Qdisc not classful.
# We have an error talking to the kernel
# Error: Qdisc not classful.
# We have an error talking to the kernel
# policy_routing not supported
# TEST: ICMPv4 with DSCP and ECN: PMTU exceptions [SKIP]

Quoted 3 lines

After:
# TEST: ICMPv4 with DSCP and ECN: PMTU exceptions [ OK ]

author maintainer
#3 lore raw

PATCH 2/3 selftests: net: fix available tunnels detection

In reply to Paolo Abeni

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")
---
 tools/testing/selftests/net/pmtu.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
tools/testing/selftests/net/pmtu.sh +8 -8
index f10879788f61..31892b366913 100755
@@ -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() {
Signature · 1 line
2.43.0
Reviewed-by on v1 2/3
#4 lore raw

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

Quoted 14 lines · Paolo Abeni

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

Quoted 4 lines

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

author maintainer
#5 lore raw

PATCH 3/3 selftests: net: don't access /dev/stdout in pmtu.sh

In reply to Paolo Abeni

When running the pmtu.sh via the kselftest infra, accessing /dev/stdout gives unexpected results:
# dd: failed to open '/dev/stdout': Device or resource busy
# TEST: IPv4, bridged vxlan4: PMTU exceptions [FAIL]

Let dd use directly the standard output to fix the above:
# TEST: IPv4, bridged vxlan4: PMTU exceptions - nexthop objects [ OK ]

Fixes 136a1b434bbb ("selftests: net: test vxlan pmtu exceptions with tcp")
---
 tools/testing/selftests/net/pmtu.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/pmtu.sh +1 -1
index 31892b366913..3f118e3f1c66 100755
@@ -1339,7 +1339,7 @@ test_pmtu_ipvX_over_bridged_vxlanY_or_geneveY_exception() {
 
 		sleep 1
 
-		dd if=/dev/zero of=/dev/stdout status=none bs=1M count=1 | ${target} socat -T 3 -u STDIN $TCPDST,connect-timeout=3
+		dd if=/dev/zero status=none bs=1M count=1 | ${target} socat -T 3 -u STDIN $TCPDST,connect-timeout=3
 
 		size=$(du -sb $tmpoutfile)
 		size=${size%%/tmp/*}
Signature · 1 line
2.43.0
Reviewed-by on v1 3/3
#6 lore raw

Re: [PATCH net 3/3] selftests: net: don't access /dev/stdout in pmtu.sh

Quoted 8 lines · Paolo Abeni

When running the pmtu.sh via the kselftest infra, accessing /dev/stdout gives unexpected results:
# dd: failed to open '/dev/stdout': Device or resource busy
# TEST: IPv4, bridged vxlan4: PMTU exceptions [FAIL]

Let dd use directly the standard output to fix the above:
# TEST: IPv4, bridged vxlan4: PMTU exceptions - nexthop objects [ OK ]

Reviewed-by on the v1 series
#7 lore raw
In reply to Paolo Abeni
Quoted 12 lines · Paolo Abeni

This series try to address CI failures for the pmtu.sh tests. It does _not_ attempt to enable all the currently skipped cases, to avoid adding more entropy.

Tested with:

make -C tools/testing/selftests/ TARGETS=net install vng --build --config tools/testing/selftests/net/config

vng --run . --user root -- \
	./tools/testing/selftests/kselftest_install/run_kselftest.sh \
	-t net:pmtu.sh
Quoted 9 lines

Paolo Abeni (3):
selftests: net: add missing config for pmtu.sh tests
selftests: net: fix available tunnels detection
selftests: net: don't access /dev/stdout in pmtu.sh

 tools/testing/selftests/net/config  |  3 +++
 tools/testing/selftests/net/pmtu.sh | 18 +++++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)

selftests are getting a lot of love right now :-)

#8 lore raw
In reply to Paolo Abeni
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 6 lines · On Tue, 30 Jan 2024 18:47:15 +0100 you wrote:

This series try to address CI failures for the pmtu.sh tests. It does _not_ attempt to enable all the currently skipped cases, to avoid adding more entropy.

Tested with:

Quoted 7 lines

make -C tools/testing/selftests/ TARGETS=net install vng --build --config tools/testing/selftests/net/config

vng --run . --user root -- \
	./tools/testing/selftests/kselftest_install/run_kselftest.sh \
	-t net:pmtu.sh

[...]

Here is the summary with links:
- [net,1/3] selftests: net: add missing config for pmtu.sh tests

    https://git.kernel.org/netdev/net/c/f7c25d8e17dd
  - [net,2/3] selftests: net: fix available tunnels detection
    https://git.kernel.org/netdev/net/c/e4e4b6d568d2
  - [net,3/3] selftests: net: don't access /dev/stdout in pmtu.sh
    https://git.kernel.org/netdev/net/c/bc0970d5ac1d

You are awesome, thank you!

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