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
Nishant Kumar
9 years ago
| 37 | 37 |
@classmethod
|
| 38 | 38 |
def skip_checks(cls):
|
| 39 | 39 |
super(ConsistencyGroupsV2Test, cls).skip_checks()
|
| 40 | |
if not CONF.cinder.consistency_group:
|
|
40 |
if not CONF.volume_feature_enabled.consistency_group:
|
| 41 | 41 |
raise cls.skipException("Cinder consistency group "
|
| 42 | 42 |
"feature disabled")
|
| 43 | 43 |
|
| 14 | 14 |
|
| 15 | 15 |
from oslo_config import cfg
|
| 16 | 16 |
|
| 17 | |
service_available_group = cfg.OptGroup(name="service_available",
|
| 18 | |
title="Available OpenStack Services")
|
| 19 | |
|
| 20 | |
|
| 21 | |
ServiceAvailableGroup = [
|
| 22 | |
cfg.BoolOpt("cinder",
|
| 23 | |
default=True,
|
| 24 | |
help="Whether or not cinder is expected to be available"),
|
| 25 | |
]
|
| 26 | |
|
| 27 | |
# Use a new config group specific to the cinder in-tree tests to avoid
|
| 28 | |
# any naming confusion with the upstream tempest config options.
|
| 29 | |
cinder_group = cfg.OptGroup(name='cinder',
|
| 30 | |
title='Cinder Tempest Config Options')
|
| 31 | |
|
| 32 | |
CinderGroup = [
|
|
17 |
cinder_option = [
|
| 33 | 18 |
cfg.BoolOpt('consistency_group',
|
| 34 | 19 |
default=False,
|
| 35 | 20 |
help='Enable to run Cinder volume consistency group tests'),
|
| 31 | 31 |
|
| 32 | 32 |
def register_opts(self, conf):
|
| 33 | 33 |
config.register_opt_group(
|
| 34 | |
conf, project_config.service_available_group,
|
| 35 | |
project_config.ServiceAvailableGroup)
|
| 36 | |
config.register_opt_group(
|
| 37 | |
conf, project_config.cinder_group,
|
| 38 | |
project_config.CinderGroup
|
|
34 |
conf, config.volume_feature_group,
|
|
35 |
project_config.cinder_option
|
| 39 | 36 |
)
|
| 40 | 37 |
|
| 41 | 38 |
def get_opt_lists(self):
|
| 42 | 39 |
return [
|
| 43 | |
(project_config.service_available_group.name,
|
| 44 | |
project_config.ServiceAvailableGroup),
|
| 45 | |
(project_config.cinder_group.name,
|
| 46 | |
project_config.CinderGroup),
|
|
40 |
(config.volume_feature_group.name,
|
|
41 |
project_config.cinder_option),
|
| 47 | 42 |
]
|