blob: ec8e7c50326283001509236cba5f50d6a2d8ab3b [file] [log] [blame]
Jude Cross986e3f52017-07-24 14:57:20 -07001# Copyright 2017 GoDaddy
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
16import os
17
18from tempest import config
19from tempest.test_discover import plugins
20
21from octavia_tempest_plugin import config as project_config
Michael Johnson29d8e612021-06-23 16:16:12 +000022from octavia_tempest_plugin.services.load_balancer import v2 as lb_v2_services
Jude Cross986e3f52017-07-24 14:57:20 -070023
24
25class OctaviaTempestPlugin(plugins.TempestPlugin):
26
27 def load_tests(self):
28 base_path = os.path.split(os.path.dirname(
29 os.path.abspath(__file__)))[0]
30 test_dir = "octavia_tempest_plugin/tests"
31 full_test_dir = os.path.join(base_path, test_dir)
32 return full_test_dir, base_path
33
34 def register_opts(self, conf):
35 config.register_opt_group(conf, project_config.service_available_group,
36 project_config.ServiceAvailableGroup)
37 config.register_opt_group(conf, project_config.octavia_group,
38 project_config.OctaviaGroup)
Reedipf88cffc2018-09-03 13:20:08 +000039 config.register_opt_group(conf,
40 project_config.lb_feature_enabled_group,
41 project_config.LBFeatureEnabledGroup)
Michael Johnson6006de72021-02-21 01:42:39 +000042 config.register_opt_group(conf, project_config.enforce_scope_group,
43 project_config.EnforceScopeGroup)
Jude Cross986e3f52017-07-24 14:57:20 -070044
45 def get_opt_lists(self):
46 return [
47 (project_config.service_available_group.name,
48 project_config.ServiceAvailableGroup),
49 (project_config.octavia_group.name,
50 project_config.OctaviaGroup),
Reedipf88cffc2018-09-03 13:20:08 +000051 (project_config.lb_feature_enabled_group.name,
52 project_config.LBFeatureEnabledGroup)
Jude Cross986e3f52017-07-24 14:57:20 -070053 ]
54
55 def get_service_clients(self):
56 octavia_config = config.service_client_config(
57 project_config.octavia_group.name
58 )
59
60 params = {
Michael Johnson29d8e612021-06-23 16:16:12 +000061 'name': 'load_balancer_v2',
Jude Cross986e3f52017-07-24 14:57:20 -070062 'service_version': 'load-balancer.v2',
63 'module_path': 'octavia_tempest_plugin.services.load_balancer.v2',
Michael Johnson29d8e612021-06-23 16:16:12 +000064 'client_names': lb_v2_services.__all__,
Jude Cross986e3f52017-07-24 14:57:20 -070065 }
66 params.update(octavia_config)
67
68 return [params]