diff options
author | Cedric Ollivier <cedric.ollivier@orange.com> | 2017-12-21 08:45:29 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-12-21 08:45:29 +0000 |
commit | 582de12734688e080fd421c46780ae9ea380b27b (patch) | |
tree | 02db804f4c9d68d04b4eeba6503d860a6e1b4558 /functest/ci | |
parent | f09e17ef9b94d3cdb0b28340e08ce7966c500140 (diff) | |
parent | 81aa529403bedffb26f34994e3ee34a4516cee00 (diff) |
Merge "Get auth token when checking deployment"
Diffstat (limited to 'functest/ci')
-rw-r--r-- | functest/ci/check_deployment.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/functest/ci/check_deployment.py b/functest/ci/check_deployment.py index ffea6beb..9453c6d4 100644 --- a/functest/ci/check_deployment.py +++ b/functest/ci/check_deployment.py @@ -52,6 +52,16 @@ def verify_connectivity(endpoint): return False +def get_auth_token(os_creds): + """ Get auth token """ + sess = keystone_utils.keystone_session(os_creds) + try: + return sess.get_token() + except Exception as error: + LOGGER.error("Got token ...FAILED") + raise error + + class CheckDeployment(object): """ Check deployment class.""" @@ -69,12 +79,15 @@ class CheckDeployment(object): format(self.rc_file)) def check_auth_endpoint(self): - """ Verifies connectivity to the OS_AUTH_URL given in the RC file """ + """ Verifies connectivity to the OS_AUTH_URL given in the RC file + and get auth token""" rc_endpoint = self.os_creds.auth_url if not verify_connectivity(rc_endpoint): raise Exception("OS_AUTH_URL {} is not reachable.". format(rc_endpoint)) LOGGER.info("Connectivity to OS_AUTH_URL %s ...OK", rc_endpoint) + if get_auth_token(self.os_creds): + LOGGER.info("Got token ...OK") def check_public_endpoint(self): """ Gets the public endpoint and verifies connectivity to it """ |