blob: 5aae7228e8b3a3c0bf31da0e767f1921de24ad05 [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
22
23
24class OctaviaTempestPlugin(plugins.TempestPlugin):
25
26 def load_tests(self):
27 base_path = os.path.split(os.path.dirname(
28 os.path.abspath(__file__)))[0]
29 test_dir = "octavia_tempest_plugin/tests"
30 full_test_dir = os.path.join(base_path, test_dir)
31 return full_test_dir, base_path
32
33 def register_opts(self, conf):
34 config.register_opt_group(conf, project_config.service_available_group,
35 project_config.ServiceAvailableGroup)
36 config.register_opt_group(conf, project_config.octavia_group,
37 project_config.OctaviaGroup)
38
39 def get_opt_lists(self):
40 return [
41 (project_config.service_available_group.name,
42 project_config.ServiceAvailableGroup),
43 (project_config.octavia_group.name,
44 project_config.OctaviaGroup),
45 ]
46
47 def get_service_clients(self):
48 octavia_config = config.service_client_config(
49 project_config.octavia_group.name
50 )
51
52 params = {
53 'name': 'load-balancer_v2',
54 'service_version': 'load-balancer.v2',
55 'module_path': 'octavia_tempest_plugin.services.load_balancer.v2',
56 'client_names': ['LoadbalancerClient'],
57 }
58 params.update(octavia_config)
59
60 return [params]