Fix scenarios not passing down specific network
Nova v2 api expects nics in specific networks to be passed
down in an array of "networks". nics is used in novaclient
but converted to networks in
python-novaclient/tree/novaclient/v1_1/servers.py#n520
Apply the conversion to the parameters to make the check
pass in case where there would be multiple networks
matching the requirements. Also remove a case where scenario
manager forced in the wrong network into the tests.
Closes-Bug: #1368834
Change-Id: Ic0b87377c5878e240a0fbcc6549023c828dd97ab
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index cabefc8..b87d342 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -222,26 +222,6 @@
if create_kwargs is None:
create_kwargs = {}
- fixed_network_name = CONF.compute.fixed_network_name
- if 'nics' not in create_kwargs and fixed_network_name:
- _, networks = self.networks_client.list_networks()
- # If several networks found, set the NetID on which to connect the
- # server to avoid the following error "Multiple possible networks
- # found, use a Network ID to be more specific."
- # See Tempest #1250866
- if len(networks) > 1:
- for network in networks:
- if network['label'] == fixed_network_name:
- create_kwargs['nics'] = [{'net-id': network['id']}]
- break
- # If we didn't find the network we were looking for :
- else:
- msg = ("The network on which the NIC of the server must "
- "be connected can not be found : "
- "fixed_network_name=%s. Starting instance without "
- "specifying a network.") % fixed_network_name
- LOG.info(msg)
-
LOG.debug("Creating a server (name: %s, image: %s, flavor: %s)",
name, image, flavor)
_, server = self.servers_client.create_server(name, image, flavor,
diff --git a/tempest/scenario/test_network_advanced_server_ops.py b/tempest/scenario/test_network_advanced_server_ops.py
index c145551..84e1048 100644
--- a/tempest/scenario/test_network_advanced_server_ops.py
+++ b/tempest/scenario/test_network_advanced_server_ops.py
@@ -61,8 +61,8 @@
network, subnet, router = self.create_networks()
public_network_id = CONF.network.public_network_id
create_kwargs = {
- 'nics': [
- {'net-id': network.id},
+ 'networks': [
+ {'uuid': network.id},
],
'key_name': self.keypair['name'],
'security_groups': [security_group],
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index e8dba6a..10dfb66 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -147,8 +147,8 @@
self.keypairs[keypair['name']] = keypair
security_groups = [self.security_group]
create_kwargs = {
- 'nics': [
- {'net-id': network.id},
+ 'networks': [
+ {'uuid': network.id},
],
'key_name': keypair['name'],
'security_groups': security_groups,
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index 520c232..20505eb 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -234,8 +234,8 @@
if security_groups is None:
security_groups = [tenant.security_groups['default']]
create_kwargs = {
- 'nics': [
- {'net-id': tenant.network.id},
+ 'networks': [
+ {'uuid': tenant.network.id},
],
'key_name': tenant.keypair['name'],
'security_groups': security_groups,