Fix potential issue with adding a fixed ip
In test_add_remove_fixed_ip there is a potential issue where the user
running the test does not have the ability to create a server with a
fixed ip. As pointed out by zhufl (in review of change
I10a34fb12b595400fc15d935070f130c8e3d3963) This commit fixes the issue
so that we properly skip if tempest is not configured in a way where it
can create a server with the fixed ip.
Change-Id: Idcd66ac87cf156bc5c2b38178262c4686238bcd4
diff --git a/tempest/api/compute/servers/test_attach_interfaces.py b/tempest/api/compute/servers/test_attach_interfaces.py
index bea23d9..eeb58d6 100644
--- a/tempest/api/compute/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/servers/test_attach_interfaces.py
@@ -331,6 +331,16 @@
@decorators.idempotent_id('c7e0e60b-ee45-43d0-abeb-8596fd42a2f9')
@utils.services('network')
def test_add_remove_fixed_ip(self):
+ # NOTE(zhufl) By default only project that is admin or network owner
+ # or project with role advsvc is authorised to add interfaces with
+ # fixed-ip, so if we don't create network for each project, do not
+ # test
+ if not (CONF.auth.use_dynamic_credentials and
+ CONF.auth.create_isolated_networks and
+ not CONF.network.shared_physical_network):
+ raise self.skipException("Only owner network supports "
+ "creating interface by fixed ip.")
+
# Add and Remove the fixed IP to server.
server, ifs = self._create_server_get_interfaces()
original_interface_count = len(ifs) # This is the number of ports.