The vxlan tests require a new enough 'ip' tool to configure native VXLAN
tunnels on the host kernel (as well as a new enough kernel). If this
isn't available, simply skip the test. This commit makes the cases where
this is checked consistent.

Signed-off-by: Joe Stringer <j...@ovn.org>
---
 tests/system-common-macros.at | 6 ++++++
 tests/system-traffic.at       | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at
index 4d88b74052ae..fcd77923d4d4 100644
--- a/tests/system-common-macros.at
+++ b/tests/system-common-macros.at
@@ -149,3 +149,9 @@ m4_define([NETNS_DAEMONIZE],
      echo "kill \`cat $3\`" >> cleanup
    ]
 )
+
+# OVS_CHECK_VXLAN()
+#
+# 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])])
diff --git a/tests/system-traffic.at b/tests/system-traffic.at
index 550164200873..74ca0a0911ce 100644
--- a/tests/system-traffic.at
+++ b/tests/system-traffic.at
@@ -107,7 +107,7 @@ OVS_TRAFFIC_VSWITCHD_STOP
 AT_CLEANUP
 
 AT_SETUP([datapath - ping over vxlan tunnel])
-AT_SKIP_IF([! ip link add foo type vxlan help 2>&1 | grep dstport >/dev/null])
+OVS_CHECK_VXLAN()
 
 OVS_TRAFFIC_VSWITCHD_START()
 ADD_BR([br-underlay])
@@ -1307,7 +1307,7 @@ OVS_TRAFFIC_VSWITCHD_STOP
 AT_CLEANUP
 
 AT_SETUP([conntrack - Fragmentation over vxlan])
-AT_SKIP_IF([! ip link help 2>&1 | grep vxlan >/dev/null])
+OVS_CHECK_VXLAN()
 CHECK_CONNTRACK()
 
 OVS_TRAFFIC_VSWITCHD_START()
-- 
2.1.4

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to