Signed-off-by: Joe Stringer <j...@ovn.org> --- 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 92569f9c4fcf..1b9b5c1e9f15 100644 --- a/tests/system-common-macros.at +++ b/tests/system-common-macros.at @@ -155,3 +155,7 @@ m4_define([NETNS_DAEMONIZE], # Do basic check for vxlan functionality, skip the test if it's not there. m4_define([OVS_CHECK_VXLAN], [AT_SKIP_IF([! ip link add foo type vxlan help 2>&1 | grep dstport >/dev/null])]) + +# OVS_CHECK_GRE() +m4_define([OVS_CHECK_GRE], + [AT_SKIP_IF([! ip link add foo type gretap help 2>&1 | grep gre >/dev/null])]) diff --git a/tests/system-traffic.at b/tests/system-traffic.at index dceae150d148..8684a5f06c68 100644 --- a/tests/system-traffic.at +++ b/tests/system-traffic.at @@ -147,6 +147,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 gre tunnel]) +OVS_CHECK_GRE() + +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([gre], [br0], [at_gre0], [172.31.1.1], [10.1.1.100/24]) +ADD_NATIVE_TUNNEL([gretap], [ns_gre0], [at_ns0], [172.31.1.100], [10.1.1.1/24], + [local 172.31.1.1]) + +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.1.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev