blob: 8f57374af9ad3309861990fd2bc92083b82e6b4a [file] [log] [blame]
Marc Koderer3529ea72016-12-02 13:21:03 +01001# 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 Koderer3529ea72016-12-02 13:21:03 +010016import os
17
18from tempest.test_discover import plugins
19
20from barbican_tempest_plugin import config as project_config
21
22
23class 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 Kajinami39eb56d2023-11-30 22:29:10 +090034 conf.register_opts(
35 project_config.EnforceScopeGroup, group='enforce_scope')
Marc Koderer3529ea72016-12-02 13:21:03 +010036
Ade Lee519aa802022-05-06 12:33:06 -040037 conf.register_group(project_config.key_manager_group)
38 conf.register_opts(project_config.KeyManagerOpts,
39 project_config.key_manager_group)
40
Douglas Mendizábale6544642021-04-01 16:50:38 -050041 conf.register_group(project_config.barbican_tempest_group)
42 conf.register_opts(project_config.BarbicanGroupOpts,
43 project_config.barbican_tempest_group)
44
Jackie Truongab903f32017-04-10 18:03:27 -040045 # 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 Kajinami8f696b32023-05-11 12:07:24 +090049
50 conf.register_group(project_config.image_signature_verification_group)
Colleen Murphy62ec85c2019-04-03 09:27:05 -070051 conf.register_opts(project_config.ImageSignatureVerificationGroup,
52 project_config.image_signature_verification_group)
Jackie Truongab903f32017-04-10 18:03:27 -040053
Marc Koderer3529ea72016-12-02 13:21:03 +010054 def get_opt_lists(self):
Takashi Kajinami39eb56d2023-11-30 22:29:10 +090055 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ábaldf30b932024-02-19 14:52:38 -050060 project_config.BarbicanGroupOpts),
Takashi Kajinami39eb56d2023-11-30 22:29:10 +090061 (project_config.ephemeral_storage_encryption_group.name,
Takashi Kajinami8f696b32023-05-11 12:07:24 +090062 project_config.EphemeralStorageEncryptionGroup),
63 (project_config.image_signature_verification_group.name,
64 project_config.ImageSignatureVerificationGroup),
Takashi Kajinami39eb56d2023-11-30 22:29:10 +090065 ('enforce_scope', project_config.EnforceScopeGroup)
66 ]
Marc Kodererc832c612016-12-12 11:49:10 +010067
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 Hamiltonee389172017-01-12 16:41:45 -050073 'client_names': [
74 'ConsumerClient',
75 'ContainerClient',
Peter Hamiltonf4166be2017-01-20 10:54:33 -050076 'OrderClient',
Peter Hamilton2adeed62017-02-01 12:23:45 -050077 'QuotaClient',
Peter Hamiltonf4166be2017-01-20 10:54:33 -050078 'SecretClient',
Douglas Mendizábale6544642021-04-01 16:50:38 -050079 'SecretMetadataClient',
Douglas Mendizábal63b174e2021-04-05 14:53:18 -050080 'SecretStoresClient',
81 'TransportKeyClient'
Peter Hamiltonee389172017-01-12 16:41:45 -050082 ],
Marc Kodererc832c612016-12-12 11:49:10 +010083 }
Ade Lee519aa802022-05-06 12:33:06 -040084 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]