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
This commit is contained in:
Valeriy Ponomaryov 2015-11-05 13:22:44 +02:00
parent 38ce52fc4a
commit 0af26bbba2
2 changed files with 20 additions and 13 deletions

View File

@ -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

View File

@ -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"]