From 0af26bbba27b8bd15422032e6c1447fb7df1daf0 Mon Sep 17 00:00:00 2001 From: Valeriy Ponomaryov Date: Thu, 5 Nov 2015 13:22:44 +0200 Subject: [PATCH] Sync Manila Tempest plugin with latest Tempest Two reasons to do it: 1) Broken compatibility of old Tempest we use with latest dependencies. 2) Manila Tempest plugin is incompatible with latest Tempest. Change-Id: Iae5a656b72e774d9d62b52d7ffb63edecbb23ca6 Closes-Bug: #1513105 --- contrib/ci/pre_test_hook.sh | 2 +- manila_tempest_tests/tests/api/base.py | 31 ++++++++++++++++---------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/contrib/ci/pre_test_hook.sh b/contrib/ci/pre_test_hook.sh index a1ba34ff24..43b4f8979e 100755 --- a/contrib/ci/pre_test_hook.sh +++ b/contrib/ci/pre_test_hook.sh @@ -59,7 +59,7 @@ echo 'ENABLE_ISOLATED_METADATA=True' >> $localrc_path # Go to Tempest dir and checkout stable commit to avoid possible # incompatibilities for plugin stored in Manila repo. -TEMPEST_COMMIT="3b1bb9be3265f" # 28 Aug, 2015 +TEMPEST_COMMIT="c43c8f91" # 05 Nov, 2015 cd $BASE/new/tempest git checkout $TEMPEST_COMMIT diff --git a/manila_tempest_tests/tests/api/base.py b/manila_tempest_tests/tests/api/base.py index 7beb289dc7..b2da08047c 100644 --- a/manila_tempest_tests/tests/api/base.py +++ b/manila_tempest_tests/tests/api/base.py @@ -21,9 +21,9 @@ import traceback from oslo_concurrency import lockutils from oslo_log import log import six -from tempest.common import isolated_creds # noqa -from tempest import config # noqa -from tempest import test # noqa +from tempest.common import dynamic_creds +from tempest import config +from tempest import test from tempest_lib.common.utils import data_utils from tempest_lib import exceptions @@ -129,7 +129,10 @@ class BaseSharesTest(test.BaseTestCase): name = name[0:32] # Choose type of isolated creds - ic = isolated_creds.IsolatedCreds(name=name) + ic = dynamic_creds.DynamicCredentialProvider( + identity_version=CONF.identity.auth_version, + name=name, + admin_role=CONF.identity.admin_role) if "admin" in type_of_creds: creds = ic.get_admin_creds() elif "alt" in type_of_creds: @@ -147,7 +150,7 @@ class BaseSharesTest(test.BaseTestCase): # Set place where will be deleted isolated creds ic_res = { - "method": ic.clear_isolated_creds, + "method": ic.clear_creds, "deleted": False, } if cleanup_in_class: @@ -159,7 +162,7 @@ class BaseSharesTest(test.BaseTestCase): if CONF.share.multitenancy_enabled: if not CONF.service_available.neutron: raise cls.skipException("Neutron support is required") - nc = os.network_client + nc = os.networks_client share_network_id = cls.provide_share_network(client, nc, ic) client.share_network_id = share_network_id resource = { @@ -197,7 +200,7 @@ class BaseSharesTest(test.BaseTestCase): if not CONF.service_available.neutron: raise cls.skipException("Neutron support is required") sc = cls.os.shares_client - nc = cls.os.network_client + nc = cls.os.networks_client share_network_id = cls.provide_share_network(sc, nc) cls.os.shares_client.share_network_id = share_network_id cls.os.shares_v2_client.share_network_id = share_network_id @@ -217,7 +220,7 @@ class BaseSharesTest(test.BaseTestCase): @classmethod @network_synchronized - def provide_share_network(cls, shares_client, network_client, + def provide_share_network(cls, shares_client, networks_client, isolated_creds_client=None): """Used for finding/creating share network for multitenant driver. @@ -225,8 +228,8 @@ class BaseSharesTest(test.BaseTestCase): share-network will be used for creation of service vm. :param shares_client: shares client, which requires share-network - :param network_client: network client from same tenant as shares - :param isolated_creds_client: IsolatedCreds instance + :param networks_client: network client from same tenant as shares + :param isolated_creds_client: DynamicCredentialProvider instance If provided, then its networking will be used if needed. If not provided, then common network will be used if needed. :returns: str -- share network id for shares_client tenant @@ -249,7 +252,7 @@ class BaseSharesTest(test.BaseTestCase): search_word = "reusable" sn_name = "autogenerated_by_tempest_%s" % search_word service_net_name = "share-service" - networks = network_client.list_networks() + networks = networks_client.list_networks() if "networks" in networks.keys(): networks = networks["networks"] for network in networks: @@ -262,7 +265,11 @@ class BaseSharesTest(test.BaseTestCase): # Create suitable network if (net_id is None or subnet_id is None): - ic = isolated_creds.IsolatedCreds(name=service_net_name) + ic = dynamic_creds.DynamicCredentialProvider( + identity_version=CONF.identity.auth_version, + name=service_net_name, + admin_role=CONF.identity.admin_role, + ) net_data = ic._create_network_resources(sc.tenant_id) network, subnet, router = net_data net_id = network["id"]