Prevent failures when running as non-admin
In some cases a skip method was needed to check for non-admin. In other cases
there was already a try/except to handle on-admin but it needed to be changed
to use is_admin_available. NegativeAutoTest was changed to push creation of
an admin client to the point where the need has been established.
Also fixed some skip_checks methods to call super first.
Change-Id: Ie58135285a4c95c2eed9c0462c4e76af3ad5d97e
diff --git a/tempest/test.py b/tempest/test.py
index da936b4..4451610 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -467,8 +467,6 @@
super(NegativeAutoTest, cls).setUpClass()
os = cls.get_client_manager()
cls.client = os.negative_client
- os_admin = clients.AdminManager(service=cls._service)
- cls.admin_client = os_admin.negative_client
@staticmethod
def load_tests(*args):
@@ -596,7 +594,13 @@
"mechanism")
if "admin_client" in description and description["admin_client"]:
- client = self.admin_client
+ if not credentials.is_admin_available():
+ msg = ("Missing Identity Admin API credentials in"
+ "configuration.")
+ raise self.skipException(msg)
+ creds = self.isolated_creds.get_admin_creds()
+ os_adm = clients.Manager(credentials=creds)
+ client = os_adm.negative_client
else:
client = self.client
resp, resp_body = client.send_request(method, new_url,