本文整理匯總了Python中tempest.clients.Manager方法的典型用法代碼示例。如果您正苦於以下問題:Python clients.Manager方法的具體用法?Python clients.Manager怎麽用?Python clients.Manager使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tempest.clients
的用法示例。
在下文中一共展示了clients.Manager方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def __init__(self,
credentials=None):
"""Initialization of Manager class.
Setup service client and make it available for test cases.
:param credentials: type Credentials or TestResources
"""
if credentials is None:
global ADMIN_CREDS
if ADMIN_CREDS is None:
ADMIN_CREDS = common_creds.get_configured_admin_credentials()
credentials = ADMIN_CREDS
super(Manager, self).__init__(credentials)
default_params_with_timeout_values = {
'build_interval': CONF.compute.build_interval,
'build_timeout': CONF.compute.build_timeout
}
default_params_with_timeout_values.update(self.default_params)
self.baremetal_client = BaremetalClient(
self.auth_provider,
CONF.baremetal.catalog_type,
CONF.identity.region,
endpoint_type=CONF.baremetal.endpoint_type,
**default_params_with_timeout_values)
示例2: validate_service
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def validate_service(cls, service):
"""Validate whether the service passed to ``__init__`` exists."""
service = service.lower().strip() if service else None
# Cache the list of available services in memory to avoid needlessly
# doing an API call every time.
if not hasattr(cls, 'available_services'):
admin_mgr = clients.Manager(
credentials.get_configured_admin_credentials())
services_client = (admin_mgr.identity_services_v3_client
if CONF.identity_feature_enabled.api_v3
else admin_mgr.identity_services_client)
services = services_client.list_services()['services']
cls.available_services = [s['name'] for s in services]
if not service or service not in cls.available_services:
LOG.debug("%s is NOT a valid service.", service)
raise rbac_exceptions.RbacInvalidService(
"%s is NOT a valid service." % service)
示例3: setUpClass
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def setUpClass(cls):
# Create no network resources for these test.
cls.set_network_resources()
super(BaseNetworkTest, cls).setUpClass()
os = clients.Manager(interface=cls._interface)
if not CONF.service_available.neutron:
raise cls.skipException("Neutron support is required")
cls.client = os.network_client
cls.networks = []
cls.subnets = []
cls.ports = []
cls.routers = []
cls.pools = []
cls.vips = []
cls.members = []
cls.health_monitors = []
cls.vpnservices = []
cls.ikepolicies = []
cls.floating_ips = []
示例4: setUpClass
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def setUpClass(cls):
super(BaseVolumeV1AdminTest, cls).setUpClass()
cls.adm_user = CONF.identity.admin_username
cls.adm_pass = CONF.identity.admin_password
cls.adm_tenant = CONF.identity.admin_tenant_name
if not all((cls.adm_user, cls.adm_pass, cls.adm_tenant)):
msg = ("Missing Volume Admin API credentials "
"in configuration.")
raise cls.skipException(msg)
if CONF.compute.allow_tenant_isolation:
creds = cls.isolated_creds.get_admin_creds()
admin_username, admin_tenant_name, admin_password = creds
cls.os_adm = clients.Manager(username=admin_username,
password=admin_password,
tenant_name=admin_tenant_name,
interface=cls._interface)
else:
cls.os_adm = clients.AdminManager(interface=cls._interface)
cls.client = cls.os_adm.volume_types_client
cls.hosts_client = cls.os_adm.volume_hosts_client
示例5: setUpClass
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def setUpClass(cls):
super(CrossdomainTest, cls).setUpClass()
# creates a test user. The test user will set its base_url to the Swift
# endpoint and test the healthcheck feature.
cls.data.setup_test_user()
cls.os_test_user = clients.Manager(
cls.data.test_user,
cls.data.test_password,
cls.data.test_tenant)
cls.xml_start = '<?xml version="1.0"?>\n' \
'<!DOCTYPE cross-domain-policy SYSTEM ' \
'"http://www.adobe.com/xml/dtds/cross-domain-policy.' \
'dtd" >\n<cross-domain-policy>\n'
cls.xml_end = "</cross-domain-policy>"
示例6: setUpClass
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def setUpClass(cls):
super(BaseV2ComputeAdminTest, cls).setUpClass()
admin_username = CONF.compute_admin.username
admin_password = CONF.compute_admin.password
admin_tenant = CONF.compute_admin.tenant_name
if not (admin_username and admin_password and admin_tenant):
msg = ("Missing Compute Admin API credentials "
"in configuration.")
raise cls.skipException(msg)
if (CONF.compute.allow_tenant_isolation or
cls.force_tenant_isolation is True):
creds = cls.isolated_creds.get_admin_creds()
admin_username, admin_tenant_name, admin_password = creds
cls.os_adm = clients.Manager(username=admin_username,
password=admin_password,
tenant_name=admin_tenant_name,
interface=cls._interface)
else:
cls.os_adm = clients.ComputeAdminManager(interface=cls._interface)
示例7: setUpClass
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def setUpClass(cls):
super(ImagesTestJSON, cls).setUpClass()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
cls.client = cls.images_client
cls.servers_client = cls.servers_client
cls.image_ids = []
if cls.multi_user:
if CONF.compute.allow_tenant_isolation:
creds = cls.isolated_creds.get_alt_creds()
username, tenant_name, password = creds
cls.alt_manager = clients.Manager(username=username,
password=password,
tenant_name=tenant_name)
else:
# Use the alt_XXX credentials in the config file
cls.alt_manager = clients.AltManager()
cls.alt_client = cls.alt_manager.images_client
示例8: setUpClass
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def setUpClass(cls):
cls.set_network_resources()
super(BaseImageTest, cls).setUpClass()
cls.created_images = []
cls._interface = 'json'
cls.isolated_creds = isolated_creds.IsolatedCreds(
cls.__name__, network_resources=cls.network_resources)
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
if CONF.compute.allow_tenant_isolation:
creds = cls.isolated_creds.get_primary_creds()
username, tenant_name, password = creds
cls.os = clients.Manager(username=username,
password=password,
tenant_name=tenant_name)
else:
cls.os = clients.Manager()
示例9: __init__
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def __init__(self, credentials):
super(Manager, self).__init__(credentials)
self.auth_client = auth_client.AuthClient(self.auth_provider)
self.identity_providers_client = (
identity_providers_client.IdentityProvidersClient(
self.auth_provider))
self.mapping_rules_client = (
mapping_rules_client.MappingRulesClient(
self.auth_provider))
self.saml2_client = saml2_client.Saml2Client()
self.service_providers_client = (
service_providers_client.ServiceProvidersClient(
self.auth_provider))
示例10: __init__
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def __init__(self,
credentials=ADMIN_CREDS,
api_microversions=None):
super(Manager, self).__init__(credentials)
self.introspection_client = BaremetalIntrospectionClient(
self.auth_provider,
CONF.baremetal_introspection.catalog_type,
CONF.identity.region,
endpoint_type=CONF.baremetal_introspection.endpoint_type)
示例11: __init__
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def __init__(self, credentials=None):
super(Manager, self).__init__(credentials)
self.freezer_api_client = freezer_api_client.FreezerApiClient(
self.auth_provider)
示例12: setUp
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def setUp(self):
super(RbacUtilsFixture, self).setUp()
self.useFixture(ConfPatcher(rbac_test_role='member', group='patrole'))
self.useFixture(ConfPatcher(
admin_role='admin', auth_version='v3', group='identity'))
test_obj_kwargs = {
'os_primary.credentials.user_id': self.USER_ID,
'os_primary.credentials.tenant_id': self.PROJECT_ID,
'os_primary.credentials.project_id': self.PROJECT_ID,
'get_identity_version.return_value': 'v3'
}
self.mock_test_obj = mock.Mock(
__name__='patrole_unit_test', spec=test.BaseTestCase,
os_primary=mock.Mock(), **test_obj_kwargs)
# Mock out functionality that can't be used by unit tests. Mocking out
# time.sleep is a test optimization.
self.mock_time = mock.patch.object(
rbac_utils, 'time', __name__='mock_time', spec=time).start()
mock.patch.object(credentials, 'get_configured_admin_credentials',
spec=object).start()
mock_admin_mgr = mock.patch.object(
clients, 'Manager', spec=clients.Manager,
roles_v3_client=mock.Mock(), roles_client=mock.Mock()).start()
self.roles_v3_client = mock_admin_mgr.return_value.roles_v3_client
self.set_roles(['admin', 'member'], [])
示例13: __init__
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def __init__(self, test_obj):
"""Constructor for ``RbacUtils``.
:param test_obj: An instance of `tempest.test.BaseTestCase`.
"""
# Intialize the admin roles_client to perform role switching.
admin_mgr = clients.Manager(
credentials.get_configured_admin_credentials())
if test_obj.get_identity_version() == 'v3':
admin_roles_client = admin_mgr.roles_v3_client
else:
admin_roles_client = admin_mgr.roles_client
self.admin_roles_client = admin_roles_client
self._override_role(test_obj, False)
示例14: _set_telemetry_clients
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def _set_telemetry_clients(self):
self.telemetry_client = telemetry_client.TelemetryClient(
self.auth_provider, **telemetry_client.Manager.telemetry_params)
示例15: __init__
# 需要導入模塊: from tempest import clients [as 別名]
# 或者: from tempest.clients import Manager [as 別名]
def __init__(self, credentials=None):
if credentials is None:
global ADMIN_CREDS
if ADMIN_CREDS is None:
ADMIN_CREDS = common_creds.get_configured_admin_credentials()
credentials = ADMIN_CREDS
super(Manager, self).__init__(credentials)
self.artifacts_client = artifacts_client.ArtifactsClient(
self.auth_provider)