Migrate the dynamic creds module to tempest lib
This commit migrates the dynamic credentials provider from tempest/common into tempest/lib. Change-Id: Id8d60e4d7c22bc72c3e48bc768509ff0cc0c89d5
This commit is contained in:
parent
e1e6e7825d
commit
c51b712dec
@ -68,3 +68,4 @@ Current Library APIs
|
||||
library/api_microversion_testing
|
||||
library/auth
|
||||
library/clients
|
||||
library/credential_providers
|
||||
|
16
doc/source/library/credential_providers.rst
Normal file
16
doc/source/library/credential_providers.rst
Normal file
@ -0,0 +1,16 @@
|
||||
.. _cred_providers:
|
||||
|
||||
Credential Providers
|
||||
====================
|
||||
|
||||
These library interfaces are used to deal with allocating credentials on demand
|
||||
either dynamically by calling keystone to allocate new credentials, or from
|
||||
a list of preprovisioned credentials.
|
||||
|
||||
|
||||
------------------------------
|
||||
The dynamic credentials module
|
||||
------------------------------
|
||||
|
||||
.. automodule:: tempest.lib.common.dynamic_creds
|
||||
:members:
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The tempest module tempest.common.dynamic creds which is used for
|
||||
dynamically allocating credentials has been migrated into tempest lib.
|
@ -102,8 +102,8 @@ from oslo_log import log as logging
|
||||
import yaml
|
||||
|
||||
from tempest.common import credentials_factory
|
||||
from tempest.common import dynamic_creds
|
||||
from tempest import config
|
||||
from tempest.lib.common import dynamic_creds
|
||||
|
||||
|
||||
LOG = None
|
||||
|
@ -14,10 +14,10 @@
|
||||
from oslo_concurrency import lockutils
|
||||
|
||||
from tempest import clients
|
||||
from tempest.common import dynamic_creds
|
||||
from tempest.common import preprov_creds
|
||||
from tempest import config
|
||||
from tempest.lib import auth
|
||||
from tempest.lib.common import dynamic_creds
|
||||
from tempest.lib import exceptions
|
||||
|
||||
CONF = config.CONF
|
||||
|
@ -140,7 +140,8 @@ class TestGenerateResourcesV2(base.TestCase, MockHelpersMixin):
|
||||
|
||||
identity_version = 2
|
||||
cred_client = 'tempest.lib.common.cred_client.V2CredsClient'
|
||||
dynamic_creds = 'tempest.common.dynamic_creds.DynamicCredentialProvider'
|
||||
dynamic_creds = ('tempest.lib.common.dynamic_creds.'
|
||||
'DynamicCredentialProvider')
|
||||
|
||||
def setUp(self):
|
||||
super(TestGenerateResourcesV2, self).setUp()
|
||||
@ -245,7 +246,8 @@ class TestDumpAccountsV2(base.TestCase, MockHelpersMixin):
|
||||
|
||||
identity_version = 2
|
||||
cred_client = 'tempest.lib.common.cred_client.V2CredsClient'
|
||||
dynamic_creds = 'tempest.common.dynamic_creds.DynamicCredentialProvider'
|
||||
dynamic_creds = ('tempest.lib.common.dynamic_creds.'
|
||||
'DynamicCredentialProvider')
|
||||
domain_is_in = False
|
||||
|
||||
def setUp(self):
|
||||
|
@ -17,8 +17,8 @@ import mock
|
||||
from oslo_config import cfg
|
||||
|
||||
from tempest.common import credentials_factory as credentials
|
||||
from tempest.common import dynamic_creds
|
||||
from tempest import config
|
||||
from tempest.lib.common import dynamic_creds
|
||||
from tempest.lib.common import rest_client
|
||||
from tempest.lib import exceptions as lib_exc
|
||||
from tempest.lib.services.identity.v2 import identity_client as v2_iden_client
|
||||
@ -659,7 +659,7 @@ class TestDynamicCredentialProviderV3(TestDynamicCredentialProvider):
|
||||
creds = dynamic_creds.DynamicCredentialProvider(**self.fixed_params)
|
||||
creds.creds_client = mock.MagicMock()
|
||||
creds.creds_client.create_user_role.side_effect = lib_exc.Conflict
|
||||
with mock.patch('tempest.common.dynamic_creds.LOG') as log_mock:
|
||||
with mock.patch('tempest.lib.common.dynamic_creds.LOG') as log_mock:
|
||||
creds._create_creds()
|
||||
log_mock.warning.assert_called_once_with(
|
||||
"Member role already exists, ignoring conflict.")
|
Loading…
Reference in New Issue
Block a user