Updated dynamic credential support for funtional test.

Now devstack does not setup the deprecated configured cred on Tempest
which is being used here. - https://review.openstack.org/#/c/256164/

get_configured_credential use the deprecated cred and these tests use
that for initiating Manager.

Change-Id: I89713806cb98abaca29b24de585a77f75602bcd7
Closes-bug: #1531049
This commit is contained in:
hparekh 2016-01-05 15:57:32 +09:00 committed by hardik
parent 3dbf5791d7
commit 2e133aa556
1 changed files with 6 additions and 10 deletions

View File

@ -20,7 +20,6 @@ import mock
import six
from tempest import clients
from tempest.common import credentials_factory as creds
from tempest import config
from tempest import test as test
from tempest_lib import auth
@ -244,6 +243,9 @@ class AuthProv(auth.KeystoneV2AuthProvider):
class TestCase(test.BaseTestCase):
credentials = ['primary', 'alt']
@classmethod
def resource_setup(cls):
"""Client authentication.
@ -256,16 +258,10 @@ class TestCase(test.BaseTestCase):
if 'WITHOUT_AUTH' in os.environ:
cls.mgr = mock.MagicMock()
cls.mgr.auth_provider = AuthProv()
cls.alt_mgr = cls.mgr
else:
cls.creds = creds.get_configured_credentials(
credential_type='user'
)
cls.mgr = clients.Manager(cls.creds)
cls.alt_creds = creds.get_configured_credentials(
credential_type='alt_user'
)
cls.alt_mgr = clients.Manager(cls.alt_creds)
cls.mgr = cls.manager
cls.alt_mgr = cls.alt_manager
if cls._service == 'workflowv2':
cls.client = MistralClientV2(