blob: 47666be0494928147399ab9a81a1f82b94c8670b [file] [log] [blame]
David Lyle64302f12016-04-29 15:46:34 -06001# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13import os
14
15from tempest import config
16from tempest.test_discover import plugins
17
18from tempest_horizon import config as dashboard_config
19
20
21class HorizonTempestPlugin(plugins.TempestPlugin):
22 def load_tests(self):
23 base_path = os.path.split(os.path.dirname(
24 os.path.abspath(__file__)))[0]
25 test_dir = "tempest_horizon/tests"
26 full_test_dir = os.path.join(base_path, test_dir)
27 return full_test_dir, base_path
28
29 def register_opts(self, conf):
30 if 'dashboard' not in conf:
31 config.register_opt_group(conf, dashboard_config.dashboard_group,
Matthew Treinishaec2ef52016-05-03 18:50:39 -040032 dashboard_config.DashboardGroup)
33 if not getattr(conf.service_available, 'horizon'):
34 conf.register_opt(dashboard_config.service_opt,
35 group='service_available')
David Lyle64302f12016-04-29 15:46:34 -060036
37 def get_opt_lists(self):
38 return [('dashboard', config.DashboardGroup)]