From b77b97720121d71889af2f8ee57ac3bc7824807e Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Thu, 2 Feb 2017 00:18:02 -0800 Subject: [PATCH] Use _create_network in _create_network_structure Similar to the change in I254dbd166a79ca07e18a61da92bc536b035452e1, we should be creating individual networks for each call to this method rather than cramming a bunch of subnets into a single network. This function is called by the router scenarios, which should be using their own individual networks to match real deployment topologies. Change-Id: I032ddc818abe2ac156169b2ed82fc0049319fb9a --- rally/plugins/openstack/scenarios/neutron/utils.py | 2 +- .../unit/plugins/openstack/scenarios/neutron/test_utils.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rally/plugins/openstack/scenarios/neutron/utils.py b/rally/plugins/openstack/scenarios/neutron/utils.py index fab4def8..a3200311 100755 --- a/rally/plugins/openstack/scenarios/neutron/utils.py +++ b/rally/plugins/openstack/scenarios/neutron/utils.py @@ -348,7 +348,7 @@ class NeutronScenario(scenario.OpenStackScenario): :param router_create_args: dict, POST /v2.0/routers request options :returns: tuple of (network, subnets, routers) """ - network = self._get_or_create_network(network_create_args) + network = self._create_network(network_create_args or {}) subnets = self._create_subnets(network, subnet_create_args, subnet_cidr_start, subnets_per_network) diff --git a/tests/unit/plugins/openstack/scenarios/neutron/test_utils.py b/tests/unit/plugins/openstack/scenarios/neutron/test_utils.py index d41db8ec..1b54e8aa 100755 --- a/tests/unit/plugins/openstack/scenarios/neutron/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/neutron/test_utils.py @@ -533,7 +533,7 @@ class NeutronScenarioTestCase(test.ScenarioTestCase): routers.append(mock.MagicMock()) router_create_calls.append(mock.call(router_create_args)) - self.scenario._get_or_create_network = mock.Mock(return_value=network) + self.scenario._create_network = mock.Mock(return_value=network) self.scenario._create_subnets = mock.Mock(return_value=subnets) self.scenario._create_router = mock.Mock(side_effect=routers) self.scenario._add_interface_router = mock.Mock() @@ -544,8 +544,8 @@ class NeutronScenarioTestCase(test.ScenarioTestCase): subnets_per_network, router_create_args) self.assertEqual(actual, (network, subnets, routers)) - self.scenario._get_or_create_network.assert_called_once_with( - network_create_args) + self.scenario._create_network.assert_called_once_with( + network_create_args or {}) self.scenario._create_subnets.assert_called_once_with( network, subnet_create_args,