blob: d24ab34728c9b7d74e1de924cf381f7fbc5dbd55 [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
Jay Pipes7f757632011-12-02 15:53:32 -050018import os
Jay Pipes3f981df2012-03-27 18:59:44 -040019
Matthew Treinish90aedd12013-02-25 17:56:49 -050020from oslo.config import cfg
21
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -040022from tempest.openstack.common import log as logging
Jay Pipes7f757632011-12-02 15:53:32 -050023
Daryl Walleck1465d612011-11-02 02:22:15 -050024
DennyZhang88a2dd82013-10-07 12:55:35 -050025def register_opt_group(conf, opt_group, options):
26 conf.register_group(opt_group)
27 for opt in options:
28 conf.register_opt(opt, group=opt_group.name)
29
30
Matthew Treinish39e48ef2012-12-21 13:36:15 -050031identity_group = cfg.OptGroup(name='identity',
32 title="Keystone Configuration Options")
Daryl Walleck1465d612011-11-02 02:22:15 -050033
Matthew Treinish39e48ef2012-12-21 13:36:15 -050034IdentityGroup = [
35 cfg.StrOpt('catalog_type',
36 default='identity',
37 help="Catalog type of the Identity service."),
Jay Pipescd8eaec2013-01-16 21:03:48 -050038 cfg.BoolOpt('disable_ssl_certificate_validation',
39 default=False,
40 help="Set to True if using self-signed SSL certificates."),
Jay Pipes7c88eb22013-01-16 21:32:43 -050041 cfg.StrOpt('uri',
42 default=None,
Brant Knudsonc7ca3342013-03-28 21:08:50 -050043 help="Full URI of the OpenStack Identity API (Keystone), v2"),
44 cfg.StrOpt('uri_v3',
45 help='Full URI of the OpenStack Identity API (Keystone), v3'),
Andrea Frittoli8bbdb162014-01-06 11:06:13 +000046 cfg.StrOpt('auth_version',
47 default='v2',
48 help="Identity API version to be used for authentication "
Andrea Frittoli77f9da42014-02-06 11:18:19 +000049 "for API tests."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -050050 cfg.StrOpt('region',
Attila Fazekascadcb1f2013-01-21 23:10:53 +010051 default='RegionOne',
Arata Notsu8f440392013-09-13 16:14:20 +090052 help="The identity region name to use. Also used as the other "
53 "services' region name unless they are set explicitly. "
54 "If no such region is found in the service catalog, the "
55 "first found one is used."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +010056 cfg.StrOpt('username',
57 default='demo',
58 help="Username to use for Nova API requests."),
59 cfg.StrOpt('tenant_name',
60 default='demo',
61 help="Tenant name to use for Nova API requests."),
Russell Sim7f894a52013-09-13 10:35:21 +100062 cfg.StrOpt('admin_role',
63 default='admin',
64 help="Role required to administrate keystone."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +010065 cfg.StrOpt('password',
66 default='pass',
67 help="API key to use when authenticating.",
68 secret=True),
69 cfg.StrOpt('alt_username',
70 default=None,
71 help="Username of alternate user to use for Nova API "
72 "requests."),
73 cfg.StrOpt('alt_tenant_name',
74 default=None,
75 help="Alternate user's Tenant name to use for Nova API "
76 "requests."),
77 cfg.StrOpt('alt_password',
78 default=None,
79 help="API key to use when authenticating as alternate user.",
80 secret=True),
81 cfg.StrOpt('admin_username',
82 default='admin',
Dirk Mueller14bd5622014-01-14 19:33:05 +010083 help="Administrative Username to use for "
Attila Fazekascadcb1f2013-01-21 23:10:53 +010084 "Keystone API requests."),
85 cfg.StrOpt('admin_tenant_name',
86 default='admin',
87 help="Administrative Tenant name to use for Keystone API "
88 "requests."),
89 cfg.StrOpt('admin_password',
90 default='pass',
91 help="API key to use when authenticating as admin.",
92 secret=True),
Matthew Treinish39e48ef2012-12-21 13:36:15 -050093]
Jay Pipes3f981df2012-03-27 18:59:44 -040094
Matthew Treinishd5021a72014-01-09 18:42:51 +000095identity_feature_group = cfg.OptGroup(name='identity-feature-enabled',
96 title='Enabled Identity Features')
97
98IdentityFeatureGroup = [
99 cfg.BoolOpt('trust',
100 default=True,
101 help='Does the identity service have delegation and '
102 'impersonation enabled')
103]
104
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500105compute_group = cfg.OptGroup(name='compute',
106 title='Compute Service Options')
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800107
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500108ComputeGroup = [
109 cfg.BoolOpt('allow_tenant_isolation',
110 default=False,
111 help="Allows test cases to create/destroy tenants and "
112 "users. This option enables isolated test cases and "
113 "better parallel execution, but also requires that "
114 "OpenStack Identity API admin credentials are known."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500115 cfg.StrOpt('image_ref',
116 default="{$IMAGE_ID}",
117 help="Valid secondary image reference to be used in tests."),
118 cfg.StrOpt('image_ref_alt',
119 default="{$IMAGE_ID_ALT}",
120 help="Valid secondary image reference to be used in tests."),
Ken'ichi Ohmichi35772602013-11-14 15:03:27 +0900121 cfg.StrOpt('flavor_ref',
122 default="1",
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500123 help="Valid primary flavor to use in tests."),
Ken'ichi Ohmichi35772602013-11-14 15:03:27 +0900124 cfg.StrOpt('flavor_ref_alt',
125 default="2",
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500126 help='Valid secondary flavor to be used in tests.'),
Maru Newbyaf292e82013-05-20 21:32:28 +0000127 cfg.StrOpt('image_ssh_user',
128 default="root",
129 help="User name used to authenticate to an instance."),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700130 cfg.StrOpt('image_ssh_password',
131 default="password",
132 help="Password used to authenticate to an instance."),
Maru Newbyaf292e82013-05-20 21:32:28 +0000133 cfg.StrOpt('image_alt_ssh_user',
134 default="root",
135 help="User name used to authenticate to an instance using "
136 "the alternate image."),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700137 cfg.StrOpt('image_alt_ssh_password',
138 default="password",
139 help="Password used to authenticate to an instance using "
140 "the alternate image."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500141 cfg.IntOpt('build_interval',
142 default=10,
143 help="Time in seconds between build status checks."),
144 cfg.IntOpt('build_timeout',
145 default=300,
146 help="Timeout in seconds to wait for an instance to build."),
147 cfg.BoolOpt('run_ssh',
148 default=False,
Derek Higgins85cd5142013-12-17 17:10:11 +0000149 help="Should the tests ssh to instances?"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500150 cfg.StrOpt('ssh_user',
151 default='root',
152 help="User name used to authenticate to an instance."),
Nachi Ueno6d580be2013-07-24 10:58:11 -0700153 cfg.IntOpt('ping_timeout',
Darragh O'Reilly6b636672014-01-24 12:17:40 +0000154 default=120,
Nachi Ueno6d580be2013-07-24 10:58:11 -0700155 help="Timeout in seconds to wait for ping to "
156 "succeed."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500157 cfg.IntOpt('ssh_timeout',
158 default=300,
Chris Yeoh76916042013-02-27 16:25:25 +1030159 help="Timeout in seconds to wait for authentication to "
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500160 "succeed."),
Attila Fazekas0abbc952013-07-01 19:19:42 +0200161 cfg.IntOpt('ready_wait',
162 default=0,
DennyZhang8912d012013-09-25 18:08:34 -0500163 help="Additional wait time for clean state, when there is "
164 "no OS-EXT-STS extension available"),
Chris Yeoh76916042013-02-27 16:25:25 +1030165 cfg.IntOpt('ssh_channel_timeout',
166 default=60,
167 help="Timeout in seconds to wait for output from ssh "
168 "channel."),
Attila Fazekasb0661652013-05-08 13:01:36 +0200169 cfg.StrOpt('fixed_network_name',
170 default='private',
171 help="Visible fixed network name "),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500172 cfg.StrOpt('network_for_ssh',
173 default='public',
174 help="Network used for SSH connections."),
175 cfg.IntOpt('ip_version_for_ssh',
176 default=4,
177 help="IP version used for SSH connections."),
fujioka yuuichia11994e2013-07-09 11:19:51 +0900178 cfg.BoolOpt('use_floatingip_for_ssh',
179 default=True,
180 help="Dose the SSH uses Floating IP?"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500181 cfg.StrOpt('catalog_type',
182 default='compute',
183 help="Catalog type of the Compute service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900184 cfg.StrOpt('region',
185 default='',
186 help="The compute region name to use. If empty, the value "
187 "of identity.region is used instead. If no such region "
188 "is found in the service catalog, the first found one is "
189 "used."),
ivan-zhu8f992be2013-07-31 14:56:58 +0800190 cfg.StrOpt('catalog_v3_type',
191 default='computev3',
192 help="Catalog type of the Compute v3 service."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100193 cfg.StrOpt('path_to_private_key',
194 default=None,
195 help="Path to a private key file for SSH access to remote "
196 "hosts"),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700197 cfg.StrOpt('volume_device_name',
198 default='vdb',
199 help="Expected device name when a volume is attached to "
Ken'ichi Ohmichi39437e22013-10-06 00:21:38 +0900200 "an instance"),
201 cfg.IntOpt('shelved_offload_time',
202 default=0,
203 help='Time in seconds before a shelved instance is eligible '
204 'for removing from a host. -1 never offload, 0 offload '
205 'when shelved. This time should be the same as the time '
206 'of nova.conf, and some tests will run for as long as the '
207 'time.')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500208]
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800209
Matthew Treinishd5c96022013-10-17 21:51:23 +0000210compute_features_group = cfg.OptGroup(name='compute-feature-enabled',
211 title="Enabled Compute Service Features")
212
213ComputeFeaturesGroup = [
ivan-zhu8f992be2013-07-31 14:56:58 +0800214 cfg.BoolOpt('api_v3',
Chris Yeohfbc15de2013-11-26 10:20:08 +1030215 default=True,
ivan-zhu8f992be2013-07-31 14:56:58 +0800216 help="If false, skip all nova v3 tests."),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000217 cfg.BoolOpt('disk_config',
218 default=True,
219 help="If false, skip disk config tests"),
Matthew Treinishe3d26142013-11-26 19:14:58 +0000220 cfg.ListOpt('api_extensions',
221 default=['all'],
222 help='A list of enabled extensions with a special entry all '
223 'which indicates every extension is enabled'),
224 cfg.ListOpt('api_v3_extensions',
225 default=['all'],
226 help='A list of enabled v3 extensions with a special entry all'
227 ' which indicates every extension is enabled'),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000228 cfg.BoolOpt('change_password',
229 default=False,
230 help="Does the test environment support changing the admin "
231 "password?"),
232 cfg.BoolOpt('create_image',
233 default=False,
234 help="Does the test environment support snapshots?"),
235 cfg.BoolOpt('resize',
236 default=False,
237 help="Does the test environment support resizing?"),
238 cfg.BoolOpt('live_migration',
239 default=False,
240 help="Does the test environment support live migration "
241 "available?"),
242 cfg.BoolOpt('block_migration_for_live_migration',
243 default=False,
244 help="Does the test environment use block devices for live "
245 "migration"),
246 cfg.BoolOpt('block_migrate_cinder_iscsi',
247 default=False,
248 help="Does the test environment block migration support "
249 "cinder iSCSI volumes")
250]
251
252
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500253compute_admin_group = cfg.OptGroup(name='compute-admin',
254 title="Compute Admin Options")
donald-ngo7fb1efa2011-12-13 17:17:36 -0800255
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500256ComputeAdminGroup = [
257 cfg.StrOpt('username',
258 default='admin',
259 help="Administrative Username to use for Nova API requests."),
260 cfg.StrOpt('tenant_name',
261 default='admin',
262 help="Administrative Tenant name to use for Nova API "
263 "requests."),
264 cfg.StrOpt('password',
265 default='pass',
266 help="API key to use when authenticating as admin.",
267 secret=True),
268]
Daryl Walleck587385b2012-03-03 13:00:26 -0600269
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500270image_group = cfg.OptGroup(name='image',
271 title="Image Service Options")
Jay Pipesf38eaac2012-06-21 13:37:35 -0400272
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500273ImageGroup = [
Matthew Treinish72ea4422013-02-07 14:42:49 -0500274 cfg.StrOpt('catalog_type',
275 default='image',
Sean Dague83401992013-05-06 17:46:36 -0400276 help='Catalog type of the Image service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900277 cfg.StrOpt('region',
278 default='',
279 help="The image region name to use. If empty, the value "
280 "of identity.region is used instead. If no such region "
281 "is found in the service catalog, the first found one is "
282 "used."),
Sean Dague83401992013-05-06 17:46:36 -0400283 cfg.StrOpt('http_image',
284 default='http://download.cirros-cloud.net/0.3.1/'
285 'cirros-0.3.1-x86_64-uec.tar.gz',
DennyZhang8912d012013-09-25 18:08:34 -0500286 help='http accessible image')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500287]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400288
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000289image_feature_group = cfg.OptGroup(name='image-feature-enabled',
290 title='Enabled image service features')
291
292ImageFeaturesGroup = [
293 cfg.BoolOpt('api_v2',
294 default=True,
295 help="Is the v2 image API enabled"),
296 cfg.BoolOpt('api_v1',
297 default=True,
298 help="Is the v1 image API enabled"),
299]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400300
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500301network_group = cfg.OptGroup(name='network',
302 title='Network Service Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600303
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500304NetworkGroup = [
305 cfg.StrOpt('catalog_type',
306 default='network',
Mark McClainf2982e82013-07-06 17:48:03 -0400307 help='Catalog type of the Neutron service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900308 cfg.StrOpt('region',
309 default='',
310 help="The network region name to use. If empty, the value "
311 "of identity.region is used instead. If no such region "
312 "is found in the service catalog, the first found one is "
313 "used."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500314 cfg.StrOpt('tenant_network_cidr',
315 default="10.100.0.0/16",
316 help="The cidr block to allocate tenant networks from"),
317 cfg.IntOpt('tenant_network_mask_bits',
Attila Fazekas8ea181b2013-07-13 16:26:14 +0200318 default=28,
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500319 help="The mask bits for tenant networks"),
320 cfg.BoolOpt('tenant_networks_reachable',
321 default=False,
322 help="Whether tenant network connectivity should be "
323 "evaluated directly"),
324 cfg.StrOpt('public_network_id',
325 default="",
326 help="Id of the public network that provides external "
327 "connectivity"),
328 cfg.StrOpt('public_router_id',
329 default="",
330 help="Id of the public router that provides external "
331 "connectivity"),
332]
Jay Pipes3f981df2012-03-27 18:59:44 -0400333
Matthew Treinishe3d26142013-11-26 19:14:58 +0000334network_feature_group = cfg.OptGroup(name='network-feature-enabled',
335 title='Enabled network service features')
336
337NetworkFeaturesGroup = [
338 cfg.ListOpt('api_extensions',
339 default=['all'],
340 help='A list of enabled extensions with a special entry all '
341 'which indicates every extension is enabled'),
342]
343
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500344volume_group = cfg.OptGroup(name='volume',
345 title='Block Storage Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600346
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500347VolumeGroup = [
348 cfg.IntOpt('build_interval',
349 default=10,
350 help='Time in seconds between volume availability checks.'),
351 cfg.IntOpt('build_timeout',
352 default=300,
353 help='Timeout in seconds to wait for a volume to become'
354 'available.'),
355 cfg.StrOpt('catalog_type',
Matthew Treinisheb724512013-10-25 15:12:59 +0000356 default='volume',
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500357 help="Catalog type of the Volume Service"),
Arata Notsu8f440392013-09-13 16:14:20 +0900358 cfg.StrOpt('region',
359 default='',
360 help="The volume region name to use. If empty, the value "
361 "of identity.region is used instead. If no such region "
362 "is found in the service catalog, the first found one is "
363 "used."),
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100364 cfg.StrOpt('backend1_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200365 default='BACKEND_1',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100366 help="Name of the backend1 (must be declared in cinder.conf)"),
367 cfg.StrOpt('backend2_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200368 default='BACKEND_2',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100369 help="Name of the backend2 (must be declared in cinder.conf)"),
Adam Gandelman827ad332013-06-24 17:04:09 -0700370 cfg.StrOpt('storage_protocol',
371 default='iSCSI',
372 help='Backend protocol to target when creating volume types'),
373 cfg.StrOpt('vendor_name',
374 default='Open Source',
375 help='Backend vendor to target when creating volume types'),
Ryan Hsua67f4632013-08-29 16:03:06 -0700376 cfg.StrOpt('disk_format',
377 default='raw',
378 help='Disk format to use when copying a volume to image'),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500379]
K Jonathan Harkerd6ba4b42012-12-18 13:50:47 -0800380
Matthew Treinishd5c96022013-10-17 21:51:23 +0000381volume_feature_group = cfg.OptGroup(name='volume-feature-enabled',
382 title='Enabled Cinder Features')
383
384VolumeFeaturesGroup = [
385 cfg.BoolOpt('multi_backend',
386 default=False,
Matthew Treinishe3d26142013-11-26 19:14:58 +0000387 help="Runs Cinder multi-backend test (requires 2 backends)"),
388 cfg.ListOpt('api_extensions',
389 default=['all'],
390 help='A list of enabled extensions with a special entry all '
391 'which indicates every extension is enabled'),
Zhi Kun Liubb363a22013-11-28 18:47:39 +0800392 cfg.BoolOpt('api_v1',
393 default=True,
394 help="Is the v1 volume API enabled"),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000395]
396
Daryl Walleck587385b2012-03-03 13:00:26 -0600397
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500398object_storage_group = cfg.OptGroup(name='object-storage',
399 title='Object Storage Service Options')
Attila Fazekasa23f5002012-10-23 19:32:45 +0200400
DennyZhang1e71b612013-09-26 12:35:40 -0500401ObjectStoreGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500402 cfg.StrOpt('catalog_type',
403 default='object-store',
404 help="Catalog type of the Object-Storage service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900405 cfg.StrOpt('region',
406 default='',
407 help="The object-storage region name to use. If empty, the "
408 "value of identity.region is used instead. If no such "
409 "region is found in the service catalog, the first found "
410 "one is used."),
Matthew Treinishf319a732013-10-24 21:39:24 +0000411 cfg.IntOpt('container_sync_timeout',
nayna-patelb4989b32013-01-09 06:25:13 +0000412 default=120,
Fabien Boucher2178d312013-12-31 15:38:57 +0100413 help="Number of seconds to time on waiting for a container "
nayna-patelb4989b32013-01-09 06:25:13 +0000414 "to container synchronization complete."),
Matthew Treinishf319a732013-10-24 21:39:24 +0000415 cfg.IntOpt('container_sync_interval',
nayna-patelb4989b32013-01-09 06:25:13 +0000416 default=5,
Fabien Boucher2178d312013-12-31 15:38:57 +0100417 help="Number of seconds to wait while looping to check the "
nayna-patelb4989b32013-01-09 06:25:13 +0000418 "status of a container to container synchronization"),
Matthew Treinish3fdb80c2013-08-15 11:13:19 -0400419 cfg.StrOpt('operator_role',
420 default='Member',
421 help="Role to add to users created for swift tests to "
422 "enable creating containers"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500423]
Attila Fazekasa23f5002012-10-23 19:32:45 +0200424
Matthew Treinishd5c96022013-10-17 21:51:23 +0000425object_storage_feature_group = cfg.OptGroup(
426 name='object-storage-feature-enabled',
427 title='Enabled object-storage features')
428
429ObjectStoreFeaturesGroup = [
Matthew Treinish20345382013-12-13 17:04:23 +0000430 cfg.ListOpt('discoverable_apis',
431 default=['all'],
432 help="A list of the enabled optional discoverable apis. "
433 "A single entry, all, indicates that all of these "
434 "features are expected to be enabled"),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000435]
436
Attila Fazekasa23f5002012-10-23 19:32:45 +0200437
Steve Bakerc60e4e32013-05-06 15:22:41 +1200438orchestration_group = cfg.OptGroup(name='orchestration',
439 title='Orchestration Service Options')
440
441OrchestrationGroup = [
442 cfg.StrOpt('catalog_type',
443 default='orchestration',
444 help="Catalog type of the Orchestration service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900445 cfg.StrOpt('region',
446 default='',
447 help="The orchestration region name to use. If empty, the "
448 "value of identity.region is used instead. If no such "
449 "region is found in the service catalog, the first found "
450 "one is used."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200451 cfg.BoolOpt('allow_tenant_isolation',
452 default=False,
453 help="Allows test cases to create/destroy tenants and "
454 "users. This option enables isolated test cases and "
455 "better parallel execution, but also requires that "
456 "OpenStack Identity API admin credentials are known."),
457 cfg.IntOpt('build_interval',
458 default=1,
459 help="Time in seconds between build status checks."),
460 cfg.IntOpt('build_timeout',
461 default=300,
462 help="Timeout in seconds to wait for a stack to build."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200463 cfg.StrOpt('instance_type',
Steve Baker9e86b832013-05-22 15:40:28 +1200464 default='m1.micro',
Steve Bakerc60e4e32013-05-06 15:22:41 +1200465 help="Instance type for tests. Needs to be big enough for a "
466 "full OS plus the test workload"),
467 cfg.StrOpt('image_ref',
468 default=None,
469 help="Name of heat-cfntools enabled image to use when "
470 "launching test instances."),
471 cfg.StrOpt('keypair_name',
472 default=None,
473 help="Name of existing keypair to launch servers with."),
Clint Byrum71f27632013-09-09 11:41:32 -0700474 cfg.IntOpt('max_template_size',
Joe Gordon0e51b222013-10-24 14:11:10 +0100475 default=524288,
Clint Byrum71f27632013-09-09 11:41:32 -0700476 help="Value must match heat configuration of the same name."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200477]
478
479
Yassine Lamgarchalb158d412013-12-27 19:29:42 +0100480telemetry_group = cfg.OptGroup(name='telemetry',
481 title='Telemetry Service Options')
482
483TelemetryGroup = [
484 cfg.StrOpt('catalog_type',
485 default='metering',
486 help="Catalog type of the Telemetry service."),
487]
488
489
Julie Pichond1017642013-07-24 16:37:23 +0100490dashboard_group = cfg.OptGroup(name="dashboard",
491 title="Dashboard options")
492
493DashboardGroup = [
494 cfg.StrOpt('dashboard_url',
495 default='http://localhost/',
496 help="Where the dashboard can be found"),
497 cfg.StrOpt('login_url',
498 default='http://localhost/auth/login/',
499 help="Login page for the dashboard"),
500]
501
502
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400503data_processing_group = cfg.OptGroup(name="data_processing",
504 title="Data Processing options")
505
506DataProcessingGroup = [
507 cfg.StrOpt('catalog_type',
508 default='data_processing',
509 help="Catalog type of the data processing service.")
510]
511
512
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500513boto_group = cfg.OptGroup(name='boto',
514 title='EC2/S3 options')
DennyZhang1e71b612013-09-26 12:35:40 -0500515BotoGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500516 cfg.StrOpt('ec2_url',
517 default="http://localhost:8773/services/Cloud",
518 help="EC2 URL"),
519 cfg.StrOpt('s3_url',
520 default="http://localhost:8080",
521 help="S3 URL"),
522 cfg.StrOpt('aws_secret',
523 default=None,
524 help="AWS Secret Key",
525 secret=True),
526 cfg.StrOpt('aws_access',
527 default=None,
528 help="AWS Access Key"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500529 cfg.StrOpt('s3_materials_path',
530 default="/opt/stack/devstack/files/images/"
531 "s3-materials/cirros-0.3.0",
532 help="S3 Materials Path"),
533 cfg.StrOpt('ari_manifest',
534 default="cirros-0.3.0-x86_64-initrd.manifest.xml",
535 help="ARI Ramdisk Image manifest"),
536 cfg.StrOpt('ami_manifest',
537 default="cirros-0.3.0-x86_64-blank.img.manifest.xml",
538 help="AMI Machine Image manifest"),
539 cfg.StrOpt('aki_manifest',
540 default="cirros-0.3.0-x86_64-vmlinuz.manifest.xml",
541 help="AKI Kernel Image manifest"),
542 cfg.StrOpt('instance_type',
543 default="m1.tiny",
544 help="Instance type"),
545 cfg.IntOpt('http_socket_timeout',
546 default=3,
547 help="boto Http socket timeout"),
548 cfg.IntOpt('num_retries',
549 default=1,
550 help="boto num_retries on error"),
551 cfg.IntOpt('build_timeout',
552 default=60,
553 help="Status Change Timeout"),
554 cfg.IntOpt('build_interval',
555 default=1,
556 help="Status Change Test Interval"),
557]
Attila Fazekasf7f2d932012-12-13 09:14:38 +0100558
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500559stress_group = cfg.OptGroup(name='stress', title='Stress Test Options')
560
561StressGroup = [
562 cfg.StrOpt('nova_logdir',
563 default=None,
564 help='Directory containing log files on the compute nodes'),
565 cfg.IntOpt('max_instances',
566 default=16,
567 help='Maximum number of instances to create during test.'),
568 cfg.StrOpt('controller',
569 default=None,
David Kranzb9d97502013-05-01 15:55:04 -0400570 help='Controller host.'),
571 # new stress options
572 cfg.StrOpt('target_controller',
573 default=None,
574 help='Controller host.'),
575 cfg.StrOpt('target_ssh_user',
576 default=None,
577 help='ssh user.'),
578 cfg.StrOpt('target_private_key_path',
579 default=None,
580 help='Path to private key.'),
581 cfg.StrOpt('target_logfiles',
582 default=None,
583 help='regexp for list of log files.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000584 cfg.IntOpt('log_check_interval',
David Kranzb9d97502013-05-01 15:55:04 -0400585 default=60,
Marc Koderer32221b8e2013-08-23 13:57:50 +0200586 help='time (in seconds) between log file error checks.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000587 cfg.IntOpt('default_thread_number_per_action',
Marc Koderer32221b8e2013-08-23 13:57:50 +0200588 default=4,
Julien Leloup04d40f72014-01-28 11:17:18 +0100589 help='The number of threads created while stress test.'),
590 cfg.BoolOpt('leave_dirty_stack',
591 default=False,
592 help='Prevent the cleaning (tearDownClass()) between'
593 ' each stress test run if an exception occurs'
594 ' during this run.')
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500595]
596
597
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900598scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options')
599
600ScenarioGroup = [
601 cfg.StrOpt('img_dir',
602 default='/opt/stack/new/devstack/files/images/'
603 'cirros-0.3.1-x86_64-uec',
604 help='Directory containing image files'),
605 cfg.StrOpt('ami_img_file',
606 default='cirros-0.3.1-x86_64-blank.img',
607 help='AMI image file name'),
608 cfg.StrOpt('ari_img_file',
609 default='cirros-0.3.1-x86_64-initrd',
610 help='ARI image file name'),
611 cfg.StrOpt('aki_img_file',
612 default='cirros-0.3.1-x86_64-vmlinuz',
613 help='AKI image file name'),
614 cfg.StrOpt('ssh_user',
615 default='cirros',
Joe Gordonb5e10cd2013-07-10 15:51:12 +0000616 help='ssh username for the image file'),
617 cfg.IntOpt(
618 'large_ops_number',
619 default=0,
620 help="specifies how many resources to request at once. Used "
621 "for large operations testing.")
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900622]
623
624
Matthew Treinish4c412922013-07-16 15:27:42 -0400625service_available_group = cfg.OptGroup(name="service_available",
626 title="Available OpenStack Services")
627
628ServiceAvailableGroup = [
629 cfg.BoolOpt('cinder',
630 default=True,
631 help="Whether or not cinder is expected to be available"),
Matthew Treinishfaa340d2013-07-19 16:26:21 -0400632 cfg.BoolOpt('neutron',
633 default=False,
634 help="Whether or not neutron is expected to be available"),
Matthew Treinish853ae442013-07-19 16:36:07 -0400635 cfg.BoolOpt('glance',
636 default=True,
637 help="Whether or not glance is expected to be available"),
Matthew Treinish61e332b2013-07-19 16:42:31 -0400638 cfg.BoolOpt('swift',
639 default=True,
640 help="Whether or not swift is expected to be available"),
Matthew Treinish6b41e242013-07-19 16:49:28 -0400641 cfg.BoolOpt('nova',
642 default=True,
643 help="Whether or not nova is expected to be available"),
Matthew Treinisha9d43882013-07-19 16:54:52 -0400644 cfg.BoolOpt('heat',
645 default=False,
646 help="Whether or not Heat is expected to be available"),
Mehdi Abaakouk8581c0b2013-10-04 10:45:42 +0200647 cfg.BoolOpt('ceilometer',
648 default=True,
649 help="Whether or not Ceilometer is expected to be available"),
Julie Pichond1017642013-07-24 16:37:23 +0100650 cfg.BoolOpt('horizon',
651 default=True,
652 help="Whether or not Horizon is expected to be available"),
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400653 cfg.BoolOpt('savanna',
654 default=False,
655 help="Whether or not Savanna is expected to be available"),
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300656 cfg.BoolOpt('ironic',
657 default=False,
658 help="Whether or not Ironic is expected to be available"),
Matthew Treinish4c412922013-07-16 15:27:42 -0400659]
660
Attila Fazekasaeeeefd2013-08-06 17:01:56 +0200661debug_group = cfg.OptGroup(name="debug",
662 title="Debug System")
663
664DebugGroup = [
665 cfg.BoolOpt('enable',
666 default=True,
667 help="Enable diagnostic commands"),
668]
669
Andrea Frittolif5da28b2013-12-06 07:08:07 +0000670input_scenario_group = cfg.OptGroup(name="input-scenario",
671 title="Filters and values for"
672 " input scenarios")
673
674InputScenarioGroup = [
675 cfg.StrOpt('image_regex',
676 default='^cirros-0.3.1-x86_64-uec$',
677 help="Matching images become parameters for scenario tests"),
678 cfg.StrOpt('flavor_regex',
Andrea Frittoli99901c02014-01-30 18:06:49 +0000679 default='^m1.nano$',
Andrea Frittolif5da28b2013-12-06 07:08:07 +0000680 help="Matching flavors become parameters for scenario tests"),
681 cfg.StrOpt('non_ssh_image_regex',
682 default='^.*[Ww]in.*$',
683 help="SSH verification in tests is skipped"
684 "for matching images"),
685 cfg.StrOpt('ssh_user_regex',
686 default="[[\"^.*[Cc]irros.*$\", \"root\"]]",
687 help="List of user mapped to regex "
688 "to matching image names."),
689]
690
Attila Fazekasaeeeefd2013-08-06 17:01:56 +0200691
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300692baremetal_group = cfg.OptGroup(name='baremetal',
693 title='Baremetal provisioning service options')
694
695BaremetalGroup = [
696 cfg.StrOpt('catalog_type',
697 default='baremetal',
698 help="Catalog type of the baremetal provisioning service."),
699]
700
Matthew Treinishe2b56b52014-01-29 19:25:50 +0000701cli_group = cfg.OptGroup(name='cli', title="cli Configuration Options")
702
703CLIGroup = [
704 cfg.BoolOpt('enabled',
705 default=True,
706 help="enable cli tests"),
707 cfg.StrOpt('cli_dir',
708 default='/usr/local/bin',
709 help="directory where python client binaries are located"),
710 cfg.IntOpt('timeout',
711 default=15,
712 help="Number of seconds to wait on a CLI timeout"),
713]
714
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300715
Sean Dague3b9b1f32013-12-20 17:04:54 -0500716# this should never be called outside of this class
717class TempestConfigPrivate(object):
Daryl Walleck1465d612011-11-02 02:22:15 -0500718 """Provides OpenStack configuration information."""
719
Brian Waldon738cd632011-12-12 18:45:09 -0500720 DEFAULT_CONFIG_DIR = os.path.join(
Zhongyue Luoa1343de2013-01-04 16:21:35 +0800721 os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
Brian Waldon738cd632011-12-12 18:45:09 -0500722 "etc")
Daryl Walleck1465d612011-11-02 02:22:15 -0500723
Brian Waldon738cd632011-12-12 18:45:09 -0500724 DEFAULT_CONFIG_FILE = "tempest.conf"
725
Sean Dague2ec4c2c2013-12-22 11:30:06 -0500726 def __init__(self, parse_conf=True):
Brian Waldon738cd632011-12-12 18:45:09 -0500727 """Initialize a configuration from a conf directory and conf file."""
Sean Dague3b9b1f32013-12-20 17:04:54 -0500728 super(TempestConfigPrivate, self).__init__()
Sean Dague2416cf32013-04-10 08:29:07 -0400729 config_files = []
Sean Dague2416cf32013-04-10 08:29:07 -0400730 failsafe_path = "/etc/tempest/" + self.DEFAULT_CONFIG_FILE
Brian Waldon738cd632011-12-12 18:45:09 -0500731
732 # Environment variables override defaults...
733 conf_dir = os.environ.get('TEMPEST_CONFIG_DIR',
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800734 self.DEFAULT_CONFIG_DIR)
735 conf_file = os.environ.get('TEMPEST_CONFIG', self.DEFAULT_CONFIG_FILE)
Brian Waldon738cd632011-12-12 18:45:09 -0500736
Jay Pipes7f757632011-12-02 15:53:32 -0500737 path = os.path.join(conf_dir, conf_file)
738
Matthew Treinish56041db2014-01-21 23:30:43 +0000739 if not os.path.isfile(path):
Sean Dague2416cf32013-04-10 08:29:07 -0400740 path = failsafe_path
Attila Fazekas5abb2532012-12-04 11:30:49 +0100741
Sean Dague2ec4c2c2013-12-22 11:30:06 -0500742 # only parse the config file if we expect one to exist. This is needed
743 # to remove an issue with the config file up to date checker.
744 if parse_conf:
Sean Dague2416cf32013-04-10 08:29:07 -0400745 config_files.append(path)
Jay Pipes7f757632011-12-02 15:53:32 -0500746
Sean Dague2416cf32013-04-10 08:29:07 -0400747 cfg.CONF([], project='tempest', default_config_files=config_files)
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -0400748 logging.setup('tempest')
749 LOG = logging.getLogger('tempest')
750 LOG.info("Using tempest config file %s" % path)
Daryl Walleck1465d612011-11-02 02:22:15 -0500751
DennyZhang88a2dd82013-10-07 12:55:35 -0500752 register_opt_group(cfg.CONF, compute_group, ComputeGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000753 register_opt_group(cfg.CONF, compute_features_group,
754 ComputeFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500755 register_opt_group(cfg.CONF, identity_group, IdentityGroup)
Matthew Treinishd5021a72014-01-09 18:42:51 +0000756 register_opt_group(cfg.CONF, identity_feature_group,
757 IdentityFeatureGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500758 register_opt_group(cfg.CONF, image_group, ImageGroup)
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000759 register_opt_group(cfg.CONF, image_feature_group, ImageFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500760 register_opt_group(cfg.CONF, network_group, NetworkGroup)
Matthew Treinishe3d26142013-11-26 19:14:58 +0000761 register_opt_group(cfg.CONF, network_feature_group,
762 NetworkFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500763 register_opt_group(cfg.CONF, volume_group, VolumeGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000764 register_opt_group(cfg.CONF, volume_feature_group,
765 VolumeFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500766 register_opt_group(cfg.CONF, object_storage_group, ObjectStoreGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000767 register_opt_group(cfg.CONF, object_storage_feature_group,
768 ObjectStoreFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500769 register_opt_group(cfg.CONF, orchestration_group, OrchestrationGroup)
Yassine Lamgarchalb158d412013-12-27 19:29:42 +0100770 register_opt_group(cfg.CONF, telemetry_group, TelemetryGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500771 register_opt_group(cfg.CONF, dashboard_group, DashboardGroup)
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400772 register_opt_group(cfg.CONF, data_processing_group,
773 DataProcessingGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500774 register_opt_group(cfg.CONF, boto_group, BotoGroup)
775 register_opt_group(cfg.CONF, compute_admin_group, ComputeAdminGroup)
776 register_opt_group(cfg.CONF, stress_group, StressGroup)
777 register_opt_group(cfg.CONF, scenario_group, ScenarioGroup)
778 register_opt_group(cfg.CONF, service_available_group,
779 ServiceAvailableGroup)
780 register_opt_group(cfg.CONF, debug_group, DebugGroup)
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300781 register_opt_group(cfg.CONF, baremetal_group, BaremetalGroup)
Andrea Frittolif5da28b2013-12-06 07:08:07 +0000782 register_opt_group(cfg.CONF, input_scenario_group, InputScenarioGroup)
Matthew Treinishe2b56b52014-01-29 19:25:50 +0000783 register_opt_group(cfg.CONF, cli_group, CLIGroup)
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500784 self.compute = cfg.CONF.compute
Matthew Treinishd5c96022013-10-17 21:51:23 +0000785 self.compute_feature_enabled = cfg.CONF['compute-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500786 self.identity = cfg.CONF.identity
Matthew Treinishd5021a72014-01-09 18:42:51 +0000787 self.identity_feature_enabled = cfg.CONF['identity-feature-enabled']
Matt Riedemannd3efe902014-02-10 06:46:38 -0800788 self.image = cfg.CONF.image
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000789 self.image_feature_enabled = cfg.CONF['image-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500790 self.network = cfg.CONF.network
Matthew Treinishe3d26142013-11-26 19:14:58 +0000791 self.network_feature_enabled = cfg.CONF['network-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500792 self.volume = cfg.CONF.volume
Matthew Treinishd5c96022013-10-17 21:51:23 +0000793 self.volume_feature_enabled = cfg.CONF['volume-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500794 self.object_storage = cfg.CONF['object-storage']
Matthew Treinishd5c96022013-10-17 21:51:23 +0000795 self.object_storage_feature_enabled = cfg.CONF[
796 'object-storage-feature-enabled']
Steve Bakerc60e4e32013-05-06 15:22:41 +1200797 self.orchestration = cfg.CONF.orchestration
Yassine Lamgarchalb158d412013-12-27 19:29:42 +0100798 self.telemetry = cfg.CONF.telemetry
Julie Pichond1017642013-07-24 16:37:23 +0100799 self.dashboard = cfg.CONF.dashboard
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400800 self.data_processing = cfg.CONF.data_processing
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500801 self.boto = cfg.CONF.boto
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100802 self.compute_admin = cfg.CONF['compute-admin']
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500803 self.stress = cfg.CONF.stress
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900804 self.scenario = cfg.CONF.scenario
Matthew Treinish4c412922013-07-16 15:27:42 -0400805 self.service_available = cfg.CONF.service_available
Attila Fazekas5fae7a32013-09-25 16:52:44 +0200806 self.debug = cfg.CONF.debug
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300807 self.baremetal = cfg.CONF.baremetal
Andrea Frittolif5da28b2013-12-06 07:08:07 +0000808 self.input_scenario = cfg.CONF['input-scenario']
Matthew Treinishe2b56b52014-01-29 19:25:50 +0000809 self.cli = cfg.CONF.cli
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100810 if not self.compute_admin.username:
811 self.compute_admin.username = self.identity.admin_username
812 self.compute_admin.password = self.identity.admin_password
813 self.compute_admin.tenant_name = self.identity.admin_tenant_name
Sean Dague86bd8422013-12-20 09:56:44 -0500814
815
816class TempestConfigProxy(object):
817 _config = None
818
819 def __getattr__(self, attr):
820 if not self._config:
Sean Dague3b9b1f32013-12-20 17:04:54 -0500821 self._config = TempestConfigPrivate()
Sean Dague86bd8422013-12-20 09:56:44 -0500822
823 return getattr(self._config, attr)
824
825
826CONF = TempestConfigProxy()