Properly handle authentication with Keystone v3

Address few previously unnoticed use cases.
- Use uri_v3 is available (in the Tempest plugin). When v2
  is not available (as in modern deployments) the old value
  cannot be relied upon.
- Otherwise just check whether v3 is there and adds it if not
  (as it happens for example on a TripleO deployment).

Change-Id: I593faafbe6b4c547db687d4f521e2a0b412d343a
This commit is contained in:
Luigi Toscano 2019-06-04 16:42:45 +02:00
parent 4c1d1645de
commit 1c8cb702c5
3 changed files with 11 additions and 3 deletions

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Properly handle more use cases when only Keystone v3 is enabled and/or
its service URI is missing the /v3 suffix.

View File

@ -46,11 +46,11 @@ class BaseDataProcessingTest(tempest.test.BaseTestCase):
endpoint_type = TEMPEST_CONF.data_processing.endpoint_type
catalog_type = TEMPEST_CONF.data_processing.catalog_type
auth_url = TEMPEST_CONF.identity.uri
auth_url = TEMPEST_CONF.identity.uri_v3
credentials = cls.os_admin.credentials
auth = v3.Password(auth_url=auth_url.replace('/v2.0', '/v3'),
auth = v3.Password(auth_url=auth_url,
username=credentials.username,
password=credentials.password,
project_name=credentials.tenant_name,

View File

@ -39,7 +39,10 @@ from sahara_tests.scenario import utils
def get_session(auth_url=None, username=None, password=None,
project_name=None, verify=True, cert=None):
auth = identity_v3.Password(auth_url=auth_url.replace('/v2.0', '/v3'),
auth_url_fixed = auth_url.replace('/v2.0', '/v3')
if not auth_url_fixed.endswith('/v3'):
auth_url_fixed += '/v3'
auth = identity_v3.Password(auth_url=auth_url_fixed,
username=username,
password=password,
project_name=project_name,