Handle invalid configuration for vif test execution

It is entirely possible to run the tempest tests without a physical
network parameter for the compute service. Turns out the network is
required when you use [network]shared_physical_network set to true,
because without it we can't figure out how to attach to the network.

So now we skip when the input configuration is such that there is
no way for the tests to proceed.

Closes-Bug: 2065378
Change-Id: Ic448a1a6383c2da2567b9da2262d4572536296ed
diff --git a/ironic_tempest_plugin/tests/api/admin/test_nodes.py b/ironic_tempest_plugin/tests/api/admin/test_nodes.py
index 0652e2e..c78d411 100644
--- a/ironic_tempest_plugin/tests/api/admin/test_nodes.py
+++ b/ironic_tempest_plugin/tests/api/admin/test_nodes.py
@@ -311,12 +311,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:
@@ -325,6 +325,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,