Remove _disassociate_floating_ip & _create_network
As tempest.scenario.manager was announced stable interface in Tempest 27.0.0[1] it can be now reused in plugins.
Replaced methods:
* _disassociate_floating_ip (not used)
* _create_network
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: I083d713c638de50b1549b4c10b9eb38f58b85fab
diff --git a/manila_tempest_tests/tests/scenario/manager.py b/manila_tempest_tests/tests/scenario/manager.py
index 8a18609..82b8b07 100644
--- a/manila_tempest_tests/tests/scenario/manager.py
+++ b/manila_tempest_tests/tests/scenario/manager.py
@@ -32,7 +32,7 @@
LOG = log.getLogger(__name__)
-class ScenarioTest(manager.ScenarioTest):
+class ScenarioTest(manager.NetworkScenarioTest):
"""Base class for scenario tests. Uses tempest own clients. """
credentials = ['primary']
@@ -368,29 +368,6 @@
if not CONF.service_available.neutron:
raise cls.skipException('Neutron not available')
- def _create_network(self, networks_client=None,
- tenant_id=None,
- namestart='network-smoke-',
- port_security_enabled=True):
- if not networks_client:
- networks_client = self.networks_client
- if not tenant_id:
- tenant_id = networks_client.tenant_id
- name = data_utils.rand_name(namestart)
- network_kwargs = dict(name=name, tenant_id=tenant_id)
- # Neutron disables port security by default so we have to check the
- # config before trying to create the network with port_security_enabled
- if CONF.network_feature_enabled.port_security:
- network_kwargs['port_security_enabled'] = port_security_enabled
- result = networks_client.create_network(**network_kwargs)
- network = result['network']
-
- self.assertEqual(network['name'], name)
- self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- networks_client.delete_network,
- network['id'])
- return network
-
def _create_subnet(self, network, subnets_client=None,
routers_client=None, namestart='subnet-smoke',
**kwargs):
@@ -565,14 +542,6 @@
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
@@ -922,7 +891,7 @@
router = None
subnet = None
else:
- network = self._create_network(
+ network = self.create_network(
networks_client=networks_client,
tenant_id=tenant_id,
port_security_enabled=port_security_enabled)
diff --git a/manila_tempest_tests/tests/scenario/manager_share.py b/manila_tempest_tests/tests/scenario/manager_share.py
index 4c03107..79f3f58 100644
--- a/manila_tempest_tests/tests/scenario/manager_share.py
+++ b/manila_tempest_tests/tests/scenario/manager_share.py
@@ -109,7 +109,7 @@
# Tests need to be able to ssh into the VM - so we need
# a security group, and a tenant private network
self.security_group = self._create_security_group()
- self.network = self._create_network(namestart="manila-share")
+ self.network = self.create_network(namestart="manila-share")
# When not using a "storage network" to connect shares to VMs,
# we need the subnet to match the IP version we're testing
subnet_ip_params = {} if self.storage_network else {