netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: David Ahern <dsahern@gmail.com>,
	Sabrina Dubroca <sd@queasysnail.net>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	netdev@vger.kernel.org
Subject: [PATCH net-next 06/10 v2] selftests: pmtu: Add pmtu_vti6_default_mtu test
Date: Sat, 17 Mar 2018 02:31:43 +0100	[thread overview]
Message-ID: <dc6a4ca17cea6aa95e64117eecbd9809e4348add.1521249420.git.sbrivio@redhat.com> (raw)
In-Reply-To: <cover.1521249420.git.sbrivio@redhat.com>
In-Reply-To: <cover.1521249420.git.sbrivio@redhat.com>

Same as pmtu_vti4_default_mtu, but on IPv6 with vti6.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
v2: Adjusted return codes for 4/10, added test description, error
    strings now buffered

 tools/testing/selftests/net/pmtu.sh | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
index be13b3232c12..5d9af22b360a 100755
--- a/tools/testing/selftests/net/pmtu.sh
+++ b/tools/testing/selftests/net/pmtu.sh
@@ -18,10 +18,14 @@
 #	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	vti6: PMTU exceptions
-	pmtu_vti4_default_mtu	vti4: default MTU assignment"
+	pmtu_vti4_default_mtu	vti4: default MTU assignment
+	pmtu_vti6_default_mtu	vti6: default MTU assignment"
 
 NS_A="ns-$(mktemp -u XXXXXX)"
 NS_B="ns-$(mktemp -u XXXXXX)"
@@ -225,6 +229,18 @@ test_pmtu_vti4_default_mtu() {
 	fi
 }
 
+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
+		err "  vti MTU ${vti6_mtu} is not veth MTU ${veth_mtu} minus IPv6 header length"
+		return 1
+	fi
+}
+
 trap cleanup EXIT
 
 exitcode=0
-- 
2.15.1

  parent reply	other threads:[~2018-03-17  1:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-17  1:31 [PATCH net-next 00/10 v2] selftests: pmtu: Add further vti/vti6 MTU and PMTU tests Stefano Brivio
2018-03-17  1:31 ` [PATCH net-next 01/10 v2] selftests: pmtu: Reverse return codes of functions Stefano Brivio
2018-03-17  1:31 ` [PATCH net-next 02/10 v2] selftests: pmtu: Use namespace command prefix to fetch route mtu Stefano Brivio
2018-03-17  1:31 ` [PATCH net-next 03/10 v2] selftests: pmtu: Factor out MTU parsing helper Stefano Brivio
2018-03-17  1:31 ` [PATCH net-next 04/10 v2] selftests: pmtu: Introduce support for multiple tests Stefano Brivio
2018-03-17  1:31 ` [PATCH net-next 05/10 v2] selftests: pmtu: Add pmtu_vti4_default_mtu test Stefano Brivio
2018-03-17  1:31 ` Stefano Brivio [this message]
2018-03-17  1:31 ` [PATCH net-next 07/10 v2] selftests: pmtu: Add test_pmtu_vti4_exception test Stefano Brivio
2018-03-17  1:31 ` [PATCH net-next 08/10 v2] selftests: pmtu: Add pmtu_vti4_link_add_mtu test Stefano Brivio
2018-03-17  1:31 ` [PATCH net-next 09/10 v2] selftests: pmtu: Add pmtu_vti6_link_add_mtu test Stefano Brivio
2018-03-17  1:31 ` [PATCH net-next 10/10 v2] selftests: pmtu: Add pmtu_vti6_link_change_mtu test Stefano Brivio
2018-03-18  0:15 ` [PATCH net-next 00/10 v2] selftests: pmtu: Add further vti/vti6 MTU and PMTU tests David Miller
2018-03-18 17:31 ` David Ahern
2018-03-18 17:42   ` Stefano Brivio

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=dc6a4ca17cea6aa95e64117eecbd9809e4348add.1521249420.git.sbrivio@redhat.com \
    --to=sbrivio@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sd@queasysnail.net \
    --cc=steffen.klassert@secunet.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).