Rename create_networks to correct name as per its functionality

create_networks() method create network, subnet, router and connect
it to router but its name is sounds like it will create more than one
network. This also confusing with existing create_network() method
(without 's').

Renaming this to setup_network_subnet_with_router() which is what
this function does.

Implements: blueprint tempest-scenario-manager-stable
Change-Id: I63b3991210fd86bcc830af5beed28324797c3209
This commit is contained in:
Ghanshyam Mann 2021-03-24 19:10:47 -05:00 committed by Ghanshyam
parent 6428139de1
commit 071d154be0
5 changed files with 10 additions and 8 deletions

View File

@ -1493,10 +1493,11 @@ class NetworkScenarioTest(ScenarioTest):
raise Exception("Neither of 'public_router_id' or "
"'public_network_id' has been defined.")
def create_networks(self, networks_client=None,
routers_client=None, subnets_client=None,
project_id=None, dns_nameservers=None,
port_security_enabled=True, **net_dict):
def setup_network_subnet_with_router(
self, networks_client=None,
routers_client=None, subnets_client=None,
project_id=None, dns_nameservers=None,
port_security_enabled=True, **net_dict):
"""Create a network with a subnet connected to a router.
The baremetal driver is a special case since all nodes are

View File

@ -128,7 +128,7 @@ class MinBwAllocationPlacementTest(manager.NetworkScenarioTest):
base_segm = \
CONF.network_feature_enabled.provider_net_base_segmentation_id
self.prov_network, _, _ = self.create_networks(
self.prov_network, _, _ = self.setup_network_subnet_with_router(
networks_client=self.networks_client,
routers_client=self.routers_client,
subnets_client=self.subnets_client,

View File

@ -62,7 +62,7 @@ class TestNetworkAdvancedServerOps(manager.NetworkScenarioTest):
if utils.is_extension_enabled('security-group', 'network'):
security_group = self.create_security_group()
security_groups = [{'name': security_group['name']}]
network, _, _ = self.create_networks()
network, _, _ = self.setup_network_subnet_with_router()
server = self.create_server(
networks=[{'uuid': network['id']}],
key_name=keypair['name'],

View File

@ -106,7 +106,8 @@ class TestNetworkBasicOps(manager.NetworkScenarioTest):
def _setup_network_and_servers(self, **kwargs):
boot_with_port = kwargs.pop('boot_with_port', False)
self.network, self.subnet, self.router = self.create_networks(**kwargs)
self.network, self.subnet, self.router = (
self.setup_network_subnet_with_router(**kwargs))
self.check_networks()
self.ports = []

View File

@ -326,7 +326,7 @@ class TestSecurityGroupsBasicOps(manager.NetworkScenarioTest):
self.floating_ips.setdefault(server['id'], floating_ip)
def _create_tenant_network(self, tenant, port_security_enabled=True):
network, subnet, router = self.create_networks(
network, subnet, router = self.setup_network_subnet_with_router(
networks_client=tenant.manager.networks_client,
routers_client=tenant.manager.routers_client,
subnets_client=tenant.manager.subnets_client,