* [PATCH net-next] selftests: pmtu: Introduce list_flush_ipv6_exception test case
@ 2019-06-06 20:15 Stefano Brivio
2019-06-11 18:40 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Stefano Brivio @ 2019-06-06 20:15 UTC (permalink / raw)
To: David Miller
Cc: Jianlin Shi, Wei Wang, David Ahern, Martin KaFai Lau,
Eric Dumazet, netdev
This test checks that route exceptions can be successfully listed and
flushed using ip -6 route {list,flush} cache.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
This will cause a minor conflict with David Ahern's patch:
"[PATCH net-next 17/19] selftests: pmtu: Add support for routing
via nexthop objects", currently under review. The "re-run with nh"
flag for this test in the test list will need to be set to 1.
I can also re-submit this based on that patch, if it helps.
tools/testing/selftests/net/pmtu.sh | 51 ++++++++++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
index 4a1275990d7e..efda4fb1c989 100755
--- a/tools/testing/selftests/net/pmtu.sh
+++ b/tools/testing/selftests/net/pmtu.sh
@@ -111,6 +111,10 @@
#
# - cleanup_ipv6_exception
# Same as above, but use IPv6 transport from A to B
+#
+# - list_flush_ipv6_exception
+# Using the same topology as in pmtu_ipv6, create exceptions, and check
+# they are shown when listing exception caches, gone after flushing them
# Kselftest framework requirement - SKIP code is 4.
@@ -150,7 +154,8 @@ tests="
pmtu_vti6_link_add_mtu vti6: MTU setting on link creation
pmtu_vti6_link_change_mtu vti6: MTU changes on link changes
cleanup_ipv4_exception ipv4: cleanup of cached exceptions
- cleanup_ipv6_exception ipv6: cleanup of cached exceptions"
+ cleanup_ipv6_exception ipv6: cleanup of cached exceptions
+ list_flush_ipv6_exception ipv6: list and flush cached exceptions"
NS_A="ns-A"
NS_B="ns-B"
@@ -1090,6 +1095,50 @@ test_cleanup_ipv4_exception() {
test_cleanup_vxlanX_exception 4
}
+test_list_flush_ipv6_exception() {
+ setup namespaces routing || return 2
+ trace "${ns_a}" veth_A-R1 "${ns_r1}" veth_R1-A \
+ "${ns_r1}" veth_R1-B "${ns_b}" veth_B-R1 \
+ "${ns_a}" veth_A-R2 "${ns_r2}" veth_R2-A \
+ "${ns_r2}" veth_R2-B "${ns_b}" veth_B-R2
+
+ dst1="${prefix6}:${b_r1}::1"
+ dst2="${prefix6}:${b_r2}::1"
+
+ # Set up initial MTU values
+ mtu "${ns_a}" veth_A-R1 2000
+ mtu "${ns_r1}" veth_R1-A 2000
+ mtu "${ns_r1}" veth_R1-B 1500
+ mtu "${ns_b}" veth_B-R1 1500
+
+ mtu "${ns_a}" veth_A-R2 2000
+ mtu "${ns_r2}" veth_R2-A 2000
+ mtu "${ns_r2}" veth_R2-B 1500
+ mtu "${ns_b}" veth_B-R2 1500
+
+ fail=0
+
+ # Create route exceptions
+ run_cmd ${ns_a} ${ping6} -q -M want -i 0.1 -w 1 -s 1800 ${dst1}
+ run_cmd ${ns_a} ${ping6} -q -M want -i 0.1 -w 1 -s 1800 ${dst2}
+
+ if [ "$(${ns_a} ip -6 route list cache | wc -l)" -ne 2 ]; then
+ err " can't list cached exceptions"
+ fail=1
+ fi
+
+ run_cmd ${ns_a} ip -6 route flush cache
+ sleep 1
+ pmtu1="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst1})"
+ pmtu2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
+ if [ -n "${pmtu1}" ] || [ -n "${pmtu2}" ]; then
+ err " can't flush cached exceptions"
+ fail=1
+ fi
+
+ return ${fail}
+}
+
usage() {
echo
echo "$0 [OPTIONS] [TEST]..."
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] selftests: pmtu: Introduce list_flush_ipv6_exception test case
2019-06-06 20:15 [PATCH net-next] selftests: pmtu: Introduce list_flush_ipv6_exception test case Stefano Brivio
@ 2019-06-11 18:40 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-06-11 18:40 UTC (permalink / raw)
To: sbrivio; +Cc: jishi, weiwan, dsahern, kafai, edumazet, netdev
From: Stefano Brivio <sbrivio@redhat.com>
Date: Thu, 6 Jun 2019 22:15:09 +0200
> This test checks that route exceptions can be successfully listed and
> flushed using ip -6 route {list,flush} cache.
>
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
> ---
> This will cause a minor conflict with David Ahern's patch:
> "[PATCH net-next 17/19] selftests: pmtu: Add support for routing
> via nexthop objects", currently under review. The "re-run with nh"
> flag for this test in the test list will need to be set to 1.
>
> I can also re-submit this based on that patch, if it helps.
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-11 18:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06 20:15 [PATCH net-next] selftests: pmtu: Introduce list_flush_ipv6_exception test case Stefano Brivio
2019-06-11 18:40 ` David Miller
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).