Rodrigo Duarte | 4666c64 | 2016-04-06 11:52:19 -0300 | [diff] [blame] | 1 | # Copyright 2016 Red Hat, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
| 15 | from tempest.common import credentials_factory as common_creds |
| 16 | from tempest import test |
| 17 | |
| 18 | from keystone_tempest_plugin import clients |
| 19 | |
| 20 | |
| 21 | class BaseIdentityTest(test.BaseTestCase): |
| 22 | |
| 23 | # The version of the identity that will be used in the tests. |
| 24 | identity_version = 'v3' |
| 25 | |
| 26 | # NOTE(rodrigods): for now, all tests are in the admin scope, if |
| 27 | # necessary, another class can be created to handle non-admin tests. |
| 28 | credential_type = 'identity_admin' |
| 29 | |
| 30 | @classmethod |
| 31 | def setup_clients(cls): |
| 32 | super(BaseIdentityTest, cls).setup_clients() |
Rodrigo Duarte | 8192f6c | 2016-05-31 10:11:27 -0300 | [diff] [blame] | 33 | credentials = common_creds.get_configured_admin_credentials( |
Rodrigo Duarte | 4666c64 | 2016-04-06 11:52:19 -0300 | [diff] [blame] | 34 | cls.credential_type, identity_version=cls.identity_version) |
Rodrigo Duarte | 3b0cd80 | 2017-01-05 13:06:29 -0300 | [diff] [blame] | 35 | cls.keystone_manager = clients.Manager(credentials) |
Rodrigo Duarte | e508fe0 | 2016-06-02 16:08:39 -0300 | [diff] [blame] | 36 | cls.auth_client = cls.keystone_manager.auth_client |
Rodrigo Duarte | 4666c64 | 2016-04-06 11:52:19 -0300 | [diff] [blame] | 37 | cls.idps_client = cls.keystone_manager.identity_providers_client |
Rodrigo Duarte | 179085d | 2016-04-13 13:56:37 -0300 | [diff] [blame] | 38 | cls.mappings_client = cls.keystone_manager.mapping_rules_client |
Hemanth Nakkina | 6d76b8b | 2017-06-12 12:56:14 +0530 | [diff] [blame] | 39 | cls.roles_client = cls.keystone_manager.roles_v3_client |
Rodrigo Duarte | e508fe0 | 2016-06-02 16:08:39 -0300 | [diff] [blame] | 40 | cls.saml2_client = cls.keystone_manager.saml2_client |
Rodrigo Duarte | d96e29c | 2016-04-08 11:53:43 -0300 | [diff] [blame] | 41 | cls.sps_client = cls.keystone_manager.service_providers_client |
Rodrigo Duarte | e508fe0 | 2016-06-02 16:08:39 -0300 | [diff] [blame] | 42 | cls.tokens_client = cls.keystone_manager.token_v3_client |
Hemanth Nakkina | 6d76b8b | 2017-06-12 12:56:14 +0530 | [diff] [blame] | 43 | cls.consumers_client = cls.keystone_manager.oauth_consumers_client |
| 44 | cls.oauth_token_client = cls.keystone_manager.oauth_token_client |
Colleen Murphy | 5ee9af8 | 2020-07-29 16:42:58 -0700 | [diff] [blame] | 45 | cls.registered_limits_client = ( |
| 46 | cls.keystone_manager.registered_limits_client) |
| 47 | cls.limits_client = cls.keystone_manager.limits_client |