From e3ca04ebf4b526d9ba9c85b8b15552a80f5bd654 Mon Sep 17 00:00:00 2001 From: Roman Popelka Date: Fri, 4 Mar 2022 10:31:19 +0100 Subject: [PATCH] Tap-as-a-service scenario manager cleanup As tempest.scenario.manager was announced stable interface in Tempest 27.0.0[1] it can be now reused in plugins. Replaced methods: * _get_network_by_name * _disassociate_floating_ip Etherpad concerning this effort: https://etherpad.opendev.org/p/tempest-scenario-manager-cleanup [1] https://docs.openstack.org/releasenotes/tempest/v27.0.0.html#release-notes-27-0-0 Change-Id: Id5d9b1f74e2d9df56a320587b9ceb8b12f91963b --- .../tests/scenario/manager.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/neutron_taas_tempest_plugin/tests/scenario/manager.py b/neutron_taas_tempest_plugin/tests/scenario/manager.py index f28ef9b..b4d10fa 100644 --- a/neutron_taas_tempest_plugin/tests/scenario/manager.py +++ b/neutron_taas_tempest_plugin/tests/scenario/manager.py @@ -426,13 +426,6 @@ class NetworkScenarioTest(ScenarioTest): % port_map) return port_map[0] - def _get_network_by_name(self, network_name): - net = self.os_admin.networks_client.list_networks( - name=network_name)['networks'] - self.assertNotEqual(len(net), 0, - "Unable to get network by name: %s" % network_name) - return net[0] - def create_floating_ip(self, thing, external_network_id=None, port_id=None, client=None): """Create a floating IP and associates to a resource/port on Neutron""" @@ -464,14 +457,6 @@ class NetworkScenarioTest(ScenarioTest): self.assertEqual(port_id, floating_ip['port_id']) return floating_ip - def _disassociate_floating_ip(self, floating_ip): - """:param floating_ip: floating_ips_client.create_floatingip""" - kwargs = dict(port_id=None) - floating_ip = self.floating_ips_client.update_floatingip( - floating_ip['id'], **kwargs)['floatingip'] - self.assertIsNone(floating_ip['port_id']) - return floating_ip - def check_floating_ip_status(self, floating_ip, status): """Verifies floatingip reaches the given status @@ -798,7 +783,7 @@ class NetworkScenarioTest(ScenarioTest): if not CONF.compute.fixed_network_name: m = 'fixed_network_name must be specified in config' raise lib_exc.InvalidConfiguration(m) - network = cls._get_network_by_name( + network = cls.get_network_by_name( CONF.compute.fixed_network_name) router = None subnet = None