From 92b8af2c061eb6623b8a615fc9dbca5de092c167 Mon Sep 17 00:00:00 2001 From: Joe Stringer Date: Wed, 20 Apr 2016 16:07:52 -0700 Subject: [PATCH] system-traffic: Add basic geneve tunnel sanity test. Signed-off-by: Joe Stringer Acked-by: Daniele Di Proietto --- tests/system-common-macros.at | 4 ++++ tests/system-traffic.at | 41 +++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at index 1b9b5c1e9..2116f1e31 100644 --- a/tests/system-common-macros.at +++ b/tests/system-common-macros.at @@ -159,3 +159,7 @@ m4_define([OVS_CHECK_VXLAN], # OVS_CHECK_GRE() m4_define([OVS_CHECK_GRE], [AT_SKIP_IF([! ip link add foo type gretap help 2>&1 | grep gre >/dev/null])]) + +# OVS_CHECK_GENEVE() +m4_define([OVS_CHECK_GENEVE], + [AT_SKIP_IF([! ip link add foo type geneve help 2>&1 | grep geneve >/dev/null])]) diff --git a/tests/system-traffic.at b/tests/system-traffic.at index 0a9c084f7..d1b5d09dc 100644 --- a/tests/system-traffic.at +++ b/tests/system-traffic.at @@ -187,6 +187,47 @@ NS_CHECK_EXEC([at_ns0], [ping -s 3200 -q -c 3 -i 0.3 -w 2 10.1.1.100 | FORMAT_PI OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([datapath - ping over geneve tunnel]) +OVS_CHECK_GENEVE() + +OVS_TRAFFIC_VSWITCHD_START() +ADD_BR([br-underlay]) + +AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"]) +AT_CHECK([ovs-ofctl add-flow br-underlay "actions=normal"]) + +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([geneve], [br0], [at_gnv0], [172.31.1.1], [10.1.1.100/24]) +ADD_NATIVE_TUNNEL([geneve], [ns_gnv0], [at_ns0], [172.31.1.100], [10.1.1.1/24], + [vni 0]) + +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.100 | FORMAT_PING], [0], [dnl +3 packets transmitted, 3 received, 0% packet loss, time 0ms +]) +NS_CHECK_EXEC([at_ns0], [ping -s 1600 -q -c 3 -i 0.3 -w 2 10.1.1.100 | 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.100 | FORMAT_PING], [0], [dnl +3 packets transmitted, 3 received, 0% packet loss, time 0ms +]) + +OVS_TRAFFIC_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([conntrack - controller]) CHECK_CONNTRACK() OVS_TRAFFIC_VSWITCHD_START() -- 2.20.1