On RHEL 7.3, test cases that use vxlan, gre, and geneve tunnels fail because
traffic is blocked by default firewall configuration. This commit detects the
status of firewalld, and skips the tests if firewalld is on.

Signed-off-by: Yi-Hung Wei <yihung....@gmail.com>
---
 tests/system-common-macros.at | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at
index 765ea85..d41de23 100644
--- a/tests/system-common-macros.at
+++ b/tests/system-common-macros.at
@@ -223,16 +223,26 @@ m4_define([NETNS_DAEMONIZE],
    ]
 )
 
+# OVS_CHECK_FIREWALL()
+#
+# Check if firewalld is active, skip the test if it is on.
+# The following command currently only supports RHEL and CentOS.
+m4_define([OVS_CHECK_FIREWALL],
+    [AT_SKIP_IF([systemctl status firewalld 2>&1 | grep running > /dev/null])])
+
 # 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])])
+    [AT_SKIP_IF([! ip link add foo type vxlan help 2>&1 | grep dstport 
>/dev/null])
+     OVS_CHECK_FIREWALL()])
 
 # OVS_CHECK_GRE()
 m4_define([OVS_CHECK_GRE],
-    [AT_SKIP_IF([! ip link add foo type gretap help 2>&1 | grep gre 
>/dev/null])])
+    [AT_SKIP_IF([! ip link add foo type gretap help 2>&1 | grep gre 
>/dev/null])
+     OVS_CHECK_FIREWALL()])
 
 # OVS_CHECK_GENEVE()
 m4_define([OVS_CHECK_GENEVE],
-    [AT_SKIP_IF([! ip link add foo type geneve help 2>&1 | grep geneve 
>/dev/null])])
+    [AT_SKIP_IF([! ip link add foo type geneve help 2>&1 | grep geneve 
>/dev/null])
+     OVS_CHECK_FIREWALL()])
-- 
2.7.4

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to