Merge "Handle invalid configuration for vif test execution"
diff --git a/ironic_tempest_plugin/tests/api/admin/test_nodes.py b/ironic_tempest_plugin/tests/api/admin/test_nodes.py
index a5c52ce..6d63768 100644
--- a/ironic_tempest_plugin/tests/api/admin/test_nodes.py
+++ b/ironic_tempest_plugin/tests/api/admin/test_nodes.py
@@ -410,12 +410,12 @@
def setUp(self):
super(TestNodesVif, self).setUp()
- _, self.chassis = self.create_chassis()
- # The tests will mostly fail in this class if exposed to the
- # noop network interface, which is what the default is.
- _, self.node = self.create_node(self.chassis['uuid'],
- network_interface='flat')
if CONF.network.shared_physical_network:
+ if not CONF.compute.fixed_network_name:
+ raise self.skipException(
+ 'Unable to perform vif test as there is no network '
+ 'defined for the [compute]fixed_network_name '
+ 'parameter.')
self.net = self.os_admin.networks_client.list_networks(
name=CONF.compute.fixed_network_name)['networks'][0]
else:
@@ -424,6 +424,12 @@
self.addCleanup(self.os_admin.networks_client.delete_network,
self.net['id'])
+ _, self.chassis = self.create_chassis()
+ # The tests will mostly fail in this class if exposed to the
+ # noop network interface, which is what the default is.
+ _, self.node = self.create_node(self.chassis['uuid'],
+ network_interface='flat')
+
self.nport_id = self.os_admin.ports_client.create_port(
network_id=self.net['id'])['port']['id']
self.addCleanup(self.os_admin.ports_client.delete_port,