From patchwork Mon Jul 10 19:39:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Garver X-Patchwork-Id: 786345 X-Patchwork-Delegate: joestringer@nicira.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x5wdd4gbRz9s7m for ; Tue, 11 Jul 2017 05:44:21 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id AD866BCA; Mon, 10 Jul 2017 19:40:11 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8233DA88 for ; Mon, 10 Jul 2017 19:40:06 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 00BB11F5 for ; Mon, 10 Jul 2017 19:40:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 71EF8C04F4D6; Mon, 10 Jul 2017 19:40:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 71EF8C04F4D6 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=erig.me Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=e@erig.me DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 71EF8C04F4D6 Received: from dev-rhel7.localdomain (wsfd-netdev-vmhost.ntdv.lab.eng.bos.redhat.com [10.19.17.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id E69B25C550; Mon, 10 Jul 2017 19:40:04 +0000 (UTC) From: Eric Garver To: dev@openvswitch.org Date: Mon, 10 Jul 2017 15:39:58 -0400 Message-Id: <20170710194000.21627-9-e@erig.me> In-Reply-To: <20170710194000.21627-1-e@erig.me> References: <20170710194000.21627-1-e@erig.me> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 10 Jul 2017 19:40:05 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 08/10] system-layer3-tunnels: Add basic VXLAN-GPE ping test case X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org This also adds a new autotest file specifically for layer3 tunnels. Signed-off-by: Eric Garver --- tests/automake.mk | 1 + tests/system-kmod-testsuite.at | 1 + tests/system-layer3-tunnels.at | 50 +++++++++++++++++++++++++++++++++++++ tests/system-userspace-testsuite.at | 1 + 4 files changed, 53 insertions(+) create mode 100644 tests/system-layer3-tunnels.at diff --git a/tests/automake.mk b/tests/automake.mk index 3118bbc278b7..be9dc966b147 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -115,6 +115,7 @@ SYSTEM_USERSPACE_TESTSUITE_AT = \ SYSTEM_TESTSUITE_AT = \ tests/system-common-macros.at \ tests/system-ovn.at \ + tests/system-layer3-tunnels.at \ tests/system-traffic.at SYSTEM_OFFLOADS_TESTSUITE_AT = \ diff --git a/tests/system-kmod-testsuite.at b/tests/system-kmod-testsuite.at index bdf57c8946af..975b200342e6 100644 --- a/tests/system-kmod-testsuite.at +++ b/tests/system-kmod-testsuite.at @@ -23,4 +23,5 @@ m4_include([tests/system-common-macros.at]) m4_include([tests/system-kmod-macros.at]) m4_include([tests/system-traffic.at]) +m4_include([tests/system-layer3-tunnels.at]) m4_include([tests/system-ovn.at]) diff --git a/tests/system-layer3-tunnels.at b/tests/system-layer3-tunnels.at new file mode 100644 index 000000000000..585b63d94d5f --- /dev/null +++ b/tests/system-layer3-tunnels.at @@ -0,0 +1,50 @@ +AT_BANNER([layer3-tunnels]) + +AT_SETUP([layer3 - ping over VXLAN-GPE]) +OVS_TRAFFIC_VSWITCHD_START([set Bridge br0 other-config:hwaddr="00:12:34:56:78:bb"]) +OVS_CHECK_VXLAN_GPE() +OVS_CHECK_IPROUTE_ENCAP() + +ADD_BR([br-underlay]) + +ADD_NAMESPACES(at_ns0) + +dnl Set up underlay link from host into the namespace using veth pair. +ADD_VETH(p0, at_ns0, br-underlay, "172.31.1.1/24") +AT_CHECK([ip addr add dev br-underlay "172.31.1.100/24"]) +AT_CHECK([ip link set dev br-underlay up]) + +dnl Set up tunnel endpoints on OVS outside the namespace and with a native +dnl linux device inside the namespace. +ADD_OVS_TUNNEL([vxlan], [br0], [at_vxlan0], [172.31.1.1], [10.1.1.2/24], + [options:packet_type=legacy_l3 options:exts=gpe]) +AT_CHECK([ip neigh add 10.1.1.1 lladdr 00:12:34:56:78:aa dev br0]) +NS_CHECK_EXEC([at_ns0], [ip link add dev at_vxlan1 type vxlan dstport 4789 external gpe]) +NS_CHECK_EXEC([at_ns0], [ip addr add dev at_vxlan1 10.1.1.1/24]) +NS_CHECK_EXEC([at_ns0], [ip link set dev at_vxlan1 mtu 1450 up]) +NS_CHECK_EXEC([at_ns0], [ip route add 10.1.1.2/32 encap ip id 0 dst 172.31.1.100 dev at_vxlan1]) + +AT_CHECK([ovs-ofctl add-flow br-underlay "actions=normal"]) + +dnl Now add rules for OVS to forward to the tunnel and local port +AT_CHECK([ovs-ofctl add-flow br0 "priority=1 action=drop"]) +AT_CHECK([ovs-ofctl add-flow br0 "priority=100 ip,nw_dst=10.1.1.1 action=output:at_vxlan0"]) +AT_CHECK([ovs-ofctl add-flow br0 "priority=100 ip,nw_dst=10.1.1.2 action=mod_dl_src:00:12:34:56:78:aa,mod_dl_dst:00:12:34:56:78:bb,local"]) + +OVS_WAIT_UNTIL([ip netns exec at_ns0 ping -c 1 10.1.1.2]) + +dnl First, check the underlay +NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 172.31.1.100 | FORMAT_PING], [0], [dnl +3 packets transmitted, 3 received, 0% packet loss, time 0ms +]) + +dnl Okay, now check the overlay with different packet sizes +NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 10.1.1.2 | FORMAT_PING], [0], [dnl +3 packets transmitted, 3 received, 0% packet loss, time 0ms +]) +NS_CHECK_EXEC([at_ns0], [ping -s 3200 -q -c 3 -i 0.3 -w 2 10.1.1.2 | FORMAT_PING], [0], [dnl +3 packets transmitted, 3 received, 0% packet loss, time 0ms +]) + +OVS_TRAFFIC_VSWITCHD_STOP +AT_CLEANUP diff --git a/tests/system-userspace-testsuite.at b/tests/system-userspace-testsuite.at index e81f5a445483..a89536f1d381 100644 --- a/tests/system-userspace-testsuite.at +++ b/tests/system-userspace-testsuite.at @@ -23,5 +23,6 @@ m4_include([tests/system-userspace-macros.at]) m4_include([tests/system-common-macros.at]) m4_include([tests/system-traffic.at]) +m4_include([tests/system-layer3-tunnels.at]) m4_include([tests/system-ovn.at]) m4_include([tests/system-userspace-packet-type-aware.at])