From 07fb60155f23c57927264bf49ef26dbba9cfcf5f Mon Sep 17 00:00:00 2001 From: Raissa Sarmento Date: Fri, 21 Jul 2017 14:32:48 +0100 Subject: [PATCH] Update location of dynamic creds in tempest tests Tempest is migrating their dynamic credentials interface to tempest lib as part of the effort to create stable interfaces. [0] We will need to update its location in our code to conform with it. [0] http://lists.openstack.org/pipermail/openstack-dev/2017-July/119934.html Depends-On: Id8d60e4d7c22bc72c3e48bc768509ff0cc0c89d5 Change-Id: Iaa6bf908ff5d63cbbfddc7060594818c66ce607c --- contrib/ci/common.sh | 2 +- manila_tempest_tests/tests/api/base.py | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/contrib/ci/common.sh b/contrib/ci/common.sh index 54e5421636..1c98b73343 100755 --- a/contrib/ci/common.sh +++ b/contrib/ci/common.sh @@ -1,6 +1,6 @@ # Environment variables -export MANILA_TEMPEST_COMMIT="827493a" # 7 June, 2017 +export MANILA_TEMPEST_COMMIT="30bbd2d" # 24 July, 2017 # ---------------------------------------------- # Functions diff --git a/manila_tempest_tests/tests/api/base.py b/manila_tempest_tests/tests/api/base.py index 764a8529a9..65f1b30546 100644 --- a/manila_tempest_tests/tests/api/base.py +++ b/manila_tempest_tests/tests/api/base.py @@ -23,8 +23,9 @@ from oslo_log import log import six from tempest import clients from tempest.common import credentials_factory as common_creds -from tempest.common import dynamic_creds + from tempest import config +from tempest.lib.common import dynamic_creds from tempest.lib.common.utils import data_utils from tempest.lib import exceptions from tempest import test @@ -151,8 +152,16 @@ class BaseSharesTest(test.BaseTestCase): @classmethod def _get_dynamic_creds(cls, name, network_resources=None): + identity_version = CONF.identity.auth_version + if identity_version == 'v3': + identity_uri = CONF.identity.uri_v3 + identity_admin_endpoint_type = CONF.identity.v3_endpoint_type + elif identity_version == 'v2': + identity_uri = CONF.identity.uri + identity_admin_endpoint_type = CONF.identity.v2_admin_endpoint_type + return dynamic_creds.DynamicCredentialProvider( - identity_version=CONF.identity.auth_version, + identity_version=identity_version, name=name, network_resources=network_resources, credentials_domain=CONF.auth.default_credentials_domain_name, @@ -167,7 +176,9 @@ class BaseSharesTest(test.BaseTestCase): project_network_cidr=CONF.network.project_network_cidr, project_network_mask_bits=CONF.network.project_network_mask_bits, public_network_id=CONF.network.public_network_id, - resource_prefix=CONF.resources_prefix) + resource_prefix=CONF.resources_prefix, + identity_admin_endpoint_type=identity_admin_endpoint_type, + identity_uri=identity_uri) @classmethod def get_client_with_isolated_creds(cls,