blob: 9e9c175c6a1164084f2c704c16bb684b165533b1 [file] [log] [blame]
Jim Rollenhagen1c11bdf2016-11-29 16:57:30 -05001# Copyright 2015 NEC Corporation
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
16
17import os
18
19from tempest import config
20from tempest.test_discover import plugins
21
22from ironic_tempest_plugin import config as project_config
23
Vasyl Saienkof46b9fa2017-02-23 13:06:56 -050024_opts = [
25 (project_config.baremetal_group, project_config.BaremetalGroup),
26 (project_config.baremetal_features_group,
27 project_config.BaremetalFeaturesGroup)
28]
29
Jim Rollenhagen1c11bdf2016-11-29 16:57:30 -050030
31class IronicTempestPlugin(plugins.TempestPlugin):
32 def load_tests(self):
33 base_path = os.path.split(os.path.dirname(
34 os.path.abspath(__file__)))[0]
35 test_dir = "ironic_tempest_plugin/tests"
36 full_test_dir = os.path.join(base_path, test_dir)
37 return full_test_dir, base_path
38
39 def register_opts(self, conf):
40 conf.register_opt(project_config.service_option,
41 group='service_available')
Vasyl Saienkof46b9fa2017-02-23 13:06:56 -050042 for group, option in _opts:
43 config.register_opt_group(conf, group, option)
Jim Rollenhagen1c11bdf2016-11-29 16:57:30 -050044
45 def get_opt_lists(self):
Vasyl Saienkof46b9fa2017-02-23 13:06:56 -050046 return [(group.name, option) for group, option in _opts]