diff mbox

[ovs-dev,3/3] system-traffic: Skip test cases if firewalld is on.

Message ID 1481250847-49316-3-git-send-email-yihung.wei@gmail.com
State Accepted
Headers show

Commit Message

Yi-Hung Wei Dec. 9, 2016, 2:34 a.m. UTC
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.wei@gmail.com>
---
 tests/system-common-macros.at | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

Comments

Joe Stringer Dec. 14, 2016, 11:15 p.m. UTC | #1
On 8 December 2016 at 18:34, Yi-Hung Wei <yihung.wei@gmail.com> wrote:
> 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.wei@gmail.com>

This macro could be made a bit smarter - perhaps by standing up a
couple of namespaces and running traffic through to find out if a
firewall is interfering - but that could be introduced in a followup
patch.

I applied this to master anyway, since it's better than what we had before.
diff mbox

Patch

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()])