Merge "Remove unnecessary entries in resource prefix map"
diff --git a/.zuul.yaml b/.zuul.yaml
index 7fb1712..185166a 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -98,6 +98,7 @@
 
 - job:
     name: neutron-tempest-plugin-api-queens
+    nodeset: openstack-single-node-xenial
     parent: neutron-tempest-plugin-api
     override-checkout: stable/queens
     vars:
@@ -111,6 +112,7 @@
 
 - job:
     name: neutron-tempest-plugin-api-rocky
+    nodeset: openstack-single-node-xenial
     parent: neutron-tempest-plugin-api
     override-checkout: stable/rocky
     vars:
@@ -172,6 +174,7 @@
 - job:
     name: neutron-tempest-plugin-scenario-linuxbridge-queens
     parent: neutron-tempest-plugin-scenario-linuxbridge
+    nodeset: openstack-single-node-xenial
     override-checkout: stable/queens
     vars:
       branch_override: stable/queens
@@ -190,6 +193,7 @@
 - job:
     name: neutron-tempest-plugin-scenario-linuxbridge-rocky
     parent: neutron-tempest-plugin-scenario-linuxbridge
+    nodeset: openstack-single-node-xenial
     override-checkout: stable/rocky
     vars:
       branch_override: stable/rocky
@@ -334,6 +338,7 @@
 - job:
     name: neutron-tempest-plugin-dvr-multinode-scenario-queens
     parent: neutron-tempest-plugin-dvr-multinode-scenario
+    nodeset: openstack-two-node-xenial
     override-checkout: stable/queens
     vars:
       branch_override: stable/queens
@@ -343,6 +348,7 @@
 - job:
     name: neutron-tempest-plugin-dvr-multinode-scenario-rocky
     parent: neutron-tempest-plugin-dvr-multinode-scenario
+    nodeset: openstack-two-node-xenial
     override-checkout: stable/rocky
     vars:
       branch_override: stable/rocky
@@ -378,6 +384,7 @@
 - job:
     name: neutron-tempest-plugin-designate-scenario-queens
     parent: neutron-tempest-plugin-designate-scenario
+    nodeset: openstack-single-node-xenial
     override-checkout: stable/queens
     vars:
       branch_override: stable/queens
@@ -387,6 +394,7 @@
 - job:
     name: neutron-tempest-plugin-designate-scenario-rocky
     parent: neutron-tempest-plugin-designate-scenario
+    nodeset: openstack-single-node-xenial
     override-checkout: stable/rocky
     vars:
       branch_override: stable/rocky
diff --git a/neutron_tempest_plugin/api/admin/test_shared_network_extension.py b/neutron_tempest_plugin/api/admin/test_shared_network_extension.py
index cef0ffc..eb902b9 100644
--- a/neutron_tempest_plugin/api/admin/test_shared_network_extension.py
+++ b/neutron_tempest_plugin/api/admin/test_shared_network_extension.py
@@ -101,8 +101,7 @@
     @decorators.idempotent_id('9c31fabb-0181-464f-9ace-95144fe9ca77')
     def test_create_port_shared_network_as_non_admin_tenant(self):
         # create a port as non admin
-        body = self.client.create_port(network_id=self.shared_network['id'])
-        port = body['port']
+        port = self.create_port(self.shared_network)
         self.addCleanup(self.admin_client.delete_port, port['id'])
         # verify the tenant id of admin network and non admin port
         self.assertNotEqual(self.shared_network['tenant_id'],
@@ -257,7 +256,7 @@
     def test_port_presence_prevents_network_rbac_policy_deletion(self):
         res = self._make_admin_net_and_subnet_shared_to_tenant_id(
             self.client.tenant_id)
-        port = self.client.create_port(network_id=res['network']['id'])['port']
+        port = self.create_port(res['network'])
         # a port on the network should prevent the deletion of a policy
         # required for it to exist
         with testtools.ExpectedException(lib_exc.Conflict):
@@ -274,7 +273,7 @@
                          object_type='network', object_id=net['id'],
                          action='access_as_shared',
                          target_tenant=net['tenant_id'])['rbac_policy']
-        port = self.client.create_port(network_id=net['id'])['port']
+        port = self.create_port(net)
         self.client.delete_rbac_policy(self_share['id'])
         self.client.delete_port(port['id'])
 
@@ -290,8 +289,7 @@
     @decorators.idempotent_id('f7539232-389a-4e9c-9e37-e42a129eb541')
     def test_tenant_cant_delete_other_tenants_ports(self):
         net = self.create_network()
-        port = self.client.create_port(network_id=net['id'])['port']
-        self.addCleanup(self.client.delete_port, port['id'])
+        port = self.create_port(net)
         with testtools.ExpectedException(lib_exc.NotFound):
             self.client2.delete_port(port['id'])
 
@@ -405,7 +403,7 @@
                          object_type='network', object_id=net['id'],
                          action='access_as_shared',
                          target_tenant=net['tenant_id'])['rbac_policy']
-        port = self.client.create_port(network_id=net['id'])['port']
+        port = self.create_port(net)
         self.client.update_rbac_policy(self_share['id'],
                                        target_tenant=self.client2.tenant_id)
         self.client.delete_port(port['id'])
diff --git a/neutron_tempest_plugin/api/test_allowed_address_pair.py b/neutron_tempest_plugin/api/test_allowed_address_pair.py
index 0137ff2..dd48382 100644
--- a/neutron_tempest_plugin/api/test_allowed_address_pair.py
+++ b/neutron_tempest_plugin/api/test_allowed_address_pair.py
@@ -53,11 +53,10 @@
         # Create port with allowed address pair attribute
         allowed_address_pairs = [{'ip_address': self.ip_address,
                                   'mac_address': self.mac_address}]
-        body = self.client.create_port(
-            network_id=self.network['id'],
+        body = self.create_port(
+            self.network,
             allowed_address_pairs=allowed_address_pairs)
-        port_id = body['port']['id']
-        self.addCleanup(self.client.delete_port, port_id)
+        port_id = body['id']
 
         # Confirm port was created with allowed address pair attribute
         body = self.client.list_ports()
@@ -69,9 +68,8 @@
 
     def _update_port_with_address(self, address, mac_address=None, **kwargs):
         # Create a port without allowed address pair
-        body = self.client.create_port(network_id=self.network['id'])
-        port_id = body['port']['id']
-        self.addCleanup(self.client.delete_port, port_id)
+        body = self.create_port(self.network)
+        port_id = body['id']
         if mac_address is None:
             mac_address = self.mac_address
 
@@ -99,11 +97,9 @@
     @decorators.idempotent_id('b3f20091-6cd5-472b-8487-3516137df933')
     def test_update_port_with_multiple_ip_mac_address_pair(self):
         # Create an ip _address and mac_address through port create
-        resp = self.client.create_port(network_id=self.network['id'])
-        newportid = resp['port']['id']
-        self.addCleanup(self.client.delete_port, newportid)
-        ipaddress = resp['port']['fixed_ips'][0]['ip_address']
-        macaddress = resp['port']['mac_address']
+        resp = self.create_port(self.network)
+        ipaddress = resp['fixed_ips'][0]['ip_address']
+        macaddress = resp['mac_address']
 
         # Update allowed address pair port with multiple ip and  mac
         allowed_address_pairs = {'ip_address': ipaddress,
diff --git a/neutron_tempest_plugin/api/test_extra_dhcp_options.py b/neutron_tempest_plugin/api/test_extra_dhcp_options.py
index cb4dba8..844666a 100644
--- a/neutron_tempest_plugin/api/test_extra_dhcp_options.py
+++ b/neutron_tempest_plugin/api/test_extra_dhcp_options.py
@@ -56,11 +56,10 @@
     @decorators.idempotent_id('d2c17063-3767-4a24-be4f-a23dbfa133c9')
     def test_create_list_port_with_extra_dhcp_options(self):
         # Create a port with Extra DHCP Options
-        body = self.client.create_port(
-            network_id=self.network['id'],
+        body = self.create_port(
+            self.network,
             extra_dhcp_opts=self.extra_dhcp_opts)
-        port_id = body['port']['id']
-        self.addCleanup(self.client.delete_port, port_id)
+        port_id = body['id']
 
         # Confirm port created has Extra DHCP Options
         body = self.client.list_ports()
diff --git a/neutron_tempest_plugin/api/test_networks_negative.py b/neutron_tempest_plugin/api/test_networks_negative.py
index 93f32f7..1cc8b93 100644
--- a/neutron_tempest_plugin/api/test_networks_negative.py
+++ b/neutron_tempest_plugin/api/test_networks_negative.py
@@ -28,8 +28,7 @@
     @decorators.attr(type='negative')
     @decorators.idempotent_id('9f80f25b-5d1b-4f26-9f6b-774b9b270819')
     def test_delete_network_in_use(self):
-        port = self.client.create_port(network_id=self.network['id'])
-        self.addCleanup(self.client.delete_port, port['port']['id'])
+        self.create_port(self.network)
         with testtools.ExpectedException(lib_exc.Conflict):
             self.client.delete_subnet(self.subnet['id'])
         with testtools.ExpectedException(lib_exc.Conflict):
diff --git a/neutron_tempest_plugin/api/test_routers_negative.py b/neutron_tempest_plugin/api/test_routers_negative.py
index 2f4ad44..bbd6c5d 100644
--- a/neutron_tempest_plugin/api/test_routers_negative.py
+++ b/neutron_tempest_plugin/api/test_routers_negative.py
@@ -39,9 +39,9 @@
     @decorators.idempotent_id('e3e751af-15a2-49cc-b214-a7154579e94f')
     def test_delete_router_in_use(self):
         # This port is deleted after a test by remove_router_interface.
-        port = self.client.create_port(network_id=self.network['id'])
+        port = self.create_port(self.network)
         self.client.add_router_interface_with_port_id(
-            self.router['id'], port['port']['id'])
+            self.router['id'], port['id'])
         with testtools.ExpectedException(lib_exc.Conflict):
             self.client.delete_router(self.router['id'])