blob: 471a0ded47f545e25395b885b5f9aeb718947f56 [file] [log] [blame]
ZhiQiang Fan39f97222013-09-20 04:49:44 +08001# Copyright 2012 OpenStack Foundation
Jay Pipes3f981df2012-03-27 18:59:44 -04002# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
Dirk Muellere746fc22013-06-29 16:29:29 +020016from __future__ import print_function
17
Masayuki Igawa9ec4cd82014-02-05 15:04:16 +090018import logging as std_logging
Jay Pipes7f757632011-12-02 15:53:32 -050019import os
Jay Pipes3f981df2012-03-27 18:59:44 -040020
Matthew Treinish90aedd12013-02-25 17:56:49 -050021from oslo.config import cfg
22
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -040023from tempest.openstack.common import log as logging
Jay Pipes7f757632011-12-02 15:53:32 -050024
Daryl Walleck1465d612011-11-02 02:22:15 -050025
DennyZhang88a2dd82013-10-07 12:55:35 -050026def register_opt_group(conf, opt_group, options):
27 conf.register_group(opt_group)
28 for opt in options:
29 conf.register_opt(opt, group=opt_group.name)
30
31
Matthew Treinish39e48ef2012-12-21 13:36:15 -050032identity_group = cfg.OptGroup(name='identity',
33 title="Keystone Configuration Options")
Daryl Walleck1465d612011-11-02 02:22:15 -050034
Matthew Treinish39e48ef2012-12-21 13:36:15 -050035IdentityGroup = [
36 cfg.StrOpt('catalog_type',
37 default='identity',
38 help="Catalog type of the Identity service."),
Jay Pipescd8eaec2013-01-16 21:03:48 -050039 cfg.BoolOpt('disable_ssl_certificate_validation',
40 default=False,
41 help="Set to True if using self-signed SSL certificates."),
Jay Pipes7c88eb22013-01-16 21:32:43 -050042 cfg.StrOpt('uri',
43 default=None,
Brant Knudsonc7ca3342013-03-28 21:08:50 -050044 help="Full URI of the OpenStack Identity API (Keystone), v2"),
45 cfg.StrOpt('uri_v3',
46 help='Full URI of the OpenStack Identity API (Keystone), v3'),
Andrea Frittoli8bbdb162014-01-06 11:06:13 +000047 cfg.StrOpt('auth_version',
48 default='v2',
49 help="Identity API version to be used for authentication "
Andrea Frittoli77f9da42014-02-06 11:18:19 +000050 "for API tests."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -050051 cfg.StrOpt('region',
Attila Fazekascadcb1f2013-01-21 23:10:53 +010052 default='RegionOne',
Arata Notsu8f440392013-09-13 16:14:20 +090053 help="The identity region name to use. Also used as the other "
54 "services' region name unless they are set explicitly. "
55 "If no such region is found in the service catalog, the "
56 "first found one is used."),
JordanP5d29b2c2013-12-18 13:56:03 +000057 cfg.StrOpt('endpoint_type',
58 default='publicURL',
59 choices=['public', 'admin', 'internal',
60 'publicURL', 'adminURL', 'internalURL'],
61 help="The endpoint type to use for the identity service."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +010062 cfg.StrOpt('username',
Andrea Frittolia9463672014-03-03 14:39:02 +000063 default=None,
Attila Fazekascadcb1f2013-01-21 23:10:53 +010064 help="Username to use for Nova API requests."),
65 cfg.StrOpt('tenant_name',
Andrea Frittolia9463672014-03-03 14:39:02 +000066 default=None,
Attila Fazekascadcb1f2013-01-21 23:10:53 +010067 help="Tenant name to use for Nova API requests."),
Russell Sim7f894a52013-09-13 10:35:21 +100068 cfg.StrOpt('admin_role',
69 default='admin',
70 help="Role required to administrate keystone."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +010071 cfg.StrOpt('password',
Andrea Frittolia9463672014-03-03 14:39:02 +000072 default=None,
Attila Fazekascadcb1f2013-01-21 23:10:53 +010073 help="API key to use when authenticating.",
74 secret=True),
75 cfg.StrOpt('alt_username',
76 default=None,
77 help="Username of alternate user to use for Nova API "
78 "requests."),
79 cfg.StrOpt('alt_tenant_name',
80 default=None,
81 help="Alternate user's Tenant name to use for Nova API "
82 "requests."),
83 cfg.StrOpt('alt_password',
84 default=None,
85 help="API key to use when authenticating as alternate user.",
86 secret=True),
87 cfg.StrOpt('admin_username',
Andrea Frittolia9463672014-03-03 14:39:02 +000088 default=None,
Dirk Mueller14bd5622014-01-14 19:33:05 +010089 help="Administrative Username to use for "
Attila Fazekascadcb1f2013-01-21 23:10:53 +010090 "Keystone API requests."),
91 cfg.StrOpt('admin_tenant_name',
Andrea Frittolia9463672014-03-03 14:39:02 +000092 default=None,
Attila Fazekascadcb1f2013-01-21 23:10:53 +010093 help="Administrative Tenant name to use for Keystone API "
94 "requests."),
95 cfg.StrOpt('admin_password',
Andrea Frittolia9463672014-03-03 14:39:02 +000096 default=None,
Attila Fazekascadcb1f2013-01-21 23:10:53 +010097 help="API key to use when authenticating as admin.",
98 secret=True),
Matthew Treinish39e48ef2012-12-21 13:36:15 -050099]
Jay Pipes3f981df2012-03-27 18:59:44 -0400100
Matthew Treinishd5021a72014-01-09 18:42:51 +0000101identity_feature_group = cfg.OptGroup(name='identity-feature-enabled',
102 title='Enabled Identity Features')
103
104IdentityFeatureGroup = [
105 cfg.BoolOpt('trust',
106 default=True,
107 help='Does the identity service have delegation and '
Matthew Treinishdb2c5972014-01-31 22:18:59 +0000108 'impersonation enabled'),
109 cfg.BoolOpt('api_v2',
110 default=True,
111 help='Is the v2 identity API enabled'),
112 cfg.BoolOpt('api_v3',
113 default=True,
114 help='Is the v3 identity API enabled'),
Matthew Treinishd5021a72014-01-09 18:42:51 +0000115]
116
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500117compute_group = cfg.OptGroup(name='compute',
118 title='Compute Service Options')
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800119
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500120ComputeGroup = [
121 cfg.BoolOpt('allow_tenant_isolation',
122 default=False,
123 help="Allows test cases to create/destroy tenants and "
124 "users. This option enables isolated test cases and "
125 "better parallel execution, but also requires that "
126 "OpenStack Identity API admin credentials are known."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500127 cfg.StrOpt('image_ref',
128 default="{$IMAGE_ID}",
129 help="Valid secondary image reference to be used in tests."),
130 cfg.StrOpt('image_ref_alt',
131 default="{$IMAGE_ID_ALT}",
132 help="Valid secondary image reference to be used in tests."),
Ken'ichi Ohmichi35772602013-11-14 15:03:27 +0900133 cfg.StrOpt('flavor_ref',
134 default="1",
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500135 help="Valid primary flavor to use in tests."),
Ken'ichi Ohmichi35772602013-11-14 15:03:27 +0900136 cfg.StrOpt('flavor_ref_alt',
137 default="2",
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500138 help='Valid secondary flavor to be used in tests.'),
Maru Newbyaf292e82013-05-20 21:32:28 +0000139 cfg.StrOpt('image_ssh_user',
140 default="root",
141 help="User name used to authenticate to an instance."),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700142 cfg.StrOpt('image_ssh_password',
143 default="password",
144 help="Password used to authenticate to an instance."),
Maru Newbyaf292e82013-05-20 21:32:28 +0000145 cfg.StrOpt('image_alt_ssh_user',
146 default="root",
147 help="User name used to authenticate to an instance using "
148 "the alternate image."),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700149 cfg.StrOpt('image_alt_ssh_password',
150 default="password",
151 help="Password used to authenticate to an instance using "
152 "the alternate image."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500153 cfg.IntOpt('build_interval',
154 default=10,
155 help="Time in seconds between build status checks."),
156 cfg.IntOpt('build_timeout',
157 default=300,
158 help="Timeout in seconds to wait for an instance to build."),
159 cfg.BoolOpt('run_ssh',
160 default=False,
Derek Higgins85cd5142013-12-17 17:10:11 +0000161 help="Should the tests ssh to instances?"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500162 cfg.StrOpt('ssh_user',
163 default='root',
164 help="User name used to authenticate to an instance."),
Nachi Ueno6d580be2013-07-24 10:58:11 -0700165 cfg.IntOpt('ping_timeout',
Darragh O'Reilly6b636672014-01-24 12:17:40 +0000166 default=120,
Nachi Ueno6d580be2013-07-24 10:58:11 -0700167 help="Timeout in seconds to wait for ping to "
168 "succeed."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500169 cfg.IntOpt('ssh_timeout',
170 default=300,
Chris Yeoh76916042013-02-27 16:25:25 +1030171 help="Timeout in seconds to wait for authentication to "
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500172 "succeed."),
Attila Fazekas0abbc952013-07-01 19:19:42 +0200173 cfg.IntOpt('ready_wait',
174 default=0,
DennyZhang8912d012013-09-25 18:08:34 -0500175 help="Additional wait time for clean state, when there is "
176 "no OS-EXT-STS extension available"),
Chris Yeoh76916042013-02-27 16:25:25 +1030177 cfg.IntOpt('ssh_channel_timeout',
178 default=60,
179 help="Timeout in seconds to wait for output from ssh "
180 "channel."),
Attila Fazekasb0661652013-05-08 13:01:36 +0200181 cfg.StrOpt('fixed_network_name',
182 default='private',
183 help="Visible fixed network name "),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500184 cfg.StrOpt('network_for_ssh',
185 default='public',
186 help="Network used for SSH connections."),
187 cfg.IntOpt('ip_version_for_ssh',
188 default=4,
189 help="IP version used for SSH connections."),
fujioka yuuichia11994e2013-07-09 11:19:51 +0900190 cfg.BoolOpt('use_floatingip_for_ssh',
191 default=True,
192 help="Dose the SSH uses Floating IP?"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500193 cfg.StrOpt('catalog_type',
194 default='compute',
195 help="Catalog type of the Compute service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900196 cfg.StrOpt('region',
197 default='',
198 help="The compute region name to use. If empty, the value "
199 "of identity.region is used instead. If no such region "
200 "is found in the service catalog, the first found one is "
201 "used."),
JordanP5d29b2c2013-12-18 13:56:03 +0000202 cfg.StrOpt('endpoint_type',
203 default='publicURL',
204 choices=['public', 'admin', 'internal',
205 'publicURL', 'adminURL', 'internalURL'],
206 help="The endpoint type to use for the compute service."),
ivan-zhu8f992be2013-07-31 14:56:58 +0800207 cfg.StrOpt('catalog_v3_type',
208 default='computev3',
209 help="Catalog type of the Compute v3 service."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100210 cfg.StrOpt('path_to_private_key',
211 default=None,
212 help="Path to a private key file for SSH access to remote "
213 "hosts"),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700214 cfg.StrOpt('volume_device_name',
215 default='vdb',
216 help="Expected device name when a volume is attached to "
Ken'ichi Ohmichi39437e22013-10-06 00:21:38 +0900217 "an instance"),
218 cfg.IntOpt('shelved_offload_time',
219 default=0,
220 help='Time in seconds before a shelved instance is eligible '
221 'for removing from a host. -1 never offload, 0 offload '
222 'when shelved. This time should be the same as the time '
223 'of nova.conf, and some tests will run for as long as the '
224 'time.')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500225]
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800226
Matthew Treinishd5c96022013-10-17 21:51:23 +0000227compute_features_group = cfg.OptGroup(name='compute-feature-enabled',
228 title="Enabled Compute Service Features")
229
230ComputeFeaturesGroup = [
ivan-zhu8f992be2013-07-31 14:56:58 +0800231 cfg.BoolOpt('api_v3',
Chris Yeohfbc15de2013-11-26 10:20:08 +1030232 default=True,
ivan-zhu8f992be2013-07-31 14:56:58 +0800233 help="If false, skip all nova v3 tests."),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000234 cfg.BoolOpt('disk_config',
235 default=True,
236 help="If false, skip disk config tests"),
Matthew Treinishe3d26142013-11-26 19:14:58 +0000237 cfg.ListOpt('api_extensions',
238 default=['all'],
Zhi Kun Liude25c022014-02-14 13:25:19 +0800239 help='A list of enabled compute extensions with a special '
240 'entry all which indicates every extension is enabled'),
Matthew Treinishe3d26142013-11-26 19:14:58 +0000241 cfg.ListOpt('api_v3_extensions',
242 default=['all'],
243 help='A list of enabled v3 extensions with a special entry all'
244 ' which indicates every extension is enabled'),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000245 cfg.BoolOpt('change_password',
246 default=False,
247 help="Does the test environment support changing the admin "
248 "password?"),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000249 cfg.BoolOpt('resize',
250 default=False,
251 help="Does the test environment support resizing?"),
252 cfg.BoolOpt('live_migration',
253 default=False,
254 help="Does the test environment support live migration "
255 "available?"),
256 cfg.BoolOpt('block_migration_for_live_migration',
257 default=False,
258 help="Does the test environment use block devices for live "
259 "migration"),
260 cfg.BoolOpt('block_migrate_cinder_iscsi',
261 default=False,
262 help="Does the test environment block migration support "
Ghanshyam Mann41c17572014-02-27 18:52:56 +0900263 "cinder iSCSI volumes"),
264 cfg.BoolOpt('vnc_console',
265 default=False,
266 help='Enable VNC console. This configuration value should '
267 'be same as [nova.vnc]->vnc_enabled in nova.conf')
Matthew Treinishd5c96022013-10-17 21:51:23 +0000268]
269
270
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500271compute_admin_group = cfg.OptGroup(name='compute-admin',
272 title="Compute Admin Options")
donald-ngo7fb1efa2011-12-13 17:17:36 -0800273
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500274ComputeAdminGroup = [
275 cfg.StrOpt('username',
Andrea Frittolia9463672014-03-03 14:39:02 +0000276 default=None,
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500277 help="Administrative Username to use for Nova API requests."),
278 cfg.StrOpt('tenant_name',
Andrea Frittolia9463672014-03-03 14:39:02 +0000279 default=None,
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500280 help="Administrative Tenant name to use for Nova API "
281 "requests."),
282 cfg.StrOpt('password',
Andrea Frittolia9463672014-03-03 14:39:02 +0000283 default=None,
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500284 help="API key to use when authenticating as admin.",
285 secret=True),
286]
Daryl Walleck587385b2012-03-03 13:00:26 -0600287
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500288image_group = cfg.OptGroup(name='image',
289 title="Image Service Options")
Jay Pipesf38eaac2012-06-21 13:37:35 -0400290
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500291ImageGroup = [
Matthew Treinish72ea4422013-02-07 14:42:49 -0500292 cfg.StrOpt('catalog_type',
293 default='image',
Sean Dague83401992013-05-06 17:46:36 -0400294 help='Catalog type of the Image service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900295 cfg.StrOpt('region',
296 default='',
297 help="The image region name to use. If empty, the value "
298 "of identity.region is used instead. If no such region "
299 "is found in the service catalog, the first found one is "
300 "used."),
JordanP5d29b2c2013-12-18 13:56:03 +0000301 cfg.StrOpt('endpoint_type',
302 default='publicURL',
303 choices=['public', 'admin', 'internal',
304 'publicURL', 'adminURL', 'internalURL'],
305 help="The endpoint type to use for the image service."),
Sean Dague83401992013-05-06 17:46:36 -0400306 cfg.StrOpt('http_image',
307 default='http://download.cirros-cloud.net/0.3.1/'
308 'cirros-0.3.1-x86_64-uec.tar.gz',
DennyZhang8912d012013-09-25 18:08:34 -0500309 help='http accessible image')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500310]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400311
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000312image_feature_group = cfg.OptGroup(name='image-feature-enabled',
313 title='Enabled image service features')
314
315ImageFeaturesGroup = [
316 cfg.BoolOpt('api_v2',
317 default=True,
318 help="Is the v2 image API enabled"),
319 cfg.BoolOpt('api_v1',
320 default=True,
321 help="Is the v1 image API enabled"),
322]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400323
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500324network_group = cfg.OptGroup(name='network',
325 title='Network Service Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600326
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500327NetworkGroup = [
328 cfg.StrOpt('catalog_type',
329 default='network',
Mark McClainf2982e82013-07-06 17:48:03 -0400330 help='Catalog type of the Neutron service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900331 cfg.StrOpt('region',
332 default='',
333 help="The network region name to use. If empty, the value "
334 "of identity.region is used instead. If no such region "
335 "is found in the service catalog, the first found one is "
336 "used."),
JordanP5d29b2c2013-12-18 13:56:03 +0000337 cfg.StrOpt('endpoint_type',
338 default='publicURL',
339 choices=['public', 'admin', 'internal',
340 'publicURL', 'adminURL', 'internalURL'],
341 help="The endpoint type to use for the network service."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500342 cfg.StrOpt('tenant_network_cidr',
343 default="10.100.0.0/16",
Henry Gessauffda37a2014-01-16 11:17:55 -0500344 help="The cidr block to allocate tenant ipv4 subnets from"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500345 cfg.IntOpt('tenant_network_mask_bits',
Attila Fazekas8ea181b2013-07-13 16:26:14 +0200346 default=28,
Henry Gessauffda37a2014-01-16 11:17:55 -0500347 help="The mask bits for tenant ipv4 subnets"),
348 cfg.StrOpt('tenant_network_v6_cidr',
349 default="2003::/64",
350 help="The cidr block to allocate tenant ipv6 subnets from"),
351 cfg.IntOpt('tenant_network_v6_mask_bits',
352 default=96,
353 help="The mask bits for tenant ipv6 subnets"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500354 cfg.BoolOpt('tenant_networks_reachable',
355 default=False,
356 help="Whether tenant network connectivity should be "
357 "evaluated directly"),
358 cfg.StrOpt('public_network_id',
359 default="",
360 help="Id of the public network that provides external "
361 "connectivity"),
362 cfg.StrOpt('public_router_id',
363 default="",
364 help="Id of the public router that provides external "
365 "connectivity"),
izikpensod9a01a62014-02-17 20:02:32 +0200366 cfg.IntOpt('build_timeout',
367 default=300,
368 help="Timeout in seconds to wait for network operation to "
369 "complete."),
370 cfg.IntOpt('build_interval',
371 default=10,
372 help="Time in seconds between network operation status "
373 "checks."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500374]
Jay Pipes3f981df2012-03-27 18:59:44 -0400375
Matthew Treinishe3d26142013-11-26 19:14:58 +0000376network_feature_group = cfg.OptGroup(name='network-feature-enabled',
377 title='Enabled network service features')
378
379NetworkFeaturesGroup = [
Matthew Treinishe2e33cf2014-03-03 19:28:41 +0000380 cfg.BoolOpt('ipv6',
381 default=True,
382 help="Allow the execution of IPv6 tests"),
Matthew Treinishe3d26142013-11-26 19:14:58 +0000383 cfg.ListOpt('api_extensions',
384 default=['all'],
Zhi Kun Liude25c022014-02-14 13:25:19 +0800385 help='A list of enabled network extensions with a special '
386 'entry all which indicates every extension is enabled'),
Matthew Treinishe3d26142013-11-26 19:14:58 +0000387]
388
Malini Kamalambal6e7b3b82014-02-06 06:49:04 -0500389queuing_group = cfg.OptGroup(name='queuing',
390 title='Queuing Service')
391
392QueuingGroup = [
393 cfg.StrOpt('catalog_type',
394 default='queuing',
395 help='Catalog type of the Queuing service.'),
396]
397
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500398volume_group = cfg.OptGroup(name='volume',
399 title='Block Storage Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600400
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500401VolumeGroup = [
402 cfg.IntOpt('build_interval',
403 default=10,
404 help='Time in seconds between volume availability checks.'),
405 cfg.IntOpt('build_timeout',
406 default=300,
407 help='Timeout in seconds to wait for a volume to become'
408 'available.'),
409 cfg.StrOpt('catalog_type',
Matthew Treinisheb724512013-10-25 15:12:59 +0000410 default='volume',
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500411 help="Catalog type of the Volume Service"),
Arata Notsu8f440392013-09-13 16:14:20 +0900412 cfg.StrOpt('region',
413 default='',
414 help="The volume region name to use. If empty, the value "
415 "of identity.region is used instead. If no such region "
416 "is found in the service catalog, the first found one is "
417 "used."),
JordanP5d29b2c2013-12-18 13:56:03 +0000418 cfg.StrOpt('endpoint_type',
419 default='publicURL',
420 choices=['public', 'admin', 'internal',
421 'publicURL', 'adminURL', 'internalURL'],
422 help="The endpoint type to use for the volume service."),
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100423 cfg.StrOpt('backend1_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200424 default='BACKEND_1',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100425 help="Name of the backend1 (must be declared in cinder.conf)"),
426 cfg.StrOpt('backend2_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200427 default='BACKEND_2',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100428 help="Name of the backend2 (must be declared in cinder.conf)"),
Adam Gandelman827ad332013-06-24 17:04:09 -0700429 cfg.StrOpt('storage_protocol',
430 default='iSCSI',
431 help='Backend protocol to target when creating volume types'),
432 cfg.StrOpt('vendor_name',
433 default='Open Source',
434 help='Backend vendor to target when creating volume types'),
Ryan Hsua67f4632013-08-29 16:03:06 -0700435 cfg.StrOpt('disk_format',
436 default='raw',
437 help='Disk format to use when copying a volume to image'),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500438]
K Jonathan Harkerd6ba4b42012-12-18 13:50:47 -0800439
Matthew Treinishd5c96022013-10-17 21:51:23 +0000440volume_feature_group = cfg.OptGroup(name='volume-feature-enabled',
441 title='Enabled Cinder Features')
442
443VolumeFeaturesGroup = [
444 cfg.BoolOpt('multi_backend',
445 default=False,
Matthew Treinishe3d26142013-11-26 19:14:58 +0000446 help="Runs Cinder multi-backend test (requires 2 backends)"),
Giulio Fidente74b08ad2014-01-18 04:02:51 +0100447 cfg.BoolOpt('backup',
448 default=True,
449 help='Runs Cinder volumes backup test'),
Matthew Treinishe3d26142013-11-26 19:14:58 +0000450 cfg.ListOpt('api_extensions',
451 default=['all'],
Zhi Kun Liude25c022014-02-14 13:25:19 +0800452 help='A list of enabled volume extensions with a special '
453 'entry all which indicates every extension is enabled'),
Zhi Kun Liubb363a22013-11-28 18:47:39 +0800454 cfg.BoolOpt('api_v1',
455 default=True,
456 help="Is the v1 volume API enabled"),
Zhi Kun Liu8cc3c842014-01-07 10:44:34 +0800457 cfg.BoolOpt('api_v2',
458 default=True,
459 help="Is the v2 volume API enabled"),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000460]
461
Daryl Walleck587385b2012-03-03 13:00:26 -0600462
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500463object_storage_group = cfg.OptGroup(name='object-storage',
464 title='Object Storage Service Options')
Attila Fazekasa23f5002012-10-23 19:32:45 +0200465
DennyZhang1e71b612013-09-26 12:35:40 -0500466ObjectStoreGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500467 cfg.StrOpt('catalog_type',
468 default='object-store',
469 help="Catalog type of the Object-Storage service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900470 cfg.StrOpt('region',
471 default='',
472 help="The object-storage region name to use. If empty, the "
473 "value of identity.region is used instead. If no such "
474 "region is found in the service catalog, the first found "
475 "one is used."),
JordanP5d29b2c2013-12-18 13:56:03 +0000476 cfg.StrOpt('endpoint_type',
477 default='publicURL',
478 choices=['public', 'admin', 'internal',
479 'publicURL', 'adminURL', 'internalURL'],
480 help="The endpoint type to use for the object-store service."),
Matthew Treinishf319a732013-10-24 21:39:24 +0000481 cfg.IntOpt('container_sync_timeout',
nayna-patelb4989b32013-01-09 06:25:13 +0000482 default=120,
Fabien Boucher2178d312013-12-31 15:38:57 +0100483 help="Number of seconds to time on waiting for a container "
nayna-patelb4989b32013-01-09 06:25:13 +0000484 "to container synchronization complete."),
Matthew Treinishf319a732013-10-24 21:39:24 +0000485 cfg.IntOpt('container_sync_interval',
nayna-patelb4989b32013-01-09 06:25:13 +0000486 default=5,
Fabien Boucher2178d312013-12-31 15:38:57 +0100487 help="Number of seconds to wait while looping to check the "
nayna-patelb4989b32013-01-09 06:25:13 +0000488 "status of a container to container synchronization"),
Matthew Treinish3fdb80c2013-08-15 11:13:19 -0400489 cfg.StrOpt('operator_role',
490 default='Member',
491 help="Role to add to users created for swift tests to "
492 "enable creating containers"),
Matthew Treinish998c91d2014-03-01 12:39:49 -0500493 cfg.StrOpt('reseller_admin_role',
494 default='ResellerAdmin',
495 help="User role that has reseller admin"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500496]
Attila Fazekasa23f5002012-10-23 19:32:45 +0200497
Matthew Treinishd5c96022013-10-17 21:51:23 +0000498object_storage_feature_group = cfg.OptGroup(
499 name='object-storage-feature-enabled',
500 title='Enabled object-storage features')
501
502ObjectStoreFeaturesGroup = [
Matthew Treinish20345382013-12-13 17:04:23 +0000503 cfg.ListOpt('discoverable_apis',
504 default=['all'],
505 help="A list of the enabled optional discoverable apis. "
506 "A single entry, all, indicates that all of these "
507 "features are expected to be enabled"),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000508]
509
Nikhil Manchandadd6886f2014-03-03 01:58:45 -0800510database_group = cfg.OptGroup(name='database',
511 title='Database Service Options')
512
513DatabaseGroup = [
514 cfg.StrOpt('catalog_type',
515 default='database',
516 help="Catalog type of the Database service."),
517 cfg.StrOpt('db_flavor_ref',
518 default="1",
519 help="Valid primary flavor to use in database tests."),
520]
Attila Fazekasa23f5002012-10-23 19:32:45 +0200521
Steve Bakerc60e4e32013-05-06 15:22:41 +1200522orchestration_group = cfg.OptGroup(name='orchestration',
523 title='Orchestration Service Options')
524
525OrchestrationGroup = [
526 cfg.StrOpt('catalog_type',
527 default='orchestration',
528 help="Catalog type of the Orchestration service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900529 cfg.StrOpt('region',
530 default='',
531 help="The orchestration region name to use. If empty, the "
532 "value of identity.region is used instead. If no such "
533 "region is found in the service catalog, the first found "
534 "one is used."),
JordanP5d29b2c2013-12-18 13:56:03 +0000535 cfg.StrOpt('endpoint_type',
536 default='publicURL',
537 choices=['public', 'admin', 'internal',
538 'publicURL', 'adminURL', 'internalURL'],
539 help="The endpoint type to use for the orchestration service."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200540 cfg.BoolOpt('allow_tenant_isolation',
541 default=False,
542 help="Allows test cases to create/destroy tenants and "
543 "users. This option enables isolated test cases and "
544 "better parallel execution, but also requires that "
545 "OpenStack Identity API admin credentials are known."),
546 cfg.IntOpt('build_interval',
547 default=1,
548 help="Time in seconds between build status checks."),
549 cfg.IntOpt('build_timeout',
Steve Baker27f02432014-03-07 09:47:32 +1300550 default=600,
Steve Bakerc60e4e32013-05-06 15:22:41 +1200551 help="Timeout in seconds to wait for a stack to build."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200552 cfg.StrOpt('instance_type',
Steve Baker9e86b832013-05-22 15:40:28 +1200553 default='m1.micro',
Steve Bakerc60e4e32013-05-06 15:22:41 +1200554 help="Instance type for tests. Needs to be big enough for a "
555 "full OS plus the test workload"),
556 cfg.StrOpt('image_ref',
557 default=None,
558 help="Name of heat-cfntools enabled image to use when "
559 "launching test instances."),
560 cfg.StrOpt('keypair_name',
561 default=None,
562 help="Name of existing keypair to launch servers with."),
Clint Byrum71f27632013-09-09 11:41:32 -0700563 cfg.IntOpt('max_template_size',
Joe Gordon0e51b222013-10-24 14:11:10 +0100564 default=524288,
Clint Byrum71f27632013-09-09 11:41:32 -0700565 help="Value must match heat configuration of the same name."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200566]
567
568
Yassine Lamgarchalb158d412013-12-27 19:29:42 +0100569telemetry_group = cfg.OptGroup(name='telemetry',
570 title='Telemetry Service Options')
571
572TelemetryGroup = [
573 cfg.StrOpt('catalog_type',
574 default='metering',
575 help="Catalog type of the Telemetry service."),
JordanPfc62c902014-02-26 14:47:28 +0000576 cfg.StrOpt('endpoint_type',
577 default='publicURL',
578 choices=['public', 'admin', 'internal',
579 'publicURL', 'adminURL', 'internalURL'],
580 help="The endpoint type to use for the telemetry service."),
Yassine Lamgarchalb158d412013-12-27 19:29:42 +0100581]
582
583
Julie Pichond1017642013-07-24 16:37:23 +0100584dashboard_group = cfg.OptGroup(name="dashboard",
585 title="Dashboard options")
586
587DashboardGroup = [
588 cfg.StrOpt('dashboard_url',
589 default='http://localhost/',
590 help="Where the dashboard can be found"),
591 cfg.StrOpt('login_url',
592 default='http://localhost/auth/login/',
593 help="Login page for the dashboard"),
594]
595
596
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400597data_processing_group = cfg.OptGroup(name="data_processing",
598 title="Data Processing options")
599
600DataProcessingGroup = [
601 cfg.StrOpt('catalog_type',
602 default='data_processing',
JordanPfc62c902014-02-26 14:47:28 +0000603 help="Catalog type of the data processing service."),
604 cfg.StrOpt('endpoint_type',
605 default='publicURL',
606 choices=['public', 'admin', 'internal',
607 'publicURL', 'adminURL', 'internalURL'],
608 help="The endpoint type to use for the data processing "
609 "service."),
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400610]
611
612
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500613boto_group = cfg.OptGroup(name='boto',
614 title='EC2/S3 options')
DennyZhang1e71b612013-09-26 12:35:40 -0500615BotoGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500616 cfg.StrOpt('ec2_url',
617 default="http://localhost:8773/services/Cloud",
618 help="EC2 URL"),
619 cfg.StrOpt('s3_url',
620 default="http://localhost:8080",
621 help="S3 URL"),
622 cfg.StrOpt('aws_secret',
623 default=None,
624 help="AWS Secret Key",
625 secret=True),
626 cfg.StrOpt('aws_access',
627 default=None,
628 help="AWS Access Key"),
Attila Fazekas27dd92e2014-02-21 14:49:40 +0100629 cfg.StrOpt('aws_zone',
630 default="nova",
631 help="AWS Zone for EC2 tests"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500632 cfg.StrOpt('s3_materials_path',
633 default="/opt/stack/devstack/files/images/"
634 "s3-materials/cirros-0.3.0",
635 help="S3 Materials Path"),
636 cfg.StrOpt('ari_manifest',
637 default="cirros-0.3.0-x86_64-initrd.manifest.xml",
638 help="ARI Ramdisk Image manifest"),
639 cfg.StrOpt('ami_manifest',
640 default="cirros-0.3.0-x86_64-blank.img.manifest.xml",
641 help="AMI Machine Image manifest"),
642 cfg.StrOpt('aki_manifest',
643 default="cirros-0.3.0-x86_64-vmlinuz.manifest.xml",
644 help="AKI Kernel Image manifest"),
645 cfg.StrOpt('instance_type',
646 default="m1.tiny",
647 help="Instance type"),
648 cfg.IntOpt('http_socket_timeout',
649 default=3,
650 help="boto Http socket timeout"),
651 cfg.IntOpt('num_retries',
652 default=1,
653 help="boto num_retries on error"),
654 cfg.IntOpt('build_timeout',
655 default=60,
656 help="Status Change Timeout"),
657 cfg.IntOpt('build_interval',
658 default=1,
659 help="Status Change Test Interval"),
660]
Attila Fazekasf7f2d932012-12-13 09:14:38 +0100661
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500662stress_group = cfg.OptGroup(name='stress', title='Stress Test Options')
663
664StressGroup = [
665 cfg.StrOpt('nova_logdir',
666 default=None,
667 help='Directory containing log files on the compute nodes'),
668 cfg.IntOpt('max_instances',
669 default=16,
670 help='Maximum number of instances to create during test.'),
671 cfg.StrOpt('controller',
672 default=None,
David Kranzb9d97502013-05-01 15:55:04 -0400673 help='Controller host.'),
674 # new stress options
675 cfg.StrOpt('target_controller',
676 default=None,
677 help='Controller host.'),
678 cfg.StrOpt('target_ssh_user',
679 default=None,
680 help='ssh user.'),
681 cfg.StrOpt('target_private_key_path',
682 default=None,
683 help='Path to private key.'),
684 cfg.StrOpt('target_logfiles',
685 default=None,
686 help='regexp for list of log files.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000687 cfg.IntOpt('log_check_interval',
David Kranzb9d97502013-05-01 15:55:04 -0400688 default=60,
Marc Koderer32221b8e2013-08-23 13:57:50 +0200689 help='time (in seconds) between log file error checks.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000690 cfg.IntOpt('default_thread_number_per_action',
Marc Koderer32221b8e2013-08-23 13:57:50 +0200691 default=4,
Julien Leloup04d40f72014-01-28 11:17:18 +0100692 help='The number of threads created while stress test.'),
693 cfg.BoolOpt('leave_dirty_stack',
694 default=False,
695 help='Prevent the cleaning (tearDownClass()) between'
696 ' each stress test run if an exception occurs'
Julien Leloupa5ee5422014-02-13 14:29:02 +0100697 ' during this run.'),
698 cfg.BoolOpt('full_clean_stack',
699 default=False,
700 help='Allows a full cleaning process after a stress test.'
701 ' Caution : this cleanup will remove every objects of'
702 ' every tenant.')
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500703]
704
705
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900706scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options')
707
708ScenarioGroup = [
709 cfg.StrOpt('img_dir',
710 default='/opt/stack/new/devstack/files/images/'
711 'cirros-0.3.1-x86_64-uec',
712 help='Directory containing image files'),
Masayuki Igawa4f71bf02014-02-21 14:02:29 +0900713 cfg.StrOpt('qcow2_img_file',
714 default='cirros-0.3.1-x86_64-disk.img',
715 help='QCOW2 image file name'),
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900716 cfg.StrOpt('ami_img_file',
717 default='cirros-0.3.1-x86_64-blank.img',
718 help='AMI image file name'),
719 cfg.StrOpt('ari_img_file',
720 default='cirros-0.3.1-x86_64-initrd',
721 help='ARI image file name'),
722 cfg.StrOpt('aki_img_file',
723 default='cirros-0.3.1-x86_64-vmlinuz',
724 help='AKI image file name'),
725 cfg.StrOpt('ssh_user',
726 default='cirros',
Joe Gordonb5e10cd2013-07-10 15:51:12 +0000727 help='ssh username for the image file'),
728 cfg.IntOpt(
729 'large_ops_number',
730 default=0,
731 help="specifies how many resources to request at once. Used "
732 "for large operations testing.")
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900733]
734
735
Matthew Treinish4c412922013-07-16 15:27:42 -0400736service_available_group = cfg.OptGroup(name="service_available",
737 title="Available OpenStack Services")
738
739ServiceAvailableGroup = [
740 cfg.BoolOpt('cinder',
741 default=True,
742 help="Whether or not cinder is expected to be available"),
Matthew Treinishfaa340d2013-07-19 16:26:21 -0400743 cfg.BoolOpt('neutron',
744 default=False,
745 help="Whether or not neutron is expected to be available"),
Matthew Treinish853ae442013-07-19 16:36:07 -0400746 cfg.BoolOpt('glance',
747 default=True,
748 help="Whether or not glance is expected to be available"),
Matthew Treinish61e332b2013-07-19 16:42:31 -0400749 cfg.BoolOpt('swift',
750 default=True,
751 help="Whether or not swift is expected to be available"),
Matthew Treinish6b41e242013-07-19 16:49:28 -0400752 cfg.BoolOpt('nova',
753 default=True,
754 help="Whether or not nova is expected to be available"),
Matthew Treinisha9d43882013-07-19 16:54:52 -0400755 cfg.BoolOpt('heat',
756 default=False,
757 help="Whether or not Heat is expected to be available"),
Mehdi Abaakouk8581c0b2013-10-04 10:45:42 +0200758 cfg.BoolOpt('ceilometer',
759 default=True,
760 help="Whether or not Ceilometer is expected to be available"),
Julie Pichond1017642013-07-24 16:37:23 +0100761 cfg.BoolOpt('horizon',
762 default=True,
763 help="Whether or not Horizon is expected to be available"),
Sergey Lukjanov9c95a252014-03-13 23:59:22 +0400764 cfg.BoolOpt('sahara',
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400765 default=False,
Sergey Lukjanov9c95a252014-03-13 23:59:22 +0400766 help="Whether or not Sahara is expected to be available"),
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300767 cfg.BoolOpt('ironic',
768 default=False,
769 help="Whether or not Ironic is expected to be available"),
Nikhil Manchandadd6886f2014-03-03 01:58:45 -0800770 cfg.BoolOpt('trove',
771 default=False,
772 help="Whether or not Trove is expected to be available"),
Malini Kamalambal6e7b3b82014-02-06 06:49:04 -0500773 cfg.BoolOpt('marconi',
774 default=False,
775 help="Whether or not Marconi is expected to be available"),
Matthew Treinish4c412922013-07-16 15:27:42 -0400776]
777
Attila Fazekasaeeeefd2013-08-06 17:01:56 +0200778debug_group = cfg.OptGroup(name="debug",
779 title="Debug System")
780
781DebugGroup = [
782 cfg.BoolOpt('enable',
783 default=True,
784 help="Enable diagnostic commands"),
785]
786
Andrea Frittolif5da28b2013-12-06 07:08:07 +0000787input_scenario_group = cfg.OptGroup(name="input-scenario",
788 title="Filters and values for"
789 " input scenarios")
790
791InputScenarioGroup = [
792 cfg.StrOpt('image_regex',
793 default='^cirros-0.3.1-x86_64-uec$',
794 help="Matching images become parameters for scenario tests"),
795 cfg.StrOpt('flavor_regex',
Andrea Frittoli99901c02014-01-30 18:06:49 +0000796 default='^m1.nano$',
Andrea Frittolif5da28b2013-12-06 07:08:07 +0000797 help="Matching flavors become parameters for scenario tests"),
798 cfg.StrOpt('non_ssh_image_regex',
799 default='^.*[Ww]in.*$',
800 help="SSH verification in tests is skipped"
801 "for matching images"),
802 cfg.StrOpt('ssh_user_regex',
803 default="[[\"^.*[Cc]irros.*$\", \"root\"]]",
804 help="List of user mapped to regex "
805 "to matching image names."),
806]
807
Attila Fazekasaeeeefd2013-08-06 17:01:56 +0200808
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300809baremetal_group = cfg.OptGroup(name='baremetal',
810 title='Baremetal provisioning service options')
811
812BaremetalGroup = [
813 cfg.StrOpt('catalog_type',
814 default='baremetal',
815 help="Catalog type of the baremetal provisioning service."),
JordanPfc62c902014-02-26 14:47:28 +0000816 cfg.StrOpt('endpoint_type',
817 default='publicURL',
818 choices=['public', 'admin', 'internal',
819 'publicURL', 'adminURL', 'internalURL'],
820 help="The endpoint type to use for the baremetal provisioning "
821 "service."),
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300822]
823
Matthew Treinishe2b56b52014-01-29 19:25:50 +0000824cli_group = cfg.OptGroup(name='cli', title="cli Configuration Options")
825
826CLIGroup = [
827 cfg.BoolOpt('enabled',
828 default=True,
829 help="enable cli tests"),
830 cfg.StrOpt('cli_dir',
831 default='/usr/local/bin',
832 help="directory where python client binaries are located"),
Sean Dague44b24682014-02-20 19:08:24 -0500833 cfg.BoolOpt('has_manage',
834 default=True,
835 help=("Whether the tempest run location has access to the "
836 "*-manage commands. In a pure blackbox environment "
837 "it will not.")),
Matthew Treinishe2b56b52014-01-29 19:25:50 +0000838 cfg.IntOpt('timeout',
839 default=15,
840 help="Number of seconds to wait on a CLI timeout"),
841]
842
Marc Koderer6ee82dc2014-02-17 10:26:29 +0100843negative_group = cfg.OptGroup(name='negative', title="Negative Test Options")
844
845NegativeGroup = [
846 cfg.StrOpt('test_generator',
847 default='tempest.common.' +
848 'generator.negative_generator.NegativeTestGenerator',
849 help="Test generator class for all negative tests"),
850]
851
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300852
Matthew Treinish43b296a2014-02-28 15:23:00 -0500853def register_opts():
854 register_opt_group(cfg.CONF, compute_group, ComputeGroup)
855 register_opt_group(cfg.CONF, compute_features_group,
856 ComputeFeaturesGroup)
857 register_opt_group(cfg.CONF, identity_group, IdentityGroup)
858 register_opt_group(cfg.CONF, identity_feature_group,
859 IdentityFeatureGroup)
860 register_opt_group(cfg.CONF, image_group, ImageGroup)
861 register_opt_group(cfg.CONF, image_feature_group, ImageFeaturesGroup)
862 register_opt_group(cfg.CONF, network_group, NetworkGroup)
863 register_opt_group(cfg.CONF, network_feature_group,
864 NetworkFeaturesGroup)
Malini Kamalambal6e7b3b82014-02-06 06:49:04 -0500865 register_opt_group(cfg.CONF, queuing_group, QueuingGroup)
Matthew Treinish43b296a2014-02-28 15:23:00 -0500866 register_opt_group(cfg.CONF, volume_group, VolumeGroup)
867 register_opt_group(cfg.CONF, volume_feature_group,
868 VolumeFeaturesGroup)
869 register_opt_group(cfg.CONF, object_storage_group, ObjectStoreGroup)
870 register_opt_group(cfg.CONF, object_storage_feature_group,
871 ObjectStoreFeaturesGroup)
Nikhil Manchandadd6886f2014-03-03 01:58:45 -0800872 register_opt_group(cfg.CONF, database_group, DatabaseGroup)
Matthew Treinish43b296a2014-02-28 15:23:00 -0500873 register_opt_group(cfg.CONF, orchestration_group, OrchestrationGroup)
874 register_opt_group(cfg.CONF, telemetry_group, TelemetryGroup)
875 register_opt_group(cfg.CONF, dashboard_group, DashboardGroup)
876 register_opt_group(cfg.CONF, data_processing_group,
877 DataProcessingGroup)
878 register_opt_group(cfg.CONF, boto_group, BotoGroup)
879 register_opt_group(cfg.CONF, compute_admin_group, ComputeAdminGroup)
880 register_opt_group(cfg.CONF, stress_group, StressGroup)
881 register_opt_group(cfg.CONF, scenario_group, ScenarioGroup)
882 register_opt_group(cfg.CONF, service_available_group,
883 ServiceAvailableGroup)
884 register_opt_group(cfg.CONF, debug_group, DebugGroup)
885 register_opt_group(cfg.CONF, baremetal_group, BaremetalGroup)
886 register_opt_group(cfg.CONF, input_scenario_group, InputScenarioGroup)
887 register_opt_group(cfg.CONF, cli_group, CLIGroup)
Marc Koderer6ee82dc2014-02-17 10:26:29 +0100888 register_opt_group(cfg.CONF, negative_group, NegativeGroup)
Matthew Treinish43b296a2014-02-28 15:23:00 -0500889
890
Sean Dague3b9b1f32013-12-20 17:04:54 -0500891# this should never be called outside of this class
892class TempestConfigPrivate(object):
Daryl Walleck1465d612011-11-02 02:22:15 -0500893 """Provides OpenStack configuration information."""
894
Brian Waldon738cd632011-12-12 18:45:09 -0500895 DEFAULT_CONFIG_DIR = os.path.join(
Zhongyue Luoa1343de2013-01-04 16:21:35 +0800896 os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
Brian Waldon738cd632011-12-12 18:45:09 -0500897 "etc")
Daryl Walleck1465d612011-11-02 02:22:15 -0500898
Brian Waldon738cd632011-12-12 18:45:09 -0500899 DEFAULT_CONFIG_FILE = "tempest.conf"
900
Matthew Treinish43b296a2014-02-28 15:23:00 -0500901 def _set_attrs(self):
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500902 self.compute = cfg.CONF.compute
Matthew Treinishd5c96022013-10-17 21:51:23 +0000903 self.compute_feature_enabled = cfg.CONF['compute-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500904 self.identity = cfg.CONF.identity
Matthew Treinishd5021a72014-01-09 18:42:51 +0000905 self.identity_feature_enabled = cfg.CONF['identity-feature-enabled']
Matt Riedemannd3efe902014-02-10 06:46:38 -0800906 self.image = cfg.CONF.image
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000907 self.image_feature_enabled = cfg.CONF['image-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500908 self.network = cfg.CONF.network
Matthew Treinishe3d26142013-11-26 19:14:58 +0000909 self.network_feature_enabled = cfg.CONF['network-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500910 self.volume = cfg.CONF.volume
Matthew Treinishd5c96022013-10-17 21:51:23 +0000911 self.volume_feature_enabled = cfg.CONF['volume-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500912 self.object_storage = cfg.CONF['object-storage']
Matthew Treinishd5c96022013-10-17 21:51:23 +0000913 self.object_storage_feature_enabled = cfg.CONF[
914 'object-storage-feature-enabled']
Nikhil Manchandadd6886f2014-03-03 01:58:45 -0800915 self.database = cfg.CONF.database
Steve Bakerc60e4e32013-05-06 15:22:41 +1200916 self.orchestration = cfg.CONF.orchestration
Malini Kamalambal6e7b3b82014-02-06 06:49:04 -0500917 self.queuing = cfg.CONF.queuing
Yassine Lamgarchalb158d412013-12-27 19:29:42 +0100918 self.telemetry = cfg.CONF.telemetry
Julie Pichond1017642013-07-24 16:37:23 +0100919 self.dashboard = cfg.CONF.dashboard
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400920 self.data_processing = cfg.CONF.data_processing
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500921 self.boto = cfg.CONF.boto
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100922 self.compute_admin = cfg.CONF['compute-admin']
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500923 self.stress = cfg.CONF.stress
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900924 self.scenario = cfg.CONF.scenario
Matthew Treinish4c412922013-07-16 15:27:42 -0400925 self.service_available = cfg.CONF.service_available
Attila Fazekas5fae7a32013-09-25 16:52:44 +0200926 self.debug = cfg.CONF.debug
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300927 self.baremetal = cfg.CONF.baremetal
Andrea Frittolif5da28b2013-12-06 07:08:07 +0000928 self.input_scenario = cfg.CONF['input-scenario']
Matthew Treinishe2b56b52014-01-29 19:25:50 +0000929 self.cli = cfg.CONF.cli
Marc Koderer6ee82dc2014-02-17 10:26:29 +0100930 self.negative = cfg.CONF.negative
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100931 if not self.compute_admin.username:
932 self.compute_admin.username = self.identity.admin_username
933 self.compute_admin.password = self.identity.admin_password
934 self.compute_admin.tenant_name = self.identity.admin_tenant_name
Sean Dague86bd8422013-12-20 09:56:44 -0500935
Matthew Treinish43b296a2014-02-28 15:23:00 -0500936 def __init__(self, parse_conf=True):
937 """Initialize a configuration from a conf directory and conf file."""
938 super(TempestConfigPrivate, self).__init__()
939 config_files = []
940 failsafe_path = "/etc/tempest/" + self.DEFAULT_CONFIG_FILE
941
942 # Environment variables override defaults...
943 conf_dir = os.environ.get('TEMPEST_CONFIG_DIR',
944 self.DEFAULT_CONFIG_DIR)
945 conf_file = os.environ.get('TEMPEST_CONFIG', self.DEFAULT_CONFIG_FILE)
946
947 path = os.path.join(conf_dir, conf_file)
948
949 if not os.path.isfile(path):
950 path = failsafe_path
951
952 # only parse the config file if we expect one to exist. This is needed
953 # to remove an issue with the config file up to date checker.
954 if parse_conf:
955 config_files.append(path)
956
957 cfg.CONF([], project='tempest', default_config_files=config_files)
958 logging.setup('tempest')
959 LOG = logging.getLogger('tempest')
960 LOG.info("Using tempest config file %s" % path)
961 register_opts()
962 self._set_attrs()
Masayuki Igawa9ec4cd82014-02-05 15:04:16 +0900963 if parse_conf:
964 cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
965
Sean Dague86bd8422013-12-20 09:56:44 -0500966
967class TempestConfigProxy(object):
968 _config = None
969
970 def __getattr__(self, attr):
971 if not self._config:
Sean Dague3b9b1f32013-12-20 17:04:54 -0500972 self._config = TempestConfigPrivate()
Sean Dague86bd8422013-12-20 09:56:44 -0500973
974 return getattr(self._config, attr)
975
976
977CONF = TempestConfigProxy()