Merge "Add jobs definitions for Xena branch"
diff --git a/neutron_tempest_plugin/api/admin/test_agent_management.py b/neutron_tempest_plugin/api/admin/test_agent_management.py
index f63e81b..399e428 100644
--- a/neutron_tempest_plugin/api/admin/test_agent_management.py
+++ b/neutron_tempest_plugin/api/admin/test_agent_management.py
@@ -38,9 +38,13 @@
         # Heartbeats must be excluded from comparison
         self.agent.pop('heartbeat_timestamp', None)
         self.agent.pop('configurations', None)
+        # Exclude alive as it can happen that when testclass'
+        # resource_setup executed the selected agent is not up
+        self.agent.pop('alive', None)
         for agent in agents:
             agent.pop('heartbeat_timestamp', None)
             agent.pop('configurations', None)
+            agent.pop('alive', None)
         self.assertIn(self.agent, agents)
 
     @decorators.idempotent_id('e335be47-b9a1-46fd-be30-0874c0b751e6')
diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py
index 8591c89..6674cb8 100644
--- a/neutron_tempest_plugin/scenario/base.py
+++ b/neutron_tempest_plugin/scenario/base.py
@@ -534,7 +534,7 @@
             return False
 
         try:
-            utils.wait_until_true(system_booted, sleep=5)
+            utils.wait_until_true(system_booted, timeout=90, sleep=5)
         except utils.WaitTimeout:
             LOG.debug("No correct output in console of server %s found. "
                       "Guest operating system status can't be checked.",
diff --git a/neutron_tempest_plugin/scenario/test_security_groups.py b/neutron_tempest_plugin/scenario/test_security_groups.py
index 40aa66a..f47ce44 100644
--- a/neutron_tempest_plugin/scenario/test_security_groups.py
+++ b/neutron_tempest_plugin/scenario/test_security_groups.py
@@ -71,10 +71,14 @@
     @classmethod
     def setup_credentials(cls):
         super(NetworkSecGroupTest, cls).setup_credentials()
-        cls.project_id = cls.os_primary.credentials.tenant_id
         cls.network_client = cls.os_admin.network_client
 
     @classmethod
+    def setup_clients(cls):
+        super(NetworkSecGroupTest, cls).setup_clients()
+        cls.project_id = cls.os_primary.credentials.tenant_id
+
+    @classmethod
     def resource_setup(cls):
         super(NetworkSecGroupTest, cls).resource_setup()
         # setup basic topology for servers we can log into it
diff --git a/zuul.d/base-nested-switch.yaml b/zuul.d/base-nested-switch.yaml
new file mode 100644
index 0000000..69e841f
--- /dev/null
+++ b/zuul.d/base-nested-switch.yaml
@@ -0,0 +1,32 @@
+- nodeset:
+    name: neutron-nested-virt-ubuntu-focal
+    nodes:
+      - name: controller
+        label: nested-virt-ubuntu-focal
+    groups:
+      - name: tempest
+        nodes:
+          - controller
+
+# Base nested switch job for non EM releases
+- job:
+    name: neutron-tempest-plugin-scenario-nested-switch
+    parent: neutron-tempest-plugin-scenario
+    abstract: true
+    branches: ^(?!stable/(queens|rocky|stein|train|ussuri)).*$
+    # Comment nodeset and vars to switch back to non nested nodes
+    nodeset: neutron-nested-virt-ubuntu-focal
+    vars:
+      devstack_localrc:
+        LIBVIRT_TYPE: kvm
+        LIBVIRT_CPU_MODE: host-passthrough
+        CIRROS_VERSION: 0.5.1
+        DEFAULT_IMAGE_NAME: cirros-0.5.1-x86_64-disk
+        DEFAULT_IMAGE_FILE_NAME: cirros-0.5.1-x86_64-disk.img
+
+# Base nested switch job for EM releases
+- job:
+    name: neutron-tempest-plugin-scenario-nested-switch
+    parent: neutron-tempest-plugin-scenario
+    abstract: true
+    branches: ^(stable/(queens|rocky|stein|train|ussuri)).*$
diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml
index a492ddb..bd2ae09 100644
--- a/zuul.d/base.yaml
+++ b/zuul.d/base.yaml
@@ -100,19 +100,12 @@
       - ^rally-jobs/.*$
       - ^vagrant/.*$
       - ^zuul.d/(queens|rocky|stein|train|ussuri)_jobs.yaml$
+      - ^zuul.d/base-nested-switch.yaml$
 
 - job:
     name: neutron-tempest-plugin-scenario
     parent: neutron-tempest-plugin-base
     abstract: true
-    nodeset:
-      nodes:
-        - name: controller
-          label: nested-virt-ubuntu-focal
-      groups:
-        - name: tempest
-          nodes:
-            - controller
     description: |
       Perform setup common to all tempest scenario test jobs.
     vars:
@@ -125,12 +118,7 @@
           (^tempest.api.compute.servers.test_attach_interfaces)|\
           (^tempest.api.compute.servers.test_multiple_create)"
       devstack_localrc:
-        LIBVIRT_TYPE: kvm
-        LIBVIRT_CPU_MODE: host-passthrough
         PHYSICAL_NETWORK: default
-        CIRROS_VERSION: 0.5.1
-        DEFAULT_IMAGE_NAME: cirros-0.5.1-x86_64-disk
-        DEFAULT_IMAGE_FILE_NAME: cirros-0.5.1-x86_64-disk.img
         IMAGE_URLS: https://cloud-images.ubuntu.com/minimal/releases/focal/release/ubuntu-20.04-minimal-cloudimg-amd64.img
         ADVANCED_IMAGE_NAME: ubuntu-20.04-minimal-cloudimg-amd64
         ADVANCED_INSTANCE_TYPE: ntp_image_256M
diff --git a/zuul.d/master_jobs.yaml b/zuul.d/master_jobs.yaml
index 7d21fed..90ba9a4 100644
--- a/zuul.d/master_jobs.yaml
+++ b/zuul.d/master_jobs.yaml
@@ -130,11 +130,12 @@
       - ^rally-jobs/.*$
       - ^vagrant/.*$
       - ^zuul.d/(queens|rocky|stein|train|ussuri)_jobs.yaml$
+      - ^zuul.d/base-nested-switch.yaml$
 
 
 - job:
     name: neutron-tempest-plugin-scenario-openvswitch
-    parent: neutron-tempest-plugin-scenario
+    parent: neutron-tempest-plugin-scenario-nested-switch
     timeout: 10000
     vars:
       devstack_services:
@@ -206,10 +207,11 @@
       - ^rally-jobs/.*$
       - ^vagrant/.*$
       - ^zuul.d/(queens|rocky|stein|train|ussuri)_jobs.yaml$
+      - ^zuul.d/base-nested-switch.yaml$
 
 - job:
     name: neutron-tempest-plugin-scenario-openvswitch-iptables_hybrid
-    parent: neutron-tempest-plugin-scenario
+    parent: neutron-tempest-plugin-scenario-nested-switch
     timeout: 10000
     vars:
       devstack_services:
@@ -291,6 +293,7 @@
       - ^rally-jobs/.*$
       - ^vagrant/.*$
       - ^zuul.d/(queens|rocky|stein|train|ussuri)_jobs.yaml$
+      - ^zuul.d/base-nested-switch.yaml$
 
 - job:
     name: neutron-tempest-plugin-scenario-openvswitch-distributed-dhcp
@@ -322,7 +325,7 @@
 
 - job:
     name: neutron-tempest-plugin-scenario-linuxbridge
-    parent: neutron-tempest-plugin-scenario
+    parent: neutron-tempest-plugin-scenario-nested-switch
     timeout: 10000
     roles:
       - zuul: openstack/neutron
@@ -411,10 +414,11 @@
       - ^rally-jobs/.*$
       - ^vagrant/.*$
       - ^zuul.d/(queens|rocky|stein|train|ussuri)_jobs.yaml$
+      - ^zuul.d/base-nested-switch.yaml$
 
 - job:
     name: neutron-tempest-plugin-scenario-ovn
-    parent: neutron-tempest-plugin-scenario
+    parent: neutron-tempest-plugin-scenario-nested-switch
     timeout: 10800
     vars:
       network_api_extensions: *api_extensions
@@ -540,6 +544,7 @@
       - ^rally-jobs/.*$
       - ^vagrant/.*$
       - ^zuul.d/(queens|rocky|stein|train|ussuri)_jobs.yaml$
+      - ^zuul.d/base-nested-switch.yaml$
 
 - job:
     name: neutron-tempest-plugin-dvr-multinode-scenario
@@ -732,7 +737,7 @@
 
 - job:
     name: neutron-tempest-plugin-designate-scenario
-    parent: neutron-tempest-plugin-scenario
+    parent: neutron-tempest-plugin-scenario-nested-switch
     description: Neutron designate integration scenario
     required-projects:
       - openstack/designate
@@ -781,6 +786,7 @@
       - ^rally-jobs/.*$
       - ^vagrant/.*$
       - ^zuul.d/(queens|rocky|stein|train|ussuri)_jobs.yaml$
+      - ^zuul.d/base-nested-switch.yaml$
 
 - job:
     name: neutron-tempest-plugin-sfc
@@ -843,6 +849,7 @@
       - ^rally-jobs/.*$
       - ^vagrant/.*$
       - ^zuul.d/(queens|rocky|stein|train|ussuri)_jobs.yaml$
+      - ^zuul.d/base-nested-switch.yaml$
 
 - job:
     name: neutron-tempest-plugin-bgpvpn-bagpipe
@@ -901,6 +908,7 @@
       - ^rally-jobs/.*$
       - ^vagrant/.*$
       - ^zuul.d/(queens|rocky|stein|train|ussuri)_jobs.yaml$
+      - ^zuul.d/base-nested-switch.yaml$
 
 - job:
     name: neutron-tempest-plugin-dynamic-routing
@@ -964,6 +972,7 @@
       - ^rally-jobs/.*$
       - ^vagrant/.*$
       - ^zuul.d/(queens|rocky|stein|train|ussuri)_jobs.yaml$
+      - ^zuul.d/base-nested-switch.yaml$
 
 - job:
     name: neutron-tempest-plugin-vpnaas
@@ -1022,6 +1031,7 @@
       - ^rally-jobs/.*$
       - ^vagrant/.*$
       - ^zuul.d/(queens|rocky|stein|train|ussuri)_jobs.yaml$
+      - ^zuul.d/base-nested-switch.yaml$
 
 - job:
     name: neutron-tempest-plugin-tap-as-a-service
@@ -1124,3 +1134,4 @@
       - ^rally-jobs/.*$
       - ^vagrant/.*$
       - ^zuul.d/(queens|rocky|stein|train|ussuri)_jobs.yaml$
+      - ^zuul.d/base-nested-switch.yaml$