Matthew Treinish | 3d46811 | 2013-10-24 21:49:14 +0000 | [diff] [blame] | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4 |
| 2 | |
| 3 | # Copyright 2013 IBM Corp. |
| 4 | # All Rights Reserved. |
| 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 7 | # not use this file except in compliance with the License. You may obtain |
| 8 | # a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 15 | # License for the specific language governing permissions and limitations |
| 16 | # under the License. |
| 17 | # |
| 18 | |
| 19 | import sys |
| 20 | |
| 21 | from tempest import config |
| 22 | from tempest.openstack.common.config import generator |
| 23 | |
Matthew Treinish | 6eb0585 | 2013-11-26 15:28:12 +0000 | [diff] [blame] | 24 | # NOTE(mtreinish): This hack is needed because of how oslo config is used in |
| 25 | # tempest. Tempest is run from inside a test runner and so we can't rely on the |
| 26 | # global CONF object being fully populated when we run a test. (test runners |
| 27 | # don't init every file for running a test) So to get around that we manually |
| 28 | # load the config file in tempest for each test class to ensure that every |
| 29 | # config option is set. However, the tool expects the CONF object to be fully |
| 30 | # populated when it inits all the files in the project. This just works around |
| 31 | # the issue by manually loading the config file (which may or may not exist) |
| 32 | # which will populate all the options before running the generator. |
Matthew Treinish | 3d46811 | 2013-10-24 21:49:14 +0000 | [diff] [blame] | 33 | |
| 34 | config.TempestConfig() |
| 35 | generator.generate(sys.argv[1:]) |