Merge "Use new network for each subnet scenario run"

This commit is contained in:
Jenkins 2017-01-26 23:42:14 +00:00 committed by Gerrit Code Review
commit 4c53056382
2 changed files with 6 additions and 6 deletions

View File

@ -116,7 +116,7 @@ class CreateAndListSubnets(utils.NeutronScenario):
:param subnet_cidr_start: str, start value for subnets CIDR :param subnet_cidr_start: str, start value for subnets CIDR
:param subnets_per_network: int, number of subnets for one network :param subnets_per_network: int, number of subnets for one network
""" """
network = self._get_or_create_network(network_create_args) network = self._create_network(network_create_args or {})
self._create_subnets(network, subnet_create_args, subnet_cidr_start, self._create_subnets(network, subnet_create_args, subnet_cidr_start,
subnets_per_network) subnets_per_network)
self._list_subnets() self._list_subnets()
@ -145,7 +145,7 @@ class CreateAndUpdateSubnets(utils.NeutronScenario):
:param subnet_cidr_start: str, start value for subnets CIDR :param subnet_cidr_start: str, start value for subnets CIDR
:param subnets_per_network: int, number of subnets for one network :param subnets_per_network: int, number of subnets for one network
""" """
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, subnets = self._create_subnets(network, subnet_create_args,
subnet_cidr_start, subnets_per_network) subnet_cidr_start, subnets_per_network)

View File

@ -141,7 +141,7 @@ class NeutronNetworksTestCase(test.ScenarioTestCase):
net = mock.MagicMock() net = mock.MagicMock()
scenario = network.CreateAndListSubnets(self.context) scenario = network.CreateAndListSubnets(self.context)
scenario._get_or_create_network = mock.Mock(return_value=net) scenario._create_network = mock.Mock(return_value=net)
scenario._create_subnets = mock.Mock() scenario._create_subnets = mock.Mock()
scenario._list_subnets = mock.Mock() scenario._list_subnets = mock.Mock()
@ -150,7 +150,7 @@ class NeutronNetworksTestCase(test.ScenarioTestCase):
subnet_cidr_start=subnet_cidr_start, subnet_cidr_start=subnet_cidr_start,
subnets_per_network=subnets_per_network) subnets_per_network=subnets_per_network)
scenario._get_or_create_network.assert_called_once_with( scenario._create_network.assert_called_once_with(
network_create_args) network_create_args)
scenario._create_subnets.assert_called_once_with( scenario._create_subnets.assert_called_once_with(
net, subnet_create_args, subnet_cidr_start, subnets_per_network) net, subnet_create_args, subnet_cidr_start, subnets_per_network)
@ -167,7 +167,7 @@ class NeutronNetworksTestCase(test.ScenarioTestCase):
subnets = [mock.MagicMock() for _ in range(subnets_per_network)] subnets = [mock.MagicMock() for _ in range(subnets_per_network)]
scenario = network.CreateAndUpdateSubnets(self.context) scenario = network.CreateAndUpdateSubnets(self.context)
scenario._get_or_create_network = mock.Mock(return_value=net) scenario._create_network = mock.Mock(return_value=net)
scenario._create_subnets = mock.Mock(return_value=subnets) scenario._create_subnets = mock.Mock(return_value=subnets)
scenario._update_subnet = mock.Mock() scenario._update_subnet = mock.Mock()
@ -177,7 +177,7 @@ class NeutronNetworksTestCase(test.ScenarioTestCase):
subnet_cidr_start=subnet_cidr_start, subnet_cidr_start=subnet_cidr_start,
subnets_per_network=subnets_per_network) subnets_per_network=subnets_per_network)
scenario._get_or_create_network.assert_called_once_with( scenario._create_network.assert_called_once_with(
network_create_args) network_create_args)
scenario._create_subnets.assert_called_once_with( scenario._create_subnets.assert_called_once_with(
net, subnet_create_args, subnet_cidr_start, subnets_per_network) net, subnet_create_args, subnet_cidr_start, subnets_per_network)