def _test_ext_chain(config, cred, mock_glance, mock_neutron, mock_client): # instance = self.novaclient.servers.create(name=vmname,...) # instance.status == 'ACTIVE' mock_client.return_value.servers.create.return_value.status = 'ACTIVE' netw = { 'id': 0, 'provider:network_type': 'vlan', 'provider:segmentation_id': 1000 } mock_neutron.Client.return_value.list_networks.return_value = { 'networks': [netw] } specs = Specs() openstack_spec = OpenStackSpec() specs.set_openstack_spec(openstack_spec) cred = MagicMock(spec=nfvbench.credentials.Credentials) cred.is_admin = True runner = ChainRunner(config, cred, specs, BasicFactory()) runner.close()
def _test_pvp_chain_no_admin_config_values(config, cred, mock_glance, mock_neutron, mock_client): # instance = self.novaclient.servers.create(name=vmname,...) # instance.status == 'ACTIVE' mock_client.return_value.servers.create.return_value.status = 'ACTIVE' netw = { 'id': 0, 'provider:network_type': 'vlan', 'provider:segmentation_id': 1000 } mock_neutron.Client.return_value.create_network.return_value = { 'network': netw } mock_neutron.Client.return_value.list_networks.return_value = { 'networks': None } specs = Specs() openstack_spec = OpenStackSpec() specs.set_openstack_spec(openstack_spec) runner = ChainRunner(config, cred, specs, BasicFactory()) runner.close()