From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>
Cc: David Ahern <dsahern@kernel.org>,
netdev@vger.kernel.org,
Nicolas Dichtel <nicolas.dichtel@6wind.com>
Subject: [PATCH net v2 4/4] selftests: vrf_route_leaking: add local ping test
Date: Fri, 5 Jul 2024 16:52:15 +0200 [thread overview]
Message-ID: <20240705145302.1717632-5-nicolas.dichtel@6wind.com> (raw)
In-Reply-To: <20240705145302.1717632-1-nicolas.dichtel@6wind.com>
The goal is to check that the source address selected by the kernel is
routable when a leaking route is used.
The symmetric topology is enough for this test.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
.../selftests/net/vrf_route_leaking.sh | 30 +++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/vrf_route_leaking.sh b/tools/testing/selftests/net/vrf_route_leaking.sh
index 2da32f4c479b..1fd8ceb0711c 100755
--- a/tools/testing/selftests/net/vrf_route_leaking.sh
+++ b/tools/testing/selftests/net/vrf_route_leaking.sh
@@ -533,6 +533,30 @@ ipv6_ping_frag_asym()
ipv6_ping_frag asym
}
+ipv4_ping_local()
+{
+ log_section "IPv4 (sym route): VRF ICMP local error route lookup ping"
+
+ setup_sym
+
+ check_connectivity || return
+
+ run_cmd ip netns exec $r1 ip vrf exec blue ping -c1 -w1 ${H2_N2_IP}
+ log_test $? 0 "VRF ICMP local IPv4"
+}
+
+ipv6_ping_local()
+{
+ log_section "IPv6 (sym route): VRF ICMP local error route lookup ping"
+
+ setup_sym
+
+ check_connectivity6 || return
+
+ run_cmd ip netns exec $r1 ip vrf exec blue ${ping6} -c1 -w1 ${H2_N2_IP6}
+ log_test $? 0 "VRF ICMP local IPv6"
+}
+
################################################################################
# usage
@@ -555,8 +579,8 @@ EOF
# Some systems don't have a ping6 binary anymore
command -v ping6 > /dev/null 2>&1 && ping6=$(command -v ping6) || ping6=$(command -v ping)
-TESTS_IPV4="ipv4_ping_ttl ipv4_traceroute ipv4_ping_frag ipv4_ping_ttl_asym ipv4_traceroute_asym"
-TESTS_IPV6="ipv6_ping_ttl ipv6_traceroute ipv6_ping_ttl_asym ipv6_traceroute_asym"
+TESTS_IPV4="ipv4_ping_ttl ipv4_traceroute ipv4_ping_frag ipv4_ping_local ipv4_ping_ttl_asym ipv4_traceroute_asym"
+TESTS_IPV6="ipv6_ping_ttl ipv6_traceroute ipv6_ping_local ipv6_ping_ttl_asym ipv6_traceroute_asym"
ret=0
nsuccess=0
@@ -594,12 +618,14 @@ do
ipv4_traceroute|traceroute) ipv4_traceroute;;&
ipv4_traceroute_asym|traceroute) ipv4_traceroute_asym;;&
ipv4_ping_frag|ping) ipv4_ping_frag;;&
+ ipv4_ping_local|ping) ipv4_ping_local;;&
ipv6_ping_ttl|ping) ipv6_ping_ttl;;&
ipv6_ping_ttl_asym|ping) ipv6_ping_ttl_asym;;&
ipv6_traceroute|traceroute) ipv6_traceroute;;&
ipv6_traceroute_asym|traceroute) ipv6_traceroute_asym;;&
ipv6_ping_frag|ping) ipv6_ping_frag;;&
+ ipv6_ping_local|ping) ipv6_ping_local;;&
# setup namespaces and config, but do not run any tests
setup_sym|setup) setup_sym; exit 0;;
--
2.43.1
next prev parent reply other threads:[~2024-07-05 14:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-05 14:52 [PATCH net v2 0/4] vrf: fix source address selection with route leak Nicolas Dichtel
2024-07-05 14:52 ` [PATCH net v2 1/4] ipv4: " Nicolas Dichtel
2024-07-07 16:58 ` David Ahern
2024-07-08 18:13 ` Nicolas Dichtel
2024-07-08 20:32 ` Jakub Kicinski
2024-07-08 21:27 ` Nicolas Dichtel
2024-07-05 14:52 ` [PATCH net v2 2/4] ipv6: " Nicolas Dichtel
2024-07-07 16:58 ` David Ahern
2024-07-08 18:15 ` Nicolas Dichtel
2024-07-08 18:44 ` David Ahern
2024-07-08 21:24 ` Nicolas Dichtel
2024-07-05 14:52 ` [PATCH net v2 3/4] ipv6: take care of scope when choosing the src addr Nicolas Dichtel
2024-07-07 17:00 ` David Ahern
2024-07-05 14:52 ` Nicolas Dichtel [this message]
2024-07-07 17:01 ` [PATCH net v2 4/4] selftests: vrf_route_leaking: add local ping test David Ahern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240705145302.1717632-5-nicolas.dichtel@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).