Codebase list cinder-tempest-plugin / 287f9ec
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
3 changed file(s) with 6 addition(s) and 26 deletion(s). Raw diff Collapse all Expand all
3737 @classmethod
3838 def skip_checks(cls):
3939 super(ConsistencyGroupsV2Test, cls).skip_checks()
40 if not CONF.cinder.consistency_group:
40 if not CONF.volume_feature_enabled.consistency_group:
4141 raise cls.skipException("Cinder consistency group "
4242 "feature disabled")
4343
1414
1515 from oslo_config import cfg
1616
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 = [
3318 cfg.BoolOpt('consistency_group',
3419 default=False,
3520 help='Enable to run Cinder volume consistency group tests'),
3131
3232 def register_opts(self, conf):
3333 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
3936 )
4037
4138 def get_opt_lists(self):
4239 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),
4742 ]