[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <300846068c5a3407061526a8bad57f6d4dfe805d.1521129192.git.sbrivio@redhat.com>
Date: Thu, 15 Mar 2018 17:18:25 +0100
From: Stefano Brivio <sbrivio@...hat.com>
To: "David S . Miller" <davem@...emloft.net>
Cc: Sabrina Dubroca <sd@...asysnail.net>,
Steffen Klassert <steffen.klassert@...unet.com>,
netdev@...r.kernel.org
Subject: [PATCH net-next 5/9] selftests: pmtu: Add pmtu_vti6_default_mtu test
Same as pmtu_vti4_default_mtu, but on IPv6 with vti6.
Signed-off-by: Stefano Brivio <sbrivio@...hat.com>
---
tools/testing/selftests/net/pmtu.sh | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
index 440d2defe592..67b77f9108ee 100755
--- a/tools/testing/selftests/net/pmtu.sh
+++ b/tools/testing/selftests/net/pmtu.sh
@@ -18,8 +18,11 @@
# endpoints. Check that MTU assigned to vti interface is the MTU of the
# lower layer (veth) minus additional lower layer headers (zero, for veth)
# minus IPv4 header length
+#
+# - pmtu_vti6_default_mtu
+# Same as above, for IPv6
-tests="pmtu_vti6_exception pmtu_vti4_default_mtu"
+tests="pmtu_vti6_exception pmtu_vti4_default_mtu pmtu_vti6_default_mtu"
NS_A="ns-$(mktemp -u XXXXXX)"
NS_B="ns-$(mktemp -u XXXXXX)"
@@ -225,6 +228,20 @@ test_pmtu_vti4_default_mtu() {
return 1
}
+test_pmtu_vti6_default_mtu() {
+ setup namespaces veth vti6 && return 2
+
+ # Check that MTU of vti device is MTU of veth minus IPv6 header length
+ veth_mtu="$(link_get_mtu "${ns_a}" veth_a)"
+ vti6_mtu="$(link_get_mtu "${ns_a}" vti6_a)"
+ if [ $((veth_mtu - vti6_mtu)) -ne 40 ]; then
+ echo " vti MTU ${vti6_mtu} is not veth MTU ${veth_mtu} minus IPv6 header length"
+ return 0
+ fi
+
+ return 1
+}
+
trap cleanup EXIT
exitcode=0
--
2.15.1
Powered by blists - more mailing lists