Use admin_client to list admin's servers' ports
FloatingIpTestCasesAdmin creates VMs as admin (to be sure to boot on
availability_zone) so to list ports for the VM we have to use
admin_client.
Change-Id: I1da9ccc99b70355554ace3a20a237bb4f33381ab
Closes-Bug: #1952806
diff --git a/neutron_tempest_plugin/scenario/admin/test_floatingip.py b/neutron_tempest_plugin/scenario/admin/test_floatingip.py
index a08acc3..d9abaf5 100644
--- a/neutron_tempest_plugin/scenario/admin/test_floatingip.py
+++ b/neutron_tempest_plugin/scenario/admin/test_floatingip.py
@@ -28,6 +28,14 @@
credentials = ['primary', 'admin']
@classmethod
+ def setup_clients(cls):
+ super(FloatingIpTestCasesAdmin, cls).setup_clients()
+ # admin_client set in BaseAdminNetworkTest but here we inherit from
+ # BaseNetworkTest
+ if not cls.admin_client:
+ cls.admin_client = cls.os_admin.network_client
+
+ @classmethod
@utils.requires_ext(extension="router", service="network")
def resource_setup(cls):
super(FloatingIpTestCasesAdmin, cls).resource_setup()
@@ -75,7 +83,7 @@
waiters.wait_for_server_status(
self.os_admin.servers_client, server['server']['id'],
const.SERVER_STATUS_ACTIVE)
- port = self.client.list_ports(
+ port = self.admin_client.list_ports(
network_id=self.network['id'],
device_id=server['server']['id']
)['ports'][0]