Reuse already existing groups in tempest plugin
Instead of registering new groups we can reuse already registered groups in tempest/config.py. Changes should be made to the following groups: a) service_available_group - We don't need this group in plugin code because it is already being registered in tempest code and service availability is being checked for in the /tempest/api/volume/base.py and the test cases in plugin code inherits this base.py b) cinder group - Instead of registering a new cinder group for plugin tests we can add plugin specific configuration options in the existing volume group as the same conf object from tempest is being passed on to the plugin Change-Id: Ie0ca52ec389c581ca47db3e9bbb0793a2bb47fdf Closes-Bug: #1626575
This commit is contained in:
parent
ec2411b361
commit
4e1643ea5b
|
@ -38,7 +38,7 @@ class ConsistencyGroupsV2Test(base.BaseVolumeAdminTest):
|
|||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(ConsistencyGroupsV2Test, cls).skip_checks()
|
||||
if not CONF.cinder.consistency_group:
|
||||
if not CONF.volume_feature_enabled.consistency_group:
|
||||
raise cls.skipException("Cinder consistency group "
|
||||
"feature disabled")
|
||||
|
||||
|
|
|
@ -15,22 +15,7 @@
|
|||
|
||||
from oslo_config import cfg
|
||||
|
||||
service_available_group = cfg.OptGroup(name="service_available",
|
||||
title="Available OpenStack Services")
|
||||
|
||||
|
||||
ServiceAvailableGroup = [
|
||||
cfg.BoolOpt("cinder",
|
||||
default=True,
|
||||
help="Whether or not cinder is expected to be available"),
|
||||
]
|
||||
|
||||
# Use a new config group specific to the cinder in-tree tests to avoid
|
||||
# any naming confusion with the upstream tempest config options.
|
||||
cinder_group = cfg.OptGroup(name='cinder',
|
||||
title='Cinder Tempest Config Options')
|
||||
|
||||
CinderGroup = [
|
||||
cinder_option = [
|
||||
cfg.BoolOpt('consistency_group',
|
||||
default=False,
|
||||
help='Enable to run Cinder volume consistency group tests'),
|
||||
|
|
|
@ -32,17 +32,12 @@ class CinderTempestPlugin(plugins.TempestPlugin):
|
|||
|
||||
def register_opts(self, conf):
|
||||
config.register_opt_group(
|
||||
conf, project_config.service_available_group,
|
||||
project_config.ServiceAvailableGroup)
|
||||
config.register_opt_group(
|
||||
conf, project_config.cinder_group,
|
||||
project_config.CinderGroup
|
||||
conf, config.volume_feature_group,
|
||||
project_config.cinder_option
|
||||
)
|
||||
|
||||
def get_opt_lists(self):
|
||||
return [
|
||||
(project_config.service_available_group.name,
|
||||
project_config.ServiceAvailableGroup),
|
||||
(project_config.cinder_group.name,
|
||||
project_config.CinderGroup),
|
||||
(config.volume_feature_group.name,
|
||||
project_config.cinder_option),
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue