AvnishPal | 8a7942e | 2016-08-23 16:11:44 +0530 | [diff] [blame] | 1 | # 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 | |
| 13 | |
| 14 | import os |
| 15 | |
Dmitry Tantsur | b317e11 | 2016-09-09 11:03:27 +0200 | [diff] [blame] | 16 | from oslo_config import cfg |
AvnishPal | 8a7942e | 2016-08-23 16:11:44 +0530 | [diff] [blame] | 17 | from tempest import config as tempest_config |
| 18 | from tempest.test_discover import plugins |
| 19 | |
| 20 | from ironic_inspector.test.inspector_tempest_plugin import config |
| 21 | |
| 22 | |
| 23 | class InspectorTempestPlugin(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 = "inspector_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 | tempest_config.register_opt_group( |
| 33 | conf, config.service_available_group, |
| 34 | config.ServiceAvailableGroup) |
| 35 | tempest_config.register_opt_group( |
| 36 | conf, config.baremetal_introspection_group, |
| 37 | config.BaremetalIntrospectionGroup) |
Dmitry Tantsur | b317e11 | 2016-09-09 11:03:27 +0200 | [diff] [blame] | 38 | # FIXME(dtantsur): pretend like Neutron does not exist due to random |
| 39 | # failures, see https://bugs.launchpad.net/bugs/1621791. |
| 40 | cfg.CONF.set_override('neutron', False, 'service_available') |
AvnishPal | 8a7942e | 2016-08-23 16:11:44 +0530 | [diff] [blame] | 41 | |
| 42 | def get_opt_lists(self): |
| 43 | return [ |
| 44 | (config.baremetal_introspection_group.name, |
| 45 | config.BaremetalIntrospectionGroup), |
| 46 | ('service_available', config.ServiceAvailableGroup) |
| 47 | ] |