fix experimental jobs
Change-Id: I2e71ca9fbc8869fb680a15567f575880c5491223
This commit is contained in:
parent
5f6b14353d
commit
ef8302ba2b
4
base.py
4
base.py
|
@ -22,7 +22,6 @@ import traceback
|
|||
import botocore.exceptions
|
||||
from oslo_log import log
|
||||
import six
|
||||
from tempest import config as tempest_config
|
||||
from tempest.lib import base
|
||||
from tempest.lib import exceptions
|
||||
import testtools
|
||||
|
@ -31,7 +30,6 @@ from ec2api.tests.functional import botocoreclient
|
|||
from ec2api.tests.functional import config as cfg
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF_TEMPEST = tempest_config.CONF
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
logging.getLogger('botocore').setLevel(logging.INFO)
|
||||
|
@ -255,7 +253,7 @@ class EC2TestCase(base.BaseTestCase):
|
|||
@safe_setup
|
||||
def setUpClass(cls):
|
||||
super(EC2TestCase, cls).setUpClass()
|
||||
if not CONF_TEMPEST.service_available.ec2api:
|
||||
if not CONF.service_available.ec2api:
|
||||
raise cls.skipException("ec2api is disabled")
|
||||
|
||||
cls.client = botocoreclient.get_ec2_client(
|
||||
|
|
|
@ -38,6 +38,7 @@ class ConfigPrivate(object):
|
|||
# if this was run from tempest runner then config already parsed
|
||||
if config_opts.aws_group.name in cfg.CONF:
|
||||
self.aws = cfg.CONF.aws
|
||||
self.service_available = cfg.CONF.service_available
|
||||
return
|
||||
|
||||
# Environment variables override defaults...
|
||||
|
@ -58,12 +59,19 @@ class ConfigPrivate(object):
|
|||
LOG.info("Using ec2api config file %s" % path)
|
||||
conf = cfg.CONF
|
||||
conf([], project='ec2api', default_config_files=[path])
|
||||
|
||||
conf.register_group(config_opts.aws_group)
|
||||
group_name = config_opts.aws_group.name
|
||||
for opt in config_opts.AWSGroup:
|
||||
conf.register_opt(opt, group=group_name)
|
||||
self.aws = cfg.CONF.aws
|
||||
|
||||
conf.register_group(config_opts.service_available_group)
|
||||
group_name = config_opts.service_available_group.name
|
||||
for opt in config_opts.ServiceAvailableGroup:
|
||||
conf.register_opt(opt, group=group_name)
|
||||
self.service_available = cfg.CONF.service_available
|
||||
|
||||
conf.log_opt_values(LOG, std_logging.DEBUG)
|
||||
|
||||
|
||||
|
|
11
plugin.py
11
plugin.py
|
@ -30,9 +30,14 @@ class AWSTempestPlugin(plugins.TempestPlugin):
|
|||
return full_test_dir, base_path
|
||||
|
||||
def register_opts(self, conf):
|
||||
group_name = aws_config.service_available_group.name
|
||||
if group_name not in conf:
|
||||
config.register_opt_group(
|
||||
conf, aws_config.service_available_group,
|
||||
aws_config.ServiceAvailableGroup)
|
||||
else:
|
||||
for opt in aws_config.ServiceAvailableGroup:
|
||||
conf.register_opt(opt, group=group_name)
|
||||
|
||||
if aws_config.aws_group.name not in conf:
|
||||
config.register_opt_group(conf, aws_config.aws_group,
|
||||
|
@ -40,6 +45,8 @@ class AWSTempestPlugin(plugins.TempestPlugin):
|
|||
|
||||
def get_opt_lists(self):
|
||||
return [
|
||||
('service_available', aws_config.ServiceAvailableGroup),
|
||||
(aws_config.aws_group.name, aws_config.AWSGroup)
|
||||
(aws_config.service_available_group.name,
|
||||
aws_config.ServiceAvailableGroup),
|
||||
(aws_config.aws_group.name,
|
||||
aws_config.AWSGroup)
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue