Fix fixed_network bug 1439634 - ipsec issue
fixed_networks only verified if tenant isolation is enabled
that does not account for the case of force tenant isolation,
where an isolated tenant will be available regardless of the
tenant isolation default setting.
Closes-bug: #1439634
Change-Id: Id1743ac18b6b52a3ee6bb533a7a348432ce1f466
diff --git a/tempest/common/fixed_network.py b/tempest/common/fixed_network.py
index b06ddf2..b533898 100644
--- a/tempest/common/fixed_network.py
+++ b/tempest/common/fixed_network.py
@@ -15,6 +15,7 @@
from tempest_lib import exceptions as lib_exc
+from tempest.common import isolated_creds
from tempest import config
from tempest import exceptions
@@ -38,7 +39,7 @@
network = None
# NOTE(andreaf) get_primary_network will always be available once
# bp test-accounts-continued is implemented
- if (CONF.auth.allow_tenant_isolation and
+ if (isinstance(creds_provider, isolated_creds.IsolatedCreds) and
(CONF.service_available.neutron and
not CONF.service_available.ironic)):
network = creds_provider.get_primary_network()
diff --git a/tempest/test.py b/tempest/test.py
index da936b4..2585999 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -445,7 +445,12 @@
# Make sure isolated_creds exists and get a network client
networks_client = cls.get_client_manager().networks_client
isolated_creds = getattr(cls, 'isolated_creds', None)
- if credentials.is_admin_available():
+ # In case of nova network, isolated tenants are not able to list the
+ # network configured in fixed_network_name, even if the can use it
+ # for their servers, so using an admin network client to validate
+ # the network name
+ if (not CONF.service_available.neutron and
+ credentials.is_admin_available()):
admin_creds = isolated_creds.get_admin_creds()
networks_client = clients.Manager(admin_creds).networks_client
return fixed_network.get_tenant_network(isolated_creds,