blob: 4d86c4e100cc8307da43d0f8d100dda76a0adec9 [file] [log] [blame]
Jay Pipes3f981df2012-03-27 18:59:44 -04001# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
ZhiQiang Fan39f97222013-09-20 04:49:44 +08003# Copyright 2012 OpenStack Foundation
Jay Pipes3f981df2012-03-27 18:59:44 -04004# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
Dirk Muellere746fc22013-06-29 16:29:29 +020018from __future__ import print_function
19
Jay Pipes7f757632011-12-02 15:53:32 -050020import os
Jay Pipes3f981df2012-03-27 18:59:44 -040021
Matthew Treinish90aedd12013-02-25 17:56:49 -050022from oslo.config import cfg
23
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -040024from tempest.openstack.common import log as logging
Jay Pipes7f757632011-12-02 15:53:32 -050025
Daryl Walleck1465d612011-11-02 02:22:15 -050026
DennyZhang88a2dd82013-10-07 12:55:35 -050027def register_opt_group(conf, opt_group, options):
28 conf.register_group(opt_group)
29 for opt in options:
30 conf.register_opt(opt, group=opt_group.name)
31
32
Matthew Treinish39e48ef2012-12-21 13:36:15 -050033identity_group = cfg.OptGroup(name='identity',
34 title="Keystone Configuration Options")
Daryl Walleck1465d612011-11-02 02:22:15 -050035
Matthew Treinish39e48ef2012-12-21 13:36:15 -050036IdentityGroup = [
37 cfg.StrOpt('catalog_type',
38 default='identity',
39 help="Catalog type of the Identity service."),
Jay Pipescd8eaec2013-01-16 21:03:48 -050040 cfg.BoolOpt('disable_ssl_certificate_validation',
41 default=False,
42 help="Set to True if using self-signed SSL certificates."),
Jay Pipes7c88eb22013-01-16 21:32:43 -050043 cfg.StrOpt('uri',
44 default=None,
Brant Knudsonc7ca3342013-03-28 21:08:50 -050045 help="Full URI of the OpenStack Identity API (Keystone), v2"),
46 cfg.StrOpt('uri_v3',
47 help='Full URI of the OpenStack Identity API (Keystone), v3'),
Matthew Treinish39e48ef2012-12-21 13:36:15 -050048 cfg.StrOpt('region',
Attila Fazekascadcb1f2013-01-21 23:10:53 +010049 default='RegionOne',
Arata Notsu8f440392013-09-13 16:14:20 +090050 help="The identity region name to use. Also used as the other "
51 "services' region name unless they are set explicitly. "
52 "If no such region is found in the service catalog, the "
53 "first found one is used."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +010054 cfg.StrOpt('username',
55 default='demo',
56 help="Username to use for Nova API requests."),
57 cfg.StrOpt('tenant_name',
58 default='demo',
59 help="Tenant name to use for Nova API requests."),
Russell Sim7f894a52013-09-13 10:35:21 +100060 cfg.StrOpt('admin_role',
61 default='admin',
62 help="Role required to administrate keystone."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +010063 cfg.StrOpt('password',
64 default='pass',
65 help="API key to use when authenticating.",
66 secret=True),
67 cfg.StrOpt('alt_username',
68 default=None,
69 help="Username of alternate user to use for Nova API "
70 "requests."),
71 cfg.StrOpt('alt_tenant_name',
72 default=None,
73 help="Alternate user's Tenant name to use for Nova API "
74 "requests."),
75 cfg.StrOpt('alt_password',
76 default=None,
77 help="API key to use when authenticating as alternate user.",
78 secret=True),
79 cfg.StrOpt('admin_username',
80 default='admin',
81 help="Administrative Username to use for"
82 "Keystone API requests."),
83 cfg.StrOpt('admin_tenant_name',
84 default='admin',
85 help="Administrative Tenant name to use for Keystone API "
86 "requests."),
87 cfg.StrOpt('admin_password',
88 default='pass',
89 help="API key to use when authenticating as admin.",
90 secret=True),
Matthew Treinish39e48ef2012-12-21 13:36:15 -050091]
Jay Pipes3f981df2012-03-27 18:59:44 -040092
Matthew Treinishd5021a72014-01-09 18:42:51 +000093identity_feature_group = cfg.OptGroup(name='identity-feature-enabled',
94 title='Enabled Identity Features')
95
96IdentityFeatureGroup = [
97 cfg.BoolOpt('trust',
98 default=True,
99 help='Does the identity service have delegation and '
100 'impersonation enabled')
101]
102
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500103compute_group = cfg.OptGroup(name='compute',
104 title='Compute Service Options')
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800105
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500106ComputeGroup = [
107 cfg.BoolOpt('allow_tenant_isolation',
108 default=False,
109 help="Allows test cases to create/destroy tenants and "
110 "users. This option enables isolated test cases and "
111 "better parallel execution, but also requires that "
112 "OpenStack Identity API admin credentials are known."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500113 cfg.StrOpt('image_ref',
114 default="{$IMAGE_ID}",
115 help="Valid secondary image reference to be used in tests."),
116 cfg.StrOpt('image_ref_alt',
117 default="{$IMAGE_ID_ALT}",
118 help="Valid secondary image reference to be used in tests."),
Ken'ichi Ohmichi35772602013-11-14 15:03:27 +0900119 cfg.StrOpt('flavor_ref',
120 default="1",
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500121 help="Valid primary flavor to use in tests."),
Ken'ichi Ohmichi35772602013-11-14 15:03:27 +0900122 cfg.StrOpt('flavor_ref_alt',
123 default="2",
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500124 help='Valid secondary flavor to be used in tests.'),
Maru Newbyaf292e82013-05-20 21:32:28 +0000125 cfg.StrOpt('image_ssh_user',
126 default="root",
127 help="User name used to authenticate to an instance."),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700128 cfg.StrOpt('image_ssh_password',
129 default="password",
130 help="Password used to authenticate to an instance."),
Maru Newbyaf292e82013-05-20 21:32:28 +0000131 cfg.StrOpt('image_alt_ssh_user',
132 default="root",
133 help="User name used to authenticate to an instance using "
134 "the alternate image."),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700135 cfg.StrOpt('image_alt_ssh_password',
136 default="password",
137 help="Password used to authenticate to an instance using "
138 "the alternate image."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500139 cfg.IntOpt('build_interval',
140 default=10,
141 help="Time in seconds between build status checks."),
142 cfg.IntOpt('build_timeout',
143 default=300,
144 help="Timeout in seconds to wait for an instance to build."),
145 cfg.BoolOpt('run_ssh',
146 default=False,
Derek Higgins85cd5142013-12-17 17:10:11 +0000147 help="Should the tests ssh to instances?"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500148 cfg.StrOpt('ssh_user',
149 default='root',
150 help="User name used to authenticate to an instance."),
Nachi Ueno6d580be2013-07-24 10:58:11 -0700151 cfg.IntOpt('ping_timeout',
152 default=60,
153 help="Timeout in seconds to wait for ping to "
154 "succeed."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500155 cfg.IntOpt('ssh_timeout',
156 default=300,
Chris Yeoh76916042013-02-27 16:25:25 +1030157 help="Timeout in seconds to wait for authentication to "
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500158 "succeed."),
Attila Fazekas0abbc952013-07-01 19:19:42 +0200159 cfg.IntOpt('ready_wait',
160 default=0,
DennyZhang8912d012013-09-25 18:08:34 -0500161 help="Additional wait time for clean state, when there is "
162 "no OS-EXT-STS extension available"),
Chris Yeoh76916042013-02-27 16:25:25 +1030163 cfg.IntOpt('ssh_channel_timeout',
164 default=60,
165 help="Timeout in seconds to wait for output from ssh "
166 "channel."),
Attila Fazekasb0661652013-05-08 13:01:36 +0200167 cfg.StrOpt('fixed_network_name',
168 default='private',
169 help="Visible fixed network name "),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500170 cfg.StrOpt('network_for_ssh',
171 default='public',
172 help="Network used for SSH connections."),
173 cfg.IntOpt('ip_version_for_ssh',
174 default=4,
175 help="IP version used for SSH connections."),
fujioka yuuichia11994e2013-07-09 11:19:51 +0900176 cfg.BoolOpt('use_floatingip_for_ssh',
177 default=True,
178 help="Dose the SSH uses Floating IP?"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500179 cfg.StrOpt('catalog_type',
180 default='compute',
181 help="Catalog type of the Compute service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900182 cfg.StrOpt('region',
183 default='',
184 help="The compute region name to use. If empty, the value "
185 "of identity.region is used instead. If no such region "
186 "is found in the service catalog, the first found one is "
187 "used."),
ivan-zhu8f992be2013-07-31 14:56:58 +0800188 cfg.StrOpt('catalog_v3_type',
189 default='computev3',
190 help="Catalog type of the Compute v3 service."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100191 cfg.StrOpt('path_to_private_key',
192 default=None,
193 help="Path to a private key file for SSH access to remote "
194 "hosts"),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700195 cfg.StrOpt('volume_device_name',
196 default='vdb',
197 help="Expected device name when a volume is attached to "
Ken'ichi Ohmichi39437e22013-10-06 00:21:38 +0900198 "an instance"),
199 cfg.IntOpt('shelved_offload_time',
200 default=0,
201 help='Time in seconds before a shelved instance is eligible '
202 'for removing from a host. -1 never offload, 0 offload '
203 'when shelved. This time should be the same as the time '
204 'of nova.conf, and some tests will run for as long as the '
205 'time.')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500206]
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800207
Matthew Treinishd5c96022013-10-17 21:51:23 +0000208compute_features_group = cfg.OptGroup(name='compute-feature-enabled',
209 title="Enabled Compute Service Features")
210
211ComputeFeaturesGroup = [
ivan-zhu8f992be2013-07-31 14:56:58 +0800212 cfg.BoolOpt('api_v3',
Chris Yeohfbc15de2013-11-26 10:20:08 +1030213 default=True,
ivan-zhu8f992be2013-07-31 14:56:58 +0800214 help="If false, skip all nova v3 tests."),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000215 cfg.BoolOpt('disk_config',
216 default=True,
217 help="If false, skip disk config tests"),
Matthew Treinishe3d26142013-11-26 19:14:58 +0000218 cfg.ListOpt('api_extensions',
219 default=['all'],
220 help='A list of enabled extensions with a special entry all '
221 'which indicates every extension is enabled'),
222 cfg.ListOpt('api_v3_extensions',
223 default=['all'],
224 help='A list of enabled v3 extensions with a special entry all'
225 ' which indicates every extension is enabled'),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000226 cfg.BoolOpt('change_password',
227 default=False,
228 help="Does the test environment support changing the admin "
229 "password?"),
230 cfg.BoolOpt('create_image',
231 default=False,
232 help="Does the test environment support snapshots?"),
233 cfg.BoolOpt('resize',
234 default=False,
235 help="Does the test environment support resizing?"),
236 cfg.BoolOpt('live_migration',
237 default=False,
238 help="Does the test environment support live migration "
239 "available?"),
240 cfg.BoolOpt('block_migration_for_live_migration',
241 default=False,
242 help="Does the test environment use block devices for live "
243 "migration"),
244 cfg.BoolOpt('block_migrate_cinder_iscsi',
245 default=False,
246 help="Does the test environment block migration support "
247 "cinder iSCSI volumes")
248]
249
250
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500251compute_admin_group = cfg.OptGroup(name='compute-admin',
252 title="Compute Admin Options")
donald-ngo7fb1efa2011-12-13 17:17:36 -0800253
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500254ComputeAdminGroup = [
255 cfg.StrOpt('username',
256 default='admin',
257 help="Administrative Username to use for Nova API requests."),
258 cfg.StrOpt('tenant_name',
259 default='admin',
260 help="Administrative Tenant name to use for Nova API "
261 "requests."),
262 cfg.StrOpt('password',
263 default='pass',
264 help="API key to use when authenticating as admin.",
265 secret=True),
266]
Daryl Walleck587385b2012-03-03 13:00:26 -0600267
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500268image_group = cfg.OptGroup(name='image',
269 title="Image Service Options")
Jay Pipesf38eaac2012-06-21 13:37:35 -0400270
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500271ImageGroup = [
Matthew Treinish72ea4422013-02-07 14:42:49 -0500272 cfg.StrOpt('catalog_type',
273 default='image',
Sean Dague83401992013-05-06 17:46:36 -0400274 help='Catalog type of the Image service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900275 cfg.StrOpt('region',
276 default='',
277 help="The image region name to use. If empty, the value "
278 "of identity.region is used instead. If no such region "
279 "is found in the service catalog, the first found one is "
280 "used."),
Sean Dague83401992013-05-06 17:46:36 -0400281 cfg.StrOpt('http_image',
282 default='http://download.cirros-cloud.net/0.3.1/'
283 'cirros-0.3.1-x86_64-uec.tar.gz',
DennyZhang8912d012013-09-25 18:08:34 -0500284 help='http accessible image')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500285]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400286
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000287image_feature_group = cfg.OptGroup(name='image-feature-enabled',
288 title='Enabled image service features')
289
290ImageFeaturesGroup = [
291 cfg.BoolOpt('api_v2',
292 default=True,
293 help="Is the v2 image API enabled"),
294 cfg.BoolOpt('api_v1',
295 default=True,
296 help="Is the v1 image API enabled"),
297]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400298
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500299network_group = cfg.OptGroup(name='network',
300 title='Network Service Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600301
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500302NetworkGroup = [
303 cfg.StrOpt('catalog_type',
304 default='network',
Mark McClainf2982e82013-07-06 17:48:03 -0400305 help='Catalog type of the Neutron service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900306 cfg.StrOpt('region',
307 default='',
308 help="The network region name to use. If empty, the value "
309 "of identity.region is used instead. If no such region "
310 "is found in the service catalog, the first found one is "
311 "used."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500312 cfg.StrOpt('tenant_network_cidr',
313 default="10.100.0.0/16",
314 help="The cidr block to allocate tenant networks from"),
315 cfg.IntOpt('tenant_network_mask_bits',
Attila Fazekas8ea181b2013-07-13 16:26:14 +0200316 default=28,
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500317 help="The mask bits for tenant networks"),
318 cfg.BoolOpt('tenant_networks_reachable',
319 default=False,
320 help="Whether tenant network connectivity should be "
321 "evaluated directly"),
322 cfg.StrOpt('public_network_id',
323 default="",
324 help="Id of the public network that provides external "
325 "connectivity"),
326 cfg.StrOpt('public_router_id',
327 default="",
328 help="Id of the public router that provides external "
329 "connectivity"),
330]
Jay Pipes3f981df2012-03-27 18:59:44 -0400331
Matthew Treinishe3d26142013-11-26 19:14:58 +0000332network_feature_group = cfg.OptGroup(name='network-feature-enabled',
333 title='Enabled network service features')
334
335NetworkFeaturesGroup = [
336 cfg.ListOpt('api_extensions',
337 default=['all'],
338 help='A list of enabled extensions with a special entry all '
339 'which indicates every extension is enabled'),
340]
341
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500342volume_group = cfg.OptGroup(name='volume',
343 title='Block Storage Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600344
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500345VolumeGroup = [
346 cfg.IntOpt('build_interval',
347 default=10,
348 help='Time in seconds between volume availability checks.'),
349 cfg.IntOpt('build_timeout',
350 default=300,
351 help='Timeout in seconds to wait for a volume to become'
352 'available.'),
353 cfg.StrOpt('catalog_type',
Matthew Treinisheb724512013-10-25 15:12:59 +0000354 default='volume',
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500355 help="Catalog type of the Volume Service"),
Arata Notsu8f440392013-09-13 16:14:20 +0900356 cfg.StrOpt('region',
357 default='',
358 help="The volume region name to use. If empty, the value "
359 "of identity.region is used instead. If no such region "
360 "is found in the service catalog, the first found one is "
361 "used."),
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100362 cfg.StrOpt('backend1_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200363 default='BACKEND_1',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100364 help="Name of the backend1 (must be declared in cinder.conf)"),
365 cfg.StrOpt('backend2_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200366 default='BACKEND_2',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100367 help="Name of the backend2 (must be declared in cinder.conf)"),
Adam Gandelman827ad332013-06-24 17:04:09 -0700368 cfg.StrOpt('storage_protocol',
369 default='iSCSI',
370 help='Backend protocol to target when creating volume types'),
371 cfg.StrOpt('vendor_name',
372 default='Open Source',
373 help='Backend vendor to target when creating volume types'),
Ryan Hsua67f4632013-08-29 16:03:06 -0700374 cfg.StrOpt('disk_format',
375 default='raw',
376 help='Disk format to use when copying a volume to image'),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500377]
K Jonathan Harkerd6ba4b42012-12-18 13:50:47 -0800378
Matthew Treinishd5c96022013-10-17 21:51:23 +0000379volume_feature_group = cfg.OptGroup(name='volume-feature-enabled',
380 title='Enabled Cinder Features')
381
382VolumeFeaturesGroup = [
383 cfg.BoolOpt('multi_backend',
384 default=False,
Matthew Treinishe3d26142013-11-26 19:14:58 +0000385 help="Runs Cinder multi-backend test (requires 2 backends)"),
386 cfg.ListOpt('api_extensions',
387 default=['all'],
388 help='A list of enabled extensions with a special entry all '
389 'which indicates every extension is enabled'),
Zhi Kun Liubb363a22013-11-28 18:47:39 +0800390 cfg.BoolOpt('api_v1',
391 default=True,
392 help="Is the v1 volume API enabled"),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000393]
394
Daryl Walleck587385b2012-03-03 13:00:26 -0600395
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500396object_storage_group = cfg.OptGroup(name='object-storage',
397 title='Object Storage Service Options')
Attila Fazekasa23f5002012-10-23 19:32:45 +0200398
DennyZhang1e71b612013-09-26 12:35:40 -0500399ObjectStoreGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500400 cfg.StrOpt('catalog_type',
401 default='object-store',
402 help="Catalog type of the Object-Storage service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900403 cfg.StrOpt('region',
404 default='',
405 help="The object-storage region name to use. If empty, the "
406 "value of identity.region is used instead. If no such "
407 "region is found in the service catalog, the first found "
408 "one is used."),
Matthew Treinishf319a732013-10-24 21:39:24 +0000409 cfg.IntOpt('container_sync_timeout',
nayna-patelb4989b32013-01-09 06:25:13 +0000410 default=120,
411 help="Number of seconds to time on waiting for a container"
412 "to container synchronization complete."),
Matthew Treinishf319a732013-10-24 21:39:24 +0000413 cfg.IntOpt('container_sync_interval',
nayna-patelb4989b32013-01-09 06:25:13 +0000414 default=5,
415 help="Number of seconds to wait while looping to check the"
416 "status of a container to container synchronization"),
Matthew Treinish3fdb80c2013-08-15 11:13:19 -0400417 cfg.StrOpt('operator_role',
418 default='Member',
419 help="Role to add to users created for swift tests to "
420 "enable creating containers"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500421]
Attila Fazekasa23f5002012-10-23 19:32:45 +0200422
Matthew Treinishd5c96022013-10-17 21:51:23 +0000423object_storage_feature_group = cfg.OptGroup(
424 name='object-storage-feature-enabled',
425 title='Enabled object-storage features')
426
427ObjectStoreFeaturesGroup = [
Matthew Treinish20345382013-12-13 17:04:23 +0000428 cfg.ListOpt('discoverable_apis',
429 default=['all'],
430 help="A list of the enabled optional discoverable apis. "
431 "A single entry, all, indicates that all of these "
432 "features are expected to be enabled"),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000433]
434
Attila Fazekasa23f5002012-10-23 19:32:45 +0200435
Steve Bakerc60e4e32013-05-06 15:22:41 +1200436orchestration_group = cfg.OptGroup(name='orchestration',
437 title='Orchestration Service Options')
438
439OrchestrationGroup = [
440 cfg.StrOpt('catalog_type',
441 default='orchestration',
442 help="Catalog type of the Orchestration service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900443 cfg.StrOpt('region',
444 default='',
445 help="The orchestration region name to use. If empty, the "
446 "value of identity.region is used instead. If no such "
447 "region is found in the service catalog, the first found "
448 "one is used."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200449 cfg.BoolOpt('allow_tenant_isolation',
450 default=False,
451 help="Allows test cases to create/destroy tenants and "
452 "users. This option enables isolated test cases and "
453 "better parallel execution, but also requires that "
454 "OpenStack Identity API admin credentials are known."),
455 cfg.IntOpt('build_interval',
456 default=1,
457 help="Time in seconds between build status checks."),
458 cfg.IntOpt('build_timeout',
459 default=300,
460 help="Timeout in seconds to wait for a stack to build."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200461 cfg.StrOpt('instance_type',
Steve Baker9e86b832013-05-22 15:40:28 +1200462 default='m1.micro',
Steve Bakerc60e4e32013-05-06 15:22:41 +1200463 help="Instance type for tests. Needs to be big enough for a "
464 "full OS plus the test workload"),
465 cfg.StrOpt('image_ref',
466 default=None,
467 help="Name of heat-cfntools enabled image to use when "
468 "launching test instances."),
469 cfg.StrOpt('keypair_name',
470 default=None,
471 help="Name of existing keypair to launch servers with."),
Clint Byrum71f27632013-09-09 11:41:32 -0700472 cfg.IntOpt('max_template_size',
Joe Gordon0e51b222013-10-24 14:11:10 +0100473 default=524288,
Clint Byrum71f27632013-09-09 11:41:32 -0700474 help="Value must match heat configuration of the same name."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200475]
476
477
Yassine Lamgarchalb158d412013-12-27 19:29:42 +0100478telemetry_group = cfg.OptGroup(name='telemetry',
479 title='Telemetry Service Options')
480
481TelemetryGroup = [
482 cfg.StrOpt('catalog_type',
483 default='metering',
484 help="Catalog type of the Telemetry service."),
485]
486
487
Julie Pichond1017642013-07-24 16:37:23 +0100488dashboard_group = cfg.OptGroup(name="dashboard",
489 title="Dashboard options")
490
491DashboardGroup = [
492 cfg.StrOpt('dashboard_url',
493 default='http://localhost/',
494 help="Where the dashboard can be found"),
495 cfg.StrOpt('login_url',
496 default='http://localhost/auth/login/',
497 help="Login page for the dashboard"),
498]
499
500
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400501data_processing_group = cfg.OptGroup(name="data_processing",
502 title="Data Processing options")
503
504DataProcessingGroup = [
505 cfg.StrOpt('catalog_type',
506 default='data_processing',
507 help="Catalog type of the data processing service.")
508]
509
510
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500511boto_group = cfg.OptGroup(name='boto',
512 title='EC2/S3 options')
DennyZhang1e71b612013-09-26 12:35:40 -0500513BotoGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500514 cfg.StrOpt('ec2_url',
515 default="http://localhost:8773/services/Cloud",
516 help="EC2 URL"),
517 cfg.StrOpt('s3_url',
518 default="http://localhost:8080",
519 help="S3 URL"),
520 cfg.StrOpt('aws_secret',
521 default=None,
522 help="AWS Secret Key",
523 secret=True),
524 cfg.StrOpt('aws_access',
525 default=None,
526 help="AWS Access Key"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500527 cfg.StrOpt('s3_materials_path',
528 default="/opt/stack/devstack/files/images/"
529 "s3-materials/cirros-0.3.0",
530 help="S3 Materials Path"),
531 cfg.StrOpt('ari_manifest',
532 default="cirros-0.3.0-x86_64-initrd.manifest.xml",
533 help="ARI Ramdisk Image manifest"),
534 cfg.StrOpt('ami_manifest',
535 default="cirros-0.3.0-x86_64-blank.img.manifest.xml",
536 help="AMI Machine Image manifest"),
537 cfg.StrOpt('aki_manifest',
538 default="cirros-0.3.0-x86_64-vmlinuz.manifest.xml",
539 help="AKI Kernel Image manifest"),
540 cfg.StrOpt('instance_type',
541 default="m1.tiny",
542 help="Instance type"),
543 cfg.IntOpt('http_socket_timeout',
544 default=3,
545 help="boto Http socket timeout"),
546 cfg.IntOpt('num_retries',
547 default=1,
548 help="boto num_retries on error"),
549 cfg.IntOpt('build_timeout',
550 default=60,
551 help="Status Change Timeout"),
552 cfg.IntOpt('build_interval',
553 default=1,
554 help="Status Change Test Interval"),
555]
Attila Fazekasf7f2d932012-12-13 09:14:38 +0100556
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500557stress_group = cfg.OptGroup(name='stress', title='Stress Test Options')
558
559StressGroup = [
560 cfg.StrOpt('nova_logdir',
561 default=None,
562 help='Directory containing log files on the compute nodes'),
563 cfg.IntOpt('max_instances',
564 default=16,
565 help='Maximum number of instances to create during test.'),
566 cfg.StrOpt('controller',
567 default=None,
David Kranzb9d97502013-05-01 15:55:04 -0400568 help='Controller host.'),
569 # new stress options
570 cfg.StrOpt('target_controller',
571 default=None,
572 help='Controller host.'),
573 cfg.StrOpt('target_ssh_user',
574 default=None,
575 help='ssh user.'),
576 cfg.StrOpt('target_private_key_path',
577 default=None,
578 help='Path to private key.'),
579 cfg.StrOpt('target_logfiles',
580 default=None,
581 help='regexp for list of log files.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000582 cfg.IntOpt('log_check_interval',
David Kranzb9d97502013-05-01 15:55:04 -0400583 default=60,
Marc Koderer32221b8e2013-08-23 13:57:50 +0200584 help='time (in seconds) between log file error checks.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000585 cfg.IntOpt('default_thread_number_per_action',
Marc Koderer32221b8e2013-08-23 13:57:50 +0200586 default=4,
587 help='The number of threads created while stress test.')
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500588]
589
590
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900591scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options')
592
593ScenarioGroup = [
594 cfg.StrOpt('img_dir',
595 default='/opt/stack/new/devstack/files/images/'
596 'cirros-0.3.1-x86_64-uec',
597 help='Directory containing image files'),
598 cfg.StrOpt('ami_img_file',
599 default='cirros-0.3.1-x86_64-blank.img',
600 help='AMI image file name'),
601 cfg.StrOpt('ari_img_file',
602 default='cirros-0.3.1-x86_64-initrd',
603 help='ARI image file name'),
604 cfg.StrOpt('aki_img_file',
605 default='cirros-0.3.1-x86_64-vmlinuz',
606 help='AKI image file name'),
607 cfg.StrOpt('ssh_user',
608 default='cirros',
Joe Gordonb5e10cd2013-07-10 15:51:12 +0000609 help='ssh username for the image file'),
610 cfg.IntOpt(
611 'large_ops_number',
612 default=0,
613 help="specifies how many resources to request at once. Used "
614 "for large operations testing.")
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900615]
616
617
Matthew Treinish4c412922013-07-16 15:27:42 -0400618service_available_group = cfg.OptGroup(name="service_available",
619 title="Available OpenStack Services")
620
621ServiceAvailableGroup = [
622 cfg.BoolOpt('cinder',
623 default=True,
624 help="Whether or not cinder is expected to be available"),
Matthew Treinishfaa340d2013-07-19 16:26:21 -0400625 cfg.BoolOpt('neutron',
626 default=False,
627 help="Whether or not neutron is expected to be available"),
Matthew Treinish853ae442013-07-19 16:36:07 -0400628 cfg.BoolOpt('glance',
629 default=True,
630 help="Whether or not glance is expected to be available"),
Matthew Treinish61e332b2013-07-19 16:42:31 -0400631 cfg.BoolOpt('swift',
632 default=True,
633 help="Whether or not swift is expected to be available"),
Matthew Treinish6b41e242013-07-19 16:49:28 -0400634 cfg.BoolOpt('nova',
635 default=True,
636 help="Whether or not nova is expected to be available"),
Matthew Treinisha9d43882013-07-19 16:54:52 -0400637 cfg.BoolOpt('heat',
638 default=False,
639 help="Whether or not Heat is expected to be available"),
Mehdi Abaakouk8581c0b2013-10-04 10:45:42 +0200640 cfg.BoolOpt('ceilometer',
641 default=True,
642 help="Whether or not Ceilometer is expected to be available"),
Julie Pichond1017642013-07-24 16:37:23 +0100643 cfg.BoolOpt('horizon',
644 default=True,
645 help="Whether or not Horizon is expected to be available"),
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400646 cfg.BoolOpt('savanna',
647 default=False,
648 help="Whether or not Savanna is expected to be available"),
Matthew Treinish4c412922013-07-16 15:27:42 -0400649]
650
Attila Fazekasaeeeefd2013-08-06 17:01:56 +0200651debug_group = cfg.OptGroup(name="debug",
652 title="Debug System")
653
654DebugGroup = [
655 cfg.BoolOpt('enable',
656 default=True,
657 help="Enable diagnostic commands"),
658]
659
660
Sean Dague3b9b1f32013-12-20 17:04:54 -0500661# this should never be called outside of this class
662class TempestConfigPrivate(object):
Daryl Walleck1465d612011-11-02 02:22:15 -0500663 """Provides OpenStack configuration information."""
664
Brian Waldon738cd632011-12-12 18:45:09 -0500665 DEFAULT_CONFIG_DIR = os.path.join(
Zhongyue Luoa1343de2013-01-04 16:21:35 +0800666 os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
Brian Waldon738cd632011-12-12 18:45:09 -0500667 "etc")
Daryl Walleck1465d612011-11-02 02:22:15 -0500668
Brian Waldon738cd632011-12-12 18:45:09 -0500669 DEFAULT_CONFIG_FILE = "tempest.conf"
670
Sean Dague2ec4c2c2013-12-22 11:30:06 -0500671 def __init__(self, parse_conf=True):
Brian Waldon738cd632011-12-12 18:45:09 -0500672 """Initialize a configuration from a conf directory and conf file."""
Sean Dague3b9b1f32013-12-20 17:04:54 -0500673 super(TempestConfigPrivate, self).__init__()
Sean Dague2416cf32013-04-10 08:29:07 -0400674 config_files = []
Sean Dague2416cf32013-04-10 08:29:07 -0400675 failsafe_path = "/etc/tempest/" + self.DEFAULT_CONFIG_FILE
Brian Waldon738cd632011-12-12 18:45:09 -0500676
677 # Environment variables override defaults...
678 conf_dir = os.environ.get('TEMPEST_CONFIG_DIR',
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800679 self.DEFAULT_CONFIG_DIR)
680 conf_file = os.environ.get('TEMPEST_CONFIG', self.DEFAULT_CONFIG_FILE)
Brian Waldon738cd632011-12-12 18:45:09 -0500681
Jay Pipes7f757632011-12-02 15:53:32 -0500682 path = os.path.join(conf_dir, conf_file)
683
Zhongyue Luoafd43eb2013-02-04 11:32:57 +0800684 if not (os.path.isfile(path) or
685 'TEMPEST_CONFIG_DIR' in os.environ or
686 'TEMPEST_CONFIG' in os.environ):
Sean Dague2416cf32013-04-10 08:29:07 -0400687 path = failsafe_path
Attila Fazekas5abb2532012-12-04 11:30:49 +0100688
Sean Dague2ec4c2c2013-12-22 11:30:06 -0500689 # only parse the config file if we expect one to exist. This is needed
690 # to remove an issue with the config file up to date checker.
691 if parse_conf:
Sean Dague2416cf32013-04-10 08:29:07 -0400692 config_files.append(path)
Jay Pipes7f757632011-12-02 15:53:32 -0500693
Sean Dague2416cf32013-04-10 08:29:07 -0400694 cfg.CONF([], project='tempest', default_config_files=config_files)
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -0400695 logging.setup('tempest')
696 LOG = logging.getLogger('tempest')
697 LOG.info("Using tempest config file %s" % path)
Daryl Walleck1465d612011-11-02 02:22:15 -0500698
DennyZhang88a2dd82013-10-07 12:55:35 -0500699 register_opt_group(cfg.CONF, compute_group, ComputeGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000700 register_opt_group(cfg.CONF, compute_features_group,
701 ComputeFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500702 register_opt_group(cfg.CONF, identity_group, IdentityGroup)
Matthew Treinishd5021a72014-01-09 18:42:51 +0000703 register_opt_group(cfg.CONF, identity_feature_group,
704 IdentityFeatureGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500705 register_opt_group(cfg.CONF, image_group, ImageGroup)
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000706 register_opt_group(cfg.CONF, image_feature_group, ImageFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500707 register_opt_group(cfg.CONF, network_group, NetworkGroup)
Matthew Treinishe3d26142013-11-26 19:14:58 +0000708 register_opt_group(cfg.CONF, network_feature_group,
709 NetworkFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500710 register_opt_group(cfg.CONF, volume_group, VolumeGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000711 register_opt_group(cfg.CONF, volume_feature_group,
712 VolumeFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500713 register_opt_group(cfg.CONF, object_storage_group, ObjectStoreGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000714 register_opt_group(cfg.CONF, object_storage_feature_group,
715 ObjectStoreFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500716 register_opt_group(cfg.CONF, orchestration_group, OrchestrationGroup)
Yassine Lamgarchalb158d412013-12-27 19:29:42 +0100717 register_opt_group(cfg.CONF, telemetry_group, TelemetryGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500718 register_opt_group(cfg.CONF, dashboard_group, DashboardGroup)
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400719 register_opt_group(cfg.CONF, data_processing_group,
720 DataProcessingGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500721 register_opt_group(cfg.CONF, boto_group, BotoGroup)
722 register_opt_group(cfg.CONF, compute_admin_group, ComputeAdminGroup)
723 register_opt_group(cfg.CONF, stress_group, StressGroup)
724 register_opt_group(cfg.CONF, scenario_group, ScenarioGroup)
725 register_opt_group(cfg.CONF, service_available_group,
726 ServiceAvailableGroup)
727 register_opt_group(cfg.CONF, debug_group, DebugGroup)
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500728 self.compute = cfg.CONF.compute
Matthew Treinishd5c96022013-10-17 21:51:23 +0000729 self.compute_feature_enabled = cfg.CONF['compute-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500730 self.identity = cfg.CONF.identity
Matthew Treinishd5021a72014-01-09 18:42:51 +0000731 self.identity_feature_enabled = cfg.CONF['identity-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500732 self.images = cfg.CONF.image
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000733 self.image_feature_enabled = cfg.CONF['image-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500734 self.network = cfg.CONF.network
Matthew Treinishe3d26142013-11-26 19:14:58 +0000735 self.network_feature_enabled = cfg.CONF['network-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500736 self.volume = cfg.CONF.volume
Matthew Treinishd5c96022013-10-17 21:51:23 +0000737 self.volume_feature_enabled = cfg.CONF['volume-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500738 self.object_storage = cfg.CONF['object-storage']
Matthew Treinishd5c96022013-10-17 21:51:23 +0000739 self.object_storage_feature_enabled = cfg.CONF[
740 'object-storage-feature-enabled']
Steve Bakerc60e4e32013-05-06 15:22:41 +1200741 self.orchestration = cfg.CONF.orchestration
Yassine Lamgarchalb158d412013-12-27 19:29:42 +0100742 self.telemetry = cfg.CONF.telemetry
Julie Pichond1017642013-07-24 16:37:23 +0100743 self.dashboard = cfg.CONF.dashboard
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400744 self.data_processing = cfg.CONF.data_processing
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500745 self.boto = cfg.CONF.boto
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100746 self.compute_admin = cfg.CONF['compute-admin']
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500747 self.stress = cfg.CONF.stress
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900748 self.scenario = cfg.CONF.scenario
Matthew Treinish4c412922013-07-16 15:27:42 -0400749 self.service_available = cfg.CONF.service_available
Attila Fazekas5fae7a32013-09-25 16:52:44 +0200750 self.debug = cfg.CONF.debug
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100751 if not self.compute_admin.username:
752 self.compute_admin.username = self.identity.admin_username
753 self.compute_admin.password = self.identity.admin_password
754 self.compute_admin.tenant_name = self.identity.admin_tenant_name
Sean Dague86bd8422013-12-20 09:56:44 -0500755
756
757class TempestConfigProxy(object):
758 _config = None
759
760 def __getattr__(self, attr):
761 if not self._config:
Sean Dague3b9b1f32013-12-20 17:04:54 -0500762 self._config = TempestConfigPrivate()
Sean Dague86bd8422013-12-20 09:56:44 -0500763
764 return getattr(self._config, attr)
765
766
767CONF = TempestConfigProxy()