From 50ddf4b5ad05adb5090d6d14f63c07cfd9773ab4 Mon Sep 17 00:00:00 2001
From: Slawek Kaplonski <skaplons@redhat.com>
Date: Fri, 1 Jun 2018 12:43:24 +0200
Subject: [PATCH] Replace ovsfw tempest job with iptables-hybrid tempest job

In commit [1] openvswitch firewall driver is switched to be
default one used in devstack.
So various tempest jobs will use this driver and it will be
tested.
We now need separate job to test non-default firewall driver
which currently is iptables-hybrid driver.

[1] https://review.openstack.org/#/c/568297/

Depends-On: https://review.openstack.org/#/c/568297/
Change-Id: I6061a173c95c8a41a61bfa298ae5964cc9b5d2e8
---
 .zuul.yaml                                             | 10 +++++-----
 neutron/tests/contrib/gate_hook.sh                     |  6 +++---
 neutron/tests/contrib/hooks/{ovsfw => iptables_hybrid} |  2 +-
 .../post.yaml                                          |  0
 .../run.yaml                                           |  4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)
 rename neutron/tests/contrib/hooks/{ovsfw => iptables_hybrid} (63%)
 rename playbooks/legacy/{neutron-tempest-ovsfw => neutron-tempest-iptables_hybrid}/post.yaml (100%)
 rename playbooks/legacy/{neutron-tempest-ovsfw => neutron-tempest-iptables_hybrid}/run.yaml (90%)

diff --git a/.zuul.yaml b/.zuul.yaml
index 2ff26d1cdd1..62c189b2a48 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -12,7 +12,7 @@
         - neutron-grenade-dvr-multinode
         - neutron-tempest-multinode-full
         - neutron-tempest-dvr-ha-multinode-full
-        - neutron-tempest-ovsfw
+        - neutron-tempest-iptables_hybrid
         - neutron-grenade
         - openstack-tox-lower-constraints
     gate:
@@ -21,7 +21,7 @@
         - neutron-fullstack
         - neutron-tempest-dvr
         - neutron-tempest-linuxbridge
-        - neutron-tempest-ovsfw
+        - neutron-tempest-iptables_hybrid
         - neutron-grenade-multinode
         - neutron-grenade-dvr-multinode
         - neutron-grenade
@@ -255,10 +255,10 @@
     voting: false
 
 - job:
-    name: neutron-tempest-ovsfw
+    name: neutron-tempest-iptables_hybrid
     parent: legacy-dsvm-base
-    run: playbooks/legacy/neutron-tempest-ovsfw/run.yaml
-    post-run: playbooks/legacy/neutron-tempest-ovsfw/post.yaml
+    run: playbooks/legacy/neutron-tempest-iptables_hybrid/run.yaml
+    post-run: playbooks/legacy/neutron-tempest-iptables_hybrid/post.yaml
     timeout: 7800
     required-projects:
       - openstack-infra/devstack-gate
diff --git a/neutron/tests/contrib/gate_hook.sh b/neutron/tests/contrib/gate_hook.sh
index d6365798837..21c44fab67b 100644
--- a/neutron/tests/contrib/gate_hook.sh
+++ b/neutron/tests/contrib/gate_hook.sh
@@ -91,7 +91,7 @@ case $VENV in
     load_rc_hook dstat
     ;;
 
-"api"|"api-pecan"|"full-ovsfw"|"full-pecan"|"dsvm-scenario-ovs"|"dsvm-scenario-linuxbridge")
+"api"|"api-pecan"|"full-iptables_hybrid"|"full-pecan"|"dsvm-scenario-ovs"|"dsvm-scenario-linuxbridge")
     # TODO(ihrachys) consider feeding result of ext-list into tempest.conf
     load_rc_hook api_all_extensions
     if [ "${FLAVOR}" = "dvrskip" ]; then
@@ -114,8 +114,8 @@ case $VENV in
     if [[ "$VENV" =~ "pecan" ]]; then
         load_conf_hook pecan
     fi
-    if [[ "$VENV" =~ "ovs" ]]; then
-        load_conf_hook ovsfw
+    if [[ "$VENV" =~ "iptables_hybrid" ]]; then
+        load_conf_hook iptables_hybrid
     fi
     if [[ "$VENV" != "dsvm-scenario-linuxbridge" ]]; then
         load_conf_hook tunnel_types
diff --git a/neutron/tests/contrib/hooks/ovsfw b/neutron/tests/contrib/hooks/iptables_hybrid
similarity index 63%
rename from neutron/tests/contrib/hooks/ovsfw
rename to neutron/tests/contrib/hooks/iptables_hybrid
index b9faa1d6433..74ae84a47fb 100644
--- a/neutron/tests/contrib/hooks/ovsfw
+++ b/neutron/tests/contrib/hooks/iptables_hybrid
@@ -1,4 +1,4 @@
 [[post-config|/$NEUTRON_CORE_PLUGIN_CONF]]
 
 [securitygroup]
-firewall_driver = openvswitch
+firewall_driver = iptables_hybrid
diff --git a/playbooks/legacy/neutron-tempest-ovsfw/post.yaml b/playbooks/legacy/neutron-tempest-iptables_hybrid/post.yaml
similarity index 100%
rename from playbooks/legacy/neutron-tempest-ovsfw/post.yaml
rename to playbooks/legacy/neutron-tempest-iptables_hybrid/post.yaml
diff --git a/playbooks/legacy/neutron-tempest-ovsfw/run.yaml b/playbooks/legacy/neutron-tempest-iptables_hybrid/run.yaml
similarity index 90%
rename from playbooks/legacy/neutron-tempest-ovsfw/run.yaml
rename to playbooks/legacy/neutron-tempest-iptables_hybrid/run.yaml
index ac2dc19964a..41757ec9008 100644
--- a/playbooks/legacy/neutron-tempest-ovsfw/run.yaml
+++ b/playbooks/legacy/neutron-tempest-iptables_hybrid/run.yaml
@@ -1,5 +1,5 @@
 - hosts: all
-  name: Autoconverted job legacy-tempest-dsvm-neutron-ovsfw from old job gate-tempest-dsvm-neutron-ovsfw-ubuntu-xenial-nv
+  name: Neutron Tempest iptables-hybrid job
   tasks:
 
     - name: Ensure legacy workspace directory
@@ -37,7 +37,7 @@
           fi
 
           function gate_hook {
-              bash -xe $BASE/new/neutron/neutron/tests/contrib/gate_hook.sh full-ovsfw
+              bash -xe $BASE/new/neutron/neutron/tests/contrib/gate_hook.sh full-iptables_hybrid
           }
           export -f gate_hook