Marc Koderer | 3529ea7 | 2016-12-02 13:21:03 +0100 | [diff] [blame] | 1 | # Copyright 2016 SAP SE |
| 2 | # All Rights Reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 | # not use this file except in compliance with the License. You may obtain |
| 6 | # a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | # License for the specific language governing permissions and limitations |
| 14 | # under the License. |
| 15 | |
Marc Koderer | 3529ea7 | 2016-12-02 13:21:03 +0100 | [diff] [blame] | 16 | import os |
| 17 | |
| 18 | from tempest.test_discover import plugins |
| 19 | |
| 20 | from barbican_tempest_plugin import config as project_config |
| 21 | |
| 22 | |
| 23 | class BarbicanTempestPlugin(plugins.TempestPlugin): |
| 24 | def load_tests(self): |
| 25 | base_path = os.path.split(os.path.dirname( |
| 26 | os.path.abspath(__file__)))[0] |
| 27 | test_dir = "barbican_tempest_plugin/tests" |
| 28 | full_test_dir = os.path.join(base_path, test_dir) |
| 29 | return full_test_dir, base_path |
| 30 | |
| 31 | def register_opts(self, conf): |
| 32 | conf.register_opt(project_config.service_option, |
| 33 | group='service_available') |
Takashi Kajinami | 39eb56d | 2023-11-30 22:29:10 +0900 | [diff] [blame] | 34 | conf.register_opts( |
| 35 | project_config.EnforceScopeGroup, group='enforce_scope') |
Marc Koderer | 3529ea7 | 2016-12-02 13:21:03 +0100 | [diff] [blame] | 36 | |
Ade Lee | 519aa80 | 2022-05-06 12:33:06 -0400 | [diff] [blame] | 37 | conf.register_group(project_config.key_manager_group) |
| 38 | conf.register_opts(project_config.KeyManagerOpts, |
| 39 | project_config.key_manager_group) |
| 40 | |
Douglas Mendizábal | e654464 | 2021-04-01 16:50:38 -0500 | [diff] [blame] | 41 | conf.register_group(project_config.barbican_tempest_group) |
| 42 | conf.register_opts(project_config.BarbicanGroupOpts, |
| 43 | project_config.barbican_tempest_group) |
| 44 | |
Jackie Truong | ab903f3 | 2017-04-10 18:03:27 -0400 | [diff] [blame] | 45 | # Register ephemeral storage encryption options |
| 46 | conf.register_group(project_config.ephemeral_storage_encryption_group) |
| 47 | conf.register_opts(project_config.EphemeralStorageEncryptionGroup, |
| 48 | project_config.ephemeral_storage_encryption_group) |
Takashi Kajinami | 8f696b3 | 2023-05-11 12:07:24 +0900 | [diff] [blame] | 49 | |
| 50 | conf.register_group(project_config.image_signature_verification_group) |
Colleen Murphy | 62ec85c | 2019-04-03 09:27:05 -0700 | [diff] [blame] | 51 | conf.register_opts(project_config.ImageSignatureVerificationGroup, |
| 52 | project_config.image_signature_verification_group) |
Jackie Truong | ab903f3 | 2017-04-10 18:03:27 -0400 | [diff] [blame] | 53 | |
Marc Koderer | 3529ea7 | 2016-12-02 13:21:03 +0100 | [diff] [blame] | 54 | def get_opt_lists(self): |
Takashi Kajinami | 39eb56d | 2023-11-30 22:29:10 +0900 | [diff] [blame] | 55 | return [ |
| 56 | ('service_available', [project_config.service_option]), |
| 57 | (project_config.key_manager_group.name, |
| 58 | project_config.KeyManagerOpts), |
| 59 | (project_config.barbican_tempest_group.name, |
Douglas Mendizábal | df30b93 | 2024-02-19 14:52:38 -0500 | [diff] [blame] | 60 | project_config.BarbicanGroupOpts), |
Takashi Kajinami | 39eb56d | 2023-11-30 22:29:10 +0900 | [diff] [blame] | 61 | (project_config.ephemeral_storage_encryption_group.name, |
Takashi Kajinami | 8f696b3 | 2023-05-11 12:07:24 +0900 | [diff] [blame] | 62 | project_config.EphemeralStorageEncryptionGroup), |
| 63 | (project_config.image_signature_verification_group.name, |
| 64 | project_config.ImageSignatureVerificationGroup), |
Takashi Kajinami | 39eb56d | 2023-11-30 22:29:10 +0900 | [diff] [blame] | 65 | ('enforce_scope', project_config.EnforceScopeGroup) |
| 66 | ] |
Marc Koderer | c832c61 | 2016-12-12 11:49:10 +0100 | [diff] [blame] | 67 | |
| 68 | def get_service_clients(self): |
| 69 | v1_params = { |
| 70 | 'name': 'secret_v1', |
| 71 | 'service_version': 'secret.v1', |
| 72 | 'module_path': 'barbican_tempest_plugin.services.key_manager.json', |
Peter Hamilton | ee38917 | 2017-01-12 16:41:45 -0500 | [diff] [blame] | 73 | 'client_names': [ |
| 74 | 'ConsumerClient', |
| 75 | 'ContainerClient', |
Peter Hamilton | f4166be | 2017-01-20 10:54:33 -0500 | [diff] [blame] | 76 | 'OrderClient', |
Peter Hamilton | 2adeed6 | 2017-02-01 12:23:45 -0500 | [diff] [blame] | 77 | 'QuotaClient', |
Peter Hamilton | f4166be | 2017-01-20 10:54:33 -0500 | [diff] [blame] | 78 | 'SecretClient', |
Douglas Mendizábal | e654464 | 2021-04-01 16:50:38 -0500 | [diff] [blame] | 79 | 'SecretMetadataClient', |
Douglas Mendizábal | 63b174e | 2021-04-05 14:53:18 -0500 | [diff] [blame] | 80 | 'SecretStoresClient', |
| 81 | 'TransportKeyClient' |
Peter Hamilton | ee38917 | 2017-01-12 16:41:45 -0500 | [diff] [blame] | 82 | ], |
Marc Koderer | c832c61 | 2016-12-12 11:49:10 +0100 | [diff] [blame] | 83 | } |
Ade Lee | 519aa80 | 2022-05-06 12:33:06 -0400 | [diff] [blame] | 84 | v1_1_params = { |
| 85 | 'name': 'secret_v1_1', |
| 86 | 'service_version': 'secret.v1_1', |
| 87 | 'module_path': 'barbican_tempest_plugin.services.key_manager.v1_1', |
| 88 | 'client_names': [ |
| 89 | 'SecretConsumerClient', |
| 90 | 'VersionClient' |
| 91 | ], |
| 92 | } |
| 93 | return [v1_params, v1_1_params] |