Add skip logic for admin cred in test_auto_allocate_network
In case tests are being run with pre provisioned account and
admin cred are not defined then auto allocate network tests
which needs admin cred for tenant isolation should be skipped
instead of fail.
Those tests are not derived from admin base class(which is valid)
so we need to explicitly have the skip logic based on availability
of admin cred.
Change-Id: I3f0472665d7645986ee101390c8e406668a1567b
diff --git a/tempest/api/compute/admin/test_auto_allocate_network.py b/tempest/api/compute/admin/test_auto_allocate_network.py
index 052c17d..ee8ed14 100644
--- a/tempest/api/compute/admin/test_auto_allocate_network.py
+++ b/tempest/api/compute/admin/test_auto_allocate_network.py
@@ -16,6 +16,7 @@
from tempest.api.compute import base
from tempest.common import compute
+from tempest.common import credentials_factory as credentials
from tempest.common import waiters
from tempest import config
from tempest import exceptions
@@ -45,6 +46,11 @@
@classmethod
def skip_checks(cls):
super(AutoAllocateNetworkTest, cls).skip_checks()
+ identity_version = cls.get_identity_version()
+ if not credentials.is_admin_available(
+ identity_version=identity_version):
+ msg = "Missing Identity Admin API credentials in configuration."
+ raise cls.skipException(msg)
if not CONF.service_available.neutron:
raise cls.skipException('Neutron is required')
if not test.is_extension_enabled('auto-allocated-topology', 'network'):