blob: 009147b02d18f6e7ded653289402e077ea47eb53 [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
Attila Fazekas5abb2532012-12-04 11:30:49 +010021import sys
Jay Pipes3f981df2012-03-27 18:59:44 -040022
Dirk Muellere746fc22013-06-29 16:29:29 +020023
Matthew Treinish90aedd12013-02-25 17:56:49 -050024from oslo.config import cfg
25
Attila Fazekas3e1b6742013-01-28 16:30:35 +010026from tempest.common.utils.misc import singleton
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -040027from tempest.openstack.common import log as logging
Jay Pipes7f757632011-12-02 15:53:32 -050028
Daryl Walleck1465d612011-11-02 02:22:15 -050029
DennyZhang88a2dd82013-10-07 12:55:35 -050030def register_opt_group(conf, opt_group, options):
31 conf.register_group(opt_group)
32 for opt in options:
33 conf.register_opt(opt, group=opt_group.name)
34
35
Matthew Treinish39e48ef2012-12-21 13:36:15 -050036identity_group = cfg.OptGroup(name='identity',
37 title="Keystone Configuration Options")
Daryl Walleck1465d612011-11-02 02:22:15 -050038
Matthew Treinish39e48ef2012-12-21 13:36:15 -050039IdentityGroup = [
40 cfg.StrOpt('catalog_type',
41 default='identity',
42 help="Catalog type of the Identity service."),
Jay Pipescd8eaec2013-01-16 21:03:48 -050043 cfg.BoolOpt('disable_ssl_certificate_validation',
44 default=False,
45 help="Set to True if using self-signed SSL certificates."),
Jay Pipes7c88eb22013-01-16 21:32:43 -050046 cfg.StrOpt('uri',
47 default=None,
Brant Knudsonc7ca3342013-03-28 21:08:50 -050048 help="Full URI of the OpenStack Identity API (Keystone), v2"),
49 cfg.StrOpt('uri_v3',
50 help='Full URI of the OpenStack Identity API (Keystone), v3'),
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."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +010057 cfg.StrOpt('username',
58 default='demo',
59 help="Username to use for Nova API requests."),
60 cfg.StrOpt('tenant_name',
61 default='demo',
62 help="Tenant name to use for Nova API requests."),
Russell Sim7f894a52013-09-13 10:35:21 +100063 cfg.StrOpt('admin_role',
64 default='admin',
65 help="Role required to administrate keystone."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +010066 cfg.StrOpt('password',
67 default='pass',
68 help="API key to use when authenticating.",
69 secret=True),
70 cfg.StrOpt('alt_username',
71 default=None,
72 help="Username of alternate user to use for Nova API "
73 "requests."),
74 cfg.StrOpt('alt_tenant_name',
75 default=None,
76 help="Alternate user's Tenant name to use for Nova API "
77 "requests."),
78 cfg.StrOpt('alt_password',
79 default=None,
80 help="API key to use when authenticating as alternate user.",
81 secret=True),
82 cfg.StrOpt('admin_username',
83 default='admin',
84 help="Administrative Username to use for"
85 "Keystone API requests."),
86 cfg.StrOpt('admin_tenant_name',
87 default='admin',
88 help="Administrative Tenant name to use for Keystone API "
89 "requests."),
90 cfg.StrOpt('admin_password',
91 default='pass',
92 help="API key to use when authenticating as admin.",
93 secret=True),
Matthew Treinish39e48ef2012-12-21 13:36:15 -050094]
Jay Pipes3f981df2012-03-27 18:59:44 -040095
Matthew Treinish39e48ef2012-12-21 13:36:15 -050096compute_group = cfg.OptGroup(name='compute',
97 title='Compute Service Options')
Rohit Karajgie1b050d2011-12-02 16:13:18 -080098
Matthew Treinish39e48ef2012-12-21 13:36:15 -050099ComputeGroup = [
100 cfg.BoolOpt('allow_tenant_isolation',
101 default=False,
102 help="Allows test cases to create/destroy tenants and "
103 "users. This option enables isolated test cases and "
104 "better parallel execution, but also requires that "
105 "OpenStack Identity API admin credentials are known."),
106 cfg.BoolOpt('allow_tenant_reuse',
107 default=True,
108 help="If allow_tenant_isolation is True and a tenant that "
109 "would be created for a given test already exists (such "
110 "as from a previously-failed run), re-use that tenant "
111 "instead of failing because of the conflict. Note that "
112 "this would result in the tenant being deleted at the "
113 "end of a subsequent successful run."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500114 cfg.StrOpt('image_ref',
115 default="{$IMAGE_ID}",
116 help="Valid secondary image reference to be used in tests."),
117 cfg.StrOpt('image_ref_alt',
118 default="{$IMAGE_ID_ALT}",
119 help="Valid secondary image reference to be used in tests."),
120 cfg.IntOpt('flavor_ref',
121 default=1,
122 help="Valid primary flavor to use in tests."),
123 cfg.IntOpt('flavor_ref_alt',
124 default=2,
125 help='Valid secondary flavor to be used in tests.'),
Maru Newbyaf292e82013-05-20 21:32:28 +0000126 cfg.StrOpt('image_ssh_user',
127 default="root",
128 help="User name used to authenticate to an instance."),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700129 cfg.StrOpt('image_ssh_password',
130 default="password",
131 help="Password used to authenticate to an instance."),
Maru Newbyaf292e82013-05-20 21:32:28 +0000132 cfg.StrOpt('image_alt_ssh_user',
133 default="root",
134 help="User name used to authenticate to an instance using "
135 "the alternate image."),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700136 cfg.StrOpt('image_alt_ssh_password',
137 default="password",
138 help="Password used to authenticate to an instance using "
139 "the alternate image."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500140 cfg.IntOpt('build_interval',
141 default=10,
142 help="Time in seconds between build status checks."),
143 cfg.IntOpt('build_timeout',
144 default=300,
145 help="Timeout in seconds to wait for an instance to build."),
146 cfg.BoolOpt('run_ssh',
147 default=False,
148 help="Does the test environment support snapshots?"),
149 cfg.StrOpt('ssh_user',
150 default='root',
151 help="User name used to authenticate to an instance."),
Nachi Ueno6d580be2013-07-24 10:58:11 -0700152 cfg.IntOpt('ping_timeout',
153 default=60,
154 help="Timeout in seconds to wait for ping to "
155 "succeed."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500156 cfg.IntOpt('ssh_timeout',
157 default=300,
Chris Yeoh76916042013-02-27 16:25:25 +1030158 help="Timeout in seconds to wait for authentication to "
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500159 "succeed."),
Attila Fazekas0abbc952013-07-01 19:19:42 +0200160 cfg.IntOpt('ready_wait',
161 default=0,
DennyZhang8912d012013-09-25 18:08:34 -0500162 help="Additional wait time for clean state, when there is "
163 "no OS-EXT-STS extension available"),
Chris Yeoh76916042013-02-27 16:25:25 +1030164 cfg.IntOpt('ssh_channel_timeout',
165 default=60,
166 help="Timeout in seconds to wait for output from ssh "
167 "channel."),
Attila Fazekasb0661652013-05-08 13:01:36 +0200168 cfg.StrOpt('fixed_network_name',
169 default='private',
170 help="Visible fixed network name "),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500171 cfg.StrOpt('network_for_ssh',
172 default='public',
173 help="Network used for SSH connections."),
174 cfg.IntOpt('ip_version_for_ssh',
175 default=4,
176 help="IP version used for SSH connections."),
fujioka yuuichia11994e2013-07-09 11:19:51 +0900177 cfg.BoolOpt('use_floatingip_for_ssh',
178 default=True,
179 help="Dose the SSH uses Floating IP?"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500180 cfg.StrOpt('catalog_type',
181 default='compute',
182 help="Catalog type of the Compute service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900183 cfg.StrOpt('region',
184 default='',
185 help="The compute region name to use. If empty, the value "
186 "of identity.region is used instead. If no such region "
187 "is found in the service catalog, the first found one is "
188 "used."),
ivan-zhu8f992be2013-07-31 14:56:58 +0800189 cfg.StrOpt('catalog_v3_type',
190 default='computev3',
191 help="Catalog type of the Compute v3 service."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100192 cfg.StrOpt('path_to_private_key',
193 default=None,
194 help="Path to a private key file for SSH access to remote "
195 "hosts"),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700196 cfg.StrOpt('volume_device_name',
197 default='vdb',
198 help="Expected device name when a volume is attached to "
Ken'ichi Ohmichi39437e22013-10-06 00:21:38 +0900199 "an instance"),
200 cfg.IntOpt('shelved_offload_time',
201 default=0,
202 help='Time in seconds before a shelved instance is eligible '
203 'for removing from a host. -1 never offload, 0 offload '
204 'when shelved. This time should be the same as the time '
205 'of nova.conf, and some tests will run for as long as the '
206 'time.')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500207]
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800208
Matthew Treinishd5c96022013-10-17 21:51:23 +0000209compute_features_group = cfg.OptGroup(name='compute-feature-enabled',
210 title="Enabled Compute Service Features")
211
212ComputeFeaturesGroup = [
ivan-zhu8f992be2013-07-31 14:56:58 +0800213 cfg.BoolOpt('api_v3',
Joe Gordon277d3782013-11-19 18:55:42 -0800214 default=False,
ivan-zhu8f992be2013-07-31 14:56:58 +0800215 help="If false, skip all nova v3 tests."),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000216 cfg.BoolOpt('disk_config',
217 default=True,
218 help="If false, skip disk config tests"),
219 cfg.BoolOpt('flavor_extra',
220 default=True,
221 help="If false, skip flavor extra data test"),
222 cfg.BoolOpt('change_password',
223 default=False,
224 help="Does the test environment support changing the admin "
225 "password?"),
226 cfg.BoolOpt('create_image',
227 default=False,
228 help="Does the test environment support snapshots?"),
229 cfg.BoolOpt('resize',
230 default=False,
231 help="Does the test environment support resizing?"),
232 cfg.BoolOpt('live_migration',
233 default=False,
234 help="Does the test environment support live migration "
235 "available?"),
236 cfg.BoolOpt('block_migration_for_live_migration',
237 default=False,
238 help="Does the test environment use block devices for live "
239 "migration"),
240 cfg.BoolOpt('block_migrate_cinder_iscsi',
241 default=False,
242 help="Does the test environment block migration support "
243 "cinder iSCSI volumes")
244]
245
246
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500247compute_admin_group = cfg.OptGroup(name='compute-admin',
248 title="Compute Admin Options")
donald-ngo7fb1efa2011-12-13 17:17:36 -0800249
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500250ComputeAdminGroup = [
251 cfg.StrOpt('username',
252 default='admin',
253 help="Administrative Username to use for Nova API requests."),
254 cfg.StrOpt('tenant_name',
255 default='admin',
256 help="Administrative Tenant name to use for Nova API "
257 "requests."),
258 cfg.StrOpt('password',
259 default='pass',
260 help="API key to use when authenticating as admin.",
261 secret=True),
262]
Daryl Walleck587385b2012-03-03 13:00:26 -0600263
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500264image_group = cfg.OptGroup(name='image',
265 title="Image Service Options")
Jay Pipesf38eaac2012-06-21 13:37:35 -0400266
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500267ImageGroup = [
Matthew Treinish72ea4422013-02-07 14:42:49 -0500268 cfg.StrOpt('catalog_type',
269 default='image',
Sean Dague83401992013-05-06 17:46:36 -0400270 help='Catalog type of the Image service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900271 cfg.StrOpt('region',
272 default='',
273 help="The image region name to use. If empty, the value "
274 "of identity.region is used instead. If no such region "
275 "is found in the service catalog, the first found one is "
276 "used."),
Sean Dague83401992013-05-06 17:46:36 -0400277 cfg.StrOpt('http_image',
278 default='http://download.cirros-cloud.net/0.3.1/'
279 'cirros-0.3.1-x86_64-uec.tar.gz',
DennyZhang8912d012013-09-25 18:08:34 -0500280 help='http accessible image')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500281]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400282
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000283image_feature_group = cfg.OptGroup(name='image-feature-enabled',
284 title='Enabled image service features')
285
286ImageFeaturesGroup = [
287 cfg.BoolOpt('api_v2',
288 default=True,
289 help="Is the v2 image API enabled"),
290 cfg.BoolOpt('api_v1',
291 default=True,
292 help="Is the v1 image API enabled"),
293]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400294
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500295network_group = cfg.OptGroup(name='network',
296 title='Network Service Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600297
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500298NetworkGroup = [
299 cfg.StrOpt('catalog_type',
300 default='network',
Mark McClainf2982e82013-07-06 17:48:03 -0400301 help='Catalog type of the Neutron service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900302 cfg.StrOpt('region',
303 default='',
304 help="The network region name to use. If empty, the value "
305 "of identity.region is used instead. If no such region "
306 "is found in the service catalog, the first found one is "
307 "used."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500308 cfg.StrOpt('tenant_network_cidr',
309 default="10.100.0.0/16",
310 help="The cidr block to allocate tenant networks from"),
311 cfg.IntOpt('tenant_network_mask_bits',
Attila Fazekas8ea181b2013-07-13 16:26:14 +0200312 default=28,
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500313 help="The mask bits for tenant networks"),
314 cfg.BoolOpt('tenant_networks_reachable',
315 default=False,
316 help="Whether tenant network connectivity should be "
317 "evaluated directly"),
318 cfg.StrOpt('public_network_id',
319 default="",
320 help="Id of the public network that provides external "
321 "connectivity"),
322 cfg.StrOpt('public_router_id',
323 default="",
324 help="Id of the public router that provides external "
325 "connectivity"),
326]
Jay Pipes3f981df2012-03-27 18:59:44 -0400327
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500328volume_group = cfg.OptGroup(name='volume',
329 title='Block Storage Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600330
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500331VolumeGroup = [
332 cfg.IntOpt('build_interval',
333 default=10,
334 help='Time in seconds between volume availability checks.'),
335 cfg.IntOpt('build_timeout',
336 default=300,
337 help='Timeout in seconds to wait for a volume to become'
338 'available.'),
339 cfg.StrOpt('catalog_type',
Matthew Treinisheb724512013-10-25 15:12:59 +0000340 default='volume',
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500341 help="Catalog type of the Volume Service"),
Arata Notsu8f440392013-09-13 16:14:20 +0900342 cfg.StrOpt('region',
343 default='',
344 help="The volume region name to use. If empty, the value "
345 "of identity.region is used instead. If no such region "
346 "is found in the service catalog, the first found one is "
347 "used."),
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100348 cfg.StrOpt('backend1_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200349 default='BACKEND_1',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100350 help="Name of the backend1 (must be declared in cinder.conf)"),
351 cfg.StrOpt('backend2_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200352 default='BACKEND_2',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100353 help="Name of the backend2 (must be declared in cinder.conf)"),
Adam Gandelman827ad332013-06-24 17:04:09 -0700354 cfg.StrOpt('storage_protocol',
355 default='iSCSI',
356 help='Backend protocol to target when creating volume types'),
357 cfg.StrOpt('vendor_name',
358 default='Open Source',
359 help='Backend vendor to target when creating volume types'),
Ryan Hsua67f4632013-08-29 16:03:06 -0700360 cfg.StrOpt('disk_format',
361 default='raw',
362 help='Disk format to use when copying a volume to image'),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500363]
K Jonathan Harkerd6ba4b42012-12-18 13:50:47 -0800364
Matthew Treinishd5c96022013-10-17 21:51:23 +0000365volume_feature_group = cfg.OptGroup(name='volume-feature-enabled',
366 title='Enabled Cinder Features')
367
368VolumeFeaturesGroup = [
369 cfg.BoolOpt('multi_backend',
370 default=False,
371 help="Runs Cinder multi-backend test (requires 2 backends)")
372]
373
Daryl Walleck587385b2012-03-03 13:00:26 -0600374
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500375object_storage_group = cfg.OptGroup(name='object-storage',
376 title='Object Storage Service Options')
Attila Fazekasa23f5002012-10-23 19:32:45 +0200377
DennyZhang1e71b612013-09-26 12:35:40 -0500378ObjectStoreGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500379 cfg.StrOpt('catalog_type',
380 default='object-store',
381 help="Catalog type of the Object-Storage service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900382 cfg.StrOpt('region',
383 default='',
384 help="The object-storage region name to use. If empty, the "
385 "value of identity.region is used instead. If no such "
386 "region is found in the service catalog, the first found "
387 "one is used."),
Matthew Treinishf319a732013-10-24 21:39:24 +0000388 cfg.IntOpt('container_sync_timeout',
nayna-patelb4989b32013-01-09 06:25:13 +0000389 default=120,
390 help="Number of seconds to time on waiting for a container"
391 "to container synchronization complete."),
Matthew Treinishf319a732013-10-24 21:39:24 +0000392 cfg.IntOpt('container_sync_interval',
nayna-patelb4989b32013-01-09 06:25:13 +0000393 default=5,
394 help="Number of seconds to wait while looping to check the"
395 "status of a container to container synchronization"),
Matthew Treinish3fdb80c2013-08-15 11:13:19 -0400396 cfg.StrOpt('operator_role',
397 default='Member',
398 help="Role to add to users created for swift tests to "
399 "enable creating containers"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500400]
Attila Fazekasa23f5002012-10-23 19:32:45 +0200401
Matthew Treinishd5c96022013-10-17 21:51:23 +0000402object_storage_feature_group = cfg.OptGroup(
403 name='object-storage-feature-enabled',
404 title='Enabled object-storage features')
405
406ObjectStoreFeaturesGroup = [
407 cfg.BoolOpt('container_quotas',
408 default=True,
409 help="Set to True if the container quota middleware "
410 "is enabled"),
411 cfg.BoolOpt('accounts_quotas',
412 default=True,
413 help="Set to True if the Account Quota middleware is enabled"),
Joe H. Rahme836da3f2013-10-09 15:47:16 +0200414 cfg.BoolOpt('crossdomain',
415 default=True,
416 help="Set to True if the Crossdomain middleware is enabled"),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000417]
418
Attila Fazekasa23f5002012-10-23 19:32:45 +0200419
Steve Bakerc60e4e32013-05-06 15:22:41 +1200420orchestration_group = cfg.OptGroup(name='orchestration',
421 title='Orchestration Service Options')
422
423OrchestrationGroup = [
424 cfg.StrOpt('catalog_type',
425 default='orchestration',
426 help="Catalog type of the Orchestration service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900427 cfg.StrOpt('region',
428 default='',
429 help="The orchestration region name to use. If empty, the "
430 "value of identity.region is used instead. If no such "
431 "region is found in the service catalog, the first found "
432 "one is used."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200433 cfg.BoolOpt('allow_tenant_isolation',
434 default=False,
435 help="Allows test cases to create/destroy tenants and "
436 "users. This option enables isolated test cases and "
437 "better parallel execution, but also requires that "
438 "OpenStack Identity API admin credentials are known."),
439 cfg.IntOpt('build_interval',
440 default=1,
441 help="Time in seconds between build status checks."),
442 cfg.IntOpt('build_timeout',
443 default=300,
444 help="Timeout in seconds to wait for a stack to build."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200445 cfg.StrOpt('instance_type',
Steve Baker9e86b832013-05-22 15:40:28 +1200446 default='m1.micro',
Steve Bakerc60e4e32013-05-06 15:22:41 +1200447 help="Instance type for tests. Needs to be big enough for a "
448 "full OS plus the test workload"),
449 cfg.StrOpt('image_ref',
450 default=None,
451 help="Name of heat-cfntools enabled image to use when "
452 "launching test instances."),
453 cfg.StrOpt('keypair_name',
454 default=None,
455 help="Name of existing keypair to launch servers with."),
Clint Byrum71f27632013-09-09 11:41:32 -0700456 cfg.IntOpt('max_template_size',
Joe Gordon0e51b222013-10-24 14:11:10 +0100457 default=524288,
Clint Byrum71f27632013-09-09 11:41:32 -0700458 help="Value must match heat configuration of the same name."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200459]
460
461
Julie Pichond1017642013-07-24 16:37:23 +0100462dashboard_group = cfg.OptGroup(name="dashboard",
463 title="Dashboard options")
464
465DashboardGroup = [
466 cfg.StrOpt('dashboard_url',
467 default='http://localhost/',
468 help="Where the dashboard can be found"),
469 cfg.StrOpt('login_url',
470 default='http://localhost/auth/login/',
471 help="Login page for the dashboard"),
472]
473
474
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500475boto_group = cfg.OptGroup(name='boto',
476 title='EC2/S3 options')
DennyZhang1e71b612013-09-26 12:35:40 -0500477BotoGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500478 cfg.StrOpt('ec2_url',
479 default="http://localhost:8773/services/Cloud",
480 help="EC2 URL"),
481 cfg.StrOpt('s3_url',
482 default="http://localhost:8080",
483 help="S3 URL"),
484 cfg.StrOpt('aws_secret',
485 default=None,
486 help="AWS Secret Key",
487 secret=True),
488 cfg.StrOpt('aws_access',
489 default=None,
490 help="AWS Access Key"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500491 cfg.StrOpt('s3_materials_path',
492 default="/opt/stack/devstack/files/images/"
493 "s3-materials/cirros-0.3.0",
494 help="S3 Materials Path"),
495 cfg.StrOpt('ari_manifest',
496 default="cirros-0.3.0-x86_64-initrd.manifest.xml",
497 help="ARI Ramdisk Image manifest"),
498 cfg.StrOpt('ami_manifest',
499 default="cirros-0.3.0-x86_64-blank.img.manifest.xml",
500 help="AMI Machine Image manifest"),
501 cfg.StrOpt('aki_manifest',
502 default="cirros-0.3.0-x86_64-vmlinuz.manifest.xml",
503 help="AKI Kernel Image manifest"),
504 cfg.StrOpt('instance_type',
505 default="m1.tiny",
506 help="Instance type"),
507 cfg.IntOpt('http_socket_timeout',
508 default=3,
509 help="boto Http socket timeout"),
510 cfg.IntOpt('num_retries',
511 default=1,
512 help="boto num_retries on error"),
513 cfg.IntOpt('build_timeout',
514 default=60,
515 help="Status Change Timeout"),
516 cfg.IntOpt('build_interval',
517 default=1,
518 help="Status Change Test Interval"),
519]
Attila Fazekasf7f2d932012-12-13 09:14:38 +0100520
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500521stress_group = cfg.OptGroup(name='stress', title='Stress Test Options')
522
523StressGroup = [
524 cfg.StrOpt('nova_logdir',
525 default=None,
526 help='Directory containing log files on the compute nodes'),
527 cfg.IntOpt('max_instances',
528 default=16,
529 help='Maximum number of instances to create during test.'),
530 cfg.StrOpt('controller',
531 default=None,
David Kranzb9d97502013-05-01 15:55:04 -0400532 help='Controller host.'),
533 # new stress options
534 cfg.StrOpt('target_controller',
535 default=None,
536 help='Controller host.'),
537 cfg.StrOpt('target_ssh_user',
538 default=None,
539 help='ssh user.'),
540 cfg.StrOpt('target_private_key_path',
541 default=None,
542 help='Path to private key.'),
543 cfg.StrOpt('target_logfiles',
544 default=None,
545 help='regexp for list of log files.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000546 cfg.IntOpt('log_check_interval',
David Kranzb9d97502013-05-01 15:55:04 -0400547 default=60,
Marc Koderer32221b8e2013-08-23 13:57:50 +0200548 help='time (in seconds) between log file error checks.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000549 cfg.IntOpt('default_thread_number_per_action',
Marc Koderer32221b8e2013-08-23 13:57:50 +0200550 default=4,
551 help='The number of threads created while stress test.')
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500552]
553
554
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900555scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options')
556
557ScenarioGroup = [
558 cfg.StrOpt('img_dir',
559 default='/opt/stack/new/devstack/files/images/'
560 'cirros-0.3.1-x86_64-uec',
561 help='Directory containing image files'),
562 cfg.StrOpt('ami_img_file',
563 default='cirros-0.3.1-x86_64-blank.img',
564 help='AMI image file name'),
565 cfg.StrOpt('ari_img_file',
566 default='cirros-0.3.1-x86_64-initrd',
567 help='ARI image file name'),
568 cfg.StrOpt('aki_img_file',
569 default='cirros-0.3.1-x86_64-vmlinuz',
570 help='AKI image file name'),
571 cfg.StrOpt('ssh_user',
572 default='cirros',
Joe Gordonb5e10cd2013-07-10 15:51:12 +0000573 help='ssh username for the image file'),
574 cfg.IntOpt(
575 'large_ops_number',
576 default=0,
577 help="specifies how many resources to request at once. Used "
578 "for large operations testing.")
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900579]
580
581
Matthew Treinish4c412922013-07-16 15:27:42 -0400582service_available_group = cfg.OptGroup(name="service_available",
583 title="Available OpenStack Services")
584
585ServiceAvailableGroup = [
586 cfg.BoolOpt('cinder',
587 default=True,
588 help="Whether or not cinder is expected to be available"),
Matthew Treinishfaa340d2013-07-19 16:26:21 -0400589 cfg.BoolOpt('neutron',
590 default=False,
591 help="Whether or not neutron is expected to be available"),
Matthew Treinish853ae442013-07-19 16:36:07 -0400592 cfg.BoolOpt('glance',
593 default=True,
594 help="Whether or not glance is expected to be available"),
Matthew Treinish61e332b2013-07-19 16:42:31 -0400595 cfg.BoolOpt('swift',
596 default=True,
597 help="Whether or not swift is expected to be available"),
Matthew Treinish6b41e242013-07-19 16:49:28 -0400598 cfg.BoolOpt('nova',
599 default=True,
600 help="Whether or not nova is expected to be available"),
Matthew Treinisha9d43882013-07-19 16:54:52 -0400601 cfg.BoolOpt('heat',
602 default=False,
603 help="Whether or not Heat is expected to be available"),
Mehdi Abaakouk8581c0b2013-10-04 10:45:42 +0200604 cfg.BoolOpt('ceilometer',
605 default=True,
606 help="Whether or not Ceilometer is expected to be available"),
Julie Pichond1017642013-07-24 16:37:23 +0100607 cfg.BoolOpt('horizon',
608 default=True,
609 help="Whether or not Horizon is expected to be available"),
Matthew Treinish4c412922013-07-16 15:27:42 -0400610]
611
Attila Fazekasaeeeefd2013-08-06 17:01:56 +0200612debug_group = cfg.OptGroup(name="debug",
613 title="Debug System")
614
615DebugGroup = [
616 cfg.BoolOpt('enable',
617 default=True,
618 help="Enable diagnostic commands"),
619]
620
621
Jay Pipes3f981df2012-03-27 18:59:44 -0400622@singleton
623class TempestConfig:
Daryl Walleck1465d612011-11-02 02:22:15 -0500624 """Provides OpenStack configuration information."""
625
Brian Waldon738cd632011-12-12 18:45:09 -0500626 DEFAULT_CONFIG_DIR = os.path.join(
Zhongyue Luoa1343de2013-01-04 16:21:35 +0800627 os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
Brian Waldon738cd632011-12-12 18:45:09 -0500628 "etc")
Daryl Walleck1465d612011-11-02 02:22:15 -0500629
Brian Waldon738cd632011-12-12 18:45:09 -0500630 DEFAULT_CONFIG_FILE = "tempest.conf"
631
632 def __init__(self):
633 """Initialize a configuration from a conf directory and conf file."""
Sean Dague2416cf32013-04-10 08:29:07 -0400634 config_files = []
Sean Dague2416cf32013-04-10 08:29:07 -0400635 failsafe_path = "/etc/tempest/" + self.DEFAULT_CONFIG_FILE
Brian Waldon738cd632011-12-12 18:45:09 -0500636
637 # Environment variables override defaults...
638 conf_dir = os.environ.get('TEMPEST_CONFIG_DIR',
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800639 self.DEFAULT_CONFIG_DIR)
640 conf_file = os.environ.get('TEMPEST_CONFIG', self.DEFAULT_CONFIG_FILE)
Brian Waldon738cd632011-12-12 18:45:09 -0500641
Jay Pipes7f757632011-12-02 15:53:32 -0500642 path = os.path.join(conf_dir, conf_file)
643
Zhongyue Luoafd43eb2013-02-04 11:32:57 +0800644 if not (os.path.isfile(path) or
645 'TEMPEST_CONFIG_DIR' in os.environ or
646 'TEMPEST_CONFIG' in os.environ):
Sean Dague2416cf32013-04-10 08:29:07 -0400647 path = failsafe_path
Attila Fazekas5abb2532012-12-04 11:30:49 +0100648
Jay Pipes7f757632011-12-02 15:53:32 -0500649 if not os.path.exists(path):
Sean Dague43cd9052013-07-19 12:20:04 -0400650 msg = "Config file %s not found" % path
Dirk Muellere746fc22013-06-29 16:29:29 +0200651 print(RuntimeError(msg), file=sys.stderr)
Sean Dague2416cf32013-04-10 08:29:07 -0400652 else:
653 config_files.append(path)
Jay Pipes7f757632011-12-02 15:53:32 -0500654
Sean Dague2416cf32013-04-10 08:29:07 -0400655 cfg.CONF([], project='tempest', default_config_files=config_files)
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -0400656 logging.setup('tempest')
657 LOG = logging.getLogger('tempest')
658 LOG.info("Using tempest config file %s" % path)
Daryl Walleck1465d612011-11-02 02:22:15 -0500659
DennyZhang88a2dd82013-10-07 12:55:35 -0500660 register_opt_group(cfg.CONF, compute_group, ComputeGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000661 register_opt_group(cfg.CONF, compute_features_group,
662 ComputeFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500663 register_opt_group(cfg.CONF, identity_group, IdentityGroup)
664 register_opt_group(cfg.CONF, image_group, ImageGroup)
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000665 register_opt_group(cfg.CONF, image_feature_group, ImageFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500666 register_opt_group(cfg.CONF, network_group, NetworkGroup)
667 register_opt_group(cfg.CONF, volume_group, VolumeGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000668 register_opt_group(cfg.CONF, volume_feature_group,
669 VolumeFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500670 register_opt_group(cfg.CONF, object_storage_group, ObjectStoreGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000671 register_opt_group(cfg.CONF, object_storage_feature_group,
672 ObjectStoreFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500673 register_opt_group(cfg.CONF, orchestration_group, OrchestrationGroup)
674 register_opt_group(cfg.CONF, dashboard_group, DashboardGroup)
675 register_opt_group(cfg.CONF, boto_group, BotoGroup)
676 register_opt_group(cfg.CONF, compute_admin_group, ComputeAdminGroup)
677 register_opt_group(cfg.CONF, stress_group, StressGroup)
678 register_opt_group(cfg.CONF, scenario_group, ScenarioGroup)
679 register_opt_group(cfg.CONF, service_available_group,
680 ServiceAvailableGroup)
681 register_opt_group(cfg.CONF, debug_group, DebugGroup)
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500682 self.compute = cfg.CONF.compute
Matthew Treinishd5c96022013-10-17 21:51:23 +0000683 self.compute_feature_enabled = cfg.CONF['compute-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500684 self.identity = cfg.CONF.identity
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500685 self.images = cfg.CONF.image
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000686 self.image_feature_enabled = cfg.CONF['image-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500687 self.network = cfg.CONF.network
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500688 self.volume = cfg.CONF.volume
Matthew Treinishd5c96022013-10-17 21:51:23 +0000689 self.volume_feature_enabled = cfg.CONF['volume-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500690 self.object_storage = cfg.CONF['object-storage']
Matthew Treinishd5c96022013-10-17 21:51:23 +0000691 self.object_storage_feature_enabled = cfg.CONF[
692 'object-storage-feature-enabled']
Steve Bakerc60e4e32013-05-06 15:22:41 +1200693 self.orchestration = cfg.CONF.orchestration
Julie Pichond1017642013-07-24 16:37:23 +0100694 self.dashboard = cfg.CONF.dashboard
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500695 self.boto = cfg.CONF.boto
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100696 self.compute_admin = cfg.CONF['compute-admin']
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500697 self.stress = cfg.CONF.stress
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900698 self.scenario = cfg.CONF.scenario
Matthew Treinish4c412922013-07-16 15:27:42 -0400699 self.service_available = cfg.CONF.service_available
Attila Fazekas5fae7a32013-09-25 16:52:44 +0200700 self.debug = cfg.CONF.debug
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100701 if not self.compute_admin.username:
702 self.compute_admin.username = self.identity.admin_username
703 self.compute_admin.password = self.identity.admin_password
704 self.compute_admin.tenant_name = self.identity.admin_tenant_name