blob: 3d9eba9fb9a3db29de6261a4f58d8bd97acb9035 [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."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500106 cfg.StrOpt('image_ref',
107 default="{$IMAGE_ID}",
108 help="Valid secondary image reference to be used in tests."),
109 cfg.StrOpt('image_ref_alt',
110 default="{$IMAGE_ID_ALT}",
111 help="Valid secondary image reference to be used in tests."),
Ken'ichi Ohmichi35772602013-11-14 15:03:27 +0900112 cfg.StrOpt('flavor_ref',
113 default="1",
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500114 help="Valid primary flavor to use in tests."),
Ken'ichi Ohmichi35772602013-11-14 15:03:27 +0900115 cfg.StrOpt('flavor_ref_alt',
116 default="2",
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500117 help='Valid secondary flavor to be used in tests.'),
Maru Newbyaf292e82013-05-20 21:32:28 +0000118 cfg.StrOpt('image_ssh_user',
119 default="root",
120 help="User name used to authenticate to an instance."),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700121 cfg.StrOpt('image_ssh_password',
122 default="password",
123 help="Password used to authenticate to an instance."),
Maru Newbyaf292e82013-05-20 21:32:28 +0000124 cfg.StrOpt('image_alt_ssh_user',
125 default="root",
126 help="User name used to authenticate to an instance using "
127 "the alternate image."),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700128 cfg.StrOpt('image_alt_ssh_password',
129 default="password",
130 help="Password used to authenticate to an instance using "
131 "the alternate image."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500132 cfg.IntOpt('build_interval',
133 default=10,
134 help="Time in seconds between build status checks."),
135 cfg.IntOpt('build_timeout',
136 default=300,
137 help="Timeout in seconds to wait for an instance to build."),
138 cfg.BoolOpt('run_ssh',
139 default=False,
140 help="Does the test environment support snapshots?"),
141 cfg.StrOpt('ssh_user',
142 default='root',
143 help="User name used to authenticate to an instance."),
Nachi Ueno6d580be2013-07-24 10:58:11 -0700144 cfg.IntOpt('ping_timeout',
145 default=60,
146 help="Timeout in seconds to wait for ping to "
147 "succeed."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500148 cfg.IntOpt('ssh_timeout',
149 default=300,
Chris Yeoh76916042013-02-27 16:25:25 +1030150 help="Timeout in seconds to wait for authentication to "
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500151 "succeed."),
Attila Fazekas0abbc952013-07-01 19:19:42 +0200152 cfg.IntOpt('ready_wait',
153 default=0,
DennyZhang8912d012013-09-25 18:08:34 -0500154 help="Additional wait time for clean state, when there is "
155 "no OS-EXT-STS extension available"),
Chris Yeoh76916042013-02-27 16:25:25 +1030156 cfg.IntOpt('ssh_channel_timeout',
157 default=60,
158 help="Timeout in seconds to wait for output from ssh "
159 "channel."),
Attila Fazekasb0661652013-05-08 13:01:36 +0200160 cfg.StrOpt('fixed_network_name',
161 default='private',
162 help="Visible fixed network name "),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500163 cfg.StrOpt('network_for_ssh',
164 default='public',
165 help="Network used for SSH connections."),
166 cfg.IntOpt('ip_version_for_ssh',
167 default=4,
168 help="IP version used for SSH connections."),
fujioka yuuichia11994e2013-07-09 11:19:51 +0900169 cfg.BoolOpt('use_floatingip_for_ssh',
170 default=True,
171 help="Dose the SSH uses Floating IP?"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500172 cfg.StrOpt('catalog_type',
173 default='compute',
174 help="Catalog type of the Compute service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900175 cfg.StrOpt('region',
176 default='',
177 help="The compute region name to use. If empty, the value "
178 "of identity.region is used instead. If no such region "
179 "is found in the service catalog, the first found one is "
180 "used."),
ivan-zhu8f992be2013-07-31 14:56:58 +0800181 cfg.StrOpt('catalog_v3_type',
182 default='computev3',
183 help="Catalog type of the Compute v3 service."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100184 cfg.StrOpt('path_to_private_key',
185 default=None,
186 help="Path to a private key file for SSH access to remote "
187 "hosts"),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700188 cfg.StrOpt('volume_device_name',
189 default='vdb',
190 help="Expected device name when a volume is attached to "
Ken'ichi Ohmichi39437e22013-10-06 00:21:38 +0900191 "an instance"),
192 cfg.IntOpt('shelved_offload_time',
193 default=0,
194 help='Time in seconds before a shelved instance is eligible '
195 'for removing from a host. -1 never offload, 0 offload '
196 'when shelved. This time should be the same as the time '
197 'of nova.conf, and some tests will run for as long as the '
198 'time.')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500199]
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800200
Matthew Treinishd5c96022013-10-17 21:51:23 +0000201compute_features_group = cfg.OptGroup(name='compute-feature-enabled',
202 title="Enabled Compute Service Features")
203
204ComputeFeaturesGroup = [
ivan-zhu8f992be2013-07-31 14:56:58 +0800205 cfg.BoolOpt('api_v3',
Chris Yeohfbc15de2013-11-26 10:20:08 +1030206 default=True,
ivan-zhu8f992be2013-07-31 14:56:58 +0800207 help="If false, skip all nova v3 tests."),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000208 cfg.BoolOpt('disk_config',
209 default=True,
210 help="If false, skip disk config tests"),
Matthew Treinishe3d26142013-11-26 19:14:58 +0000211 cfg.ListOpt('api_extensions',
212 default=['all'],
213 help='A list of enabled extensions with a special entry all '
214 'which indicates every extension is enabled'),
215 cfg.ListOpt('api_v3_extensions',
216 default=['all'],
217 help='A list of enabled v3 extensions with a special entry all'
218 ' which indicates every extension is enabled'),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000219 cfg.BoolOpt('change_password',
220 default=False,
221 help="Does the test environment support changing the admin "
222 "password?"),
223 cfg.BoolOpt('create_image',
224 default=False,
225 help="Does the test environment support snapshots?"),
226 cfg.BoolOpt('resize',
227 default=False,
228 help="Does the test environment support resizing?"),
229 cfg.BoolOpt('live_migration',
230 default=False,
231 help="Does the test environment support live migration "
232 "available?"),
233 cfg.BoolOpt('block_migration_for_live_migration',
234 default=False,
235 help="Does the test environment use block devices for live "
236 "migration"),
237 cfg.BoolOpt('block_migrate_cinder_iscsi',
238 default=False,
239 help="Does the test environment block migration support "
240 "cinder iSCSI volumes")
241]
242
243
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500244compute_admin_group = cfg.OptGroup(name='compute-admin',
245 title="Compute Admin Options")
donald-ngo7fb1efa2011-12-13 17:17:36 -0800246
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500247ComputeAdminGroup = [
248 cfg.StrOpt('username',
249 default='admin',
250 help="Administrative Username to use for Nova API requests."),
251 cfg.StrOpt('tenant_name',
252 default='admin',
253 help="Administrative Tenant name to use for Nova API "
254 "requests."),
255 cfg.StrOpt('password',
256 default='pass',
257 help="API key to use when authenticating as admin.",
258 secret=True),
259]
Daryl Walleck587385b2012-03-03 13:00:26 -0600260
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500261image_group = cfg.OptGroup(name='image',
262 title="Image Service Options")
Jay Pipesf38eaac2012-06-21 13:37:35 -0400263
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500264ImageGroup = [
Matthew Treinish72ea4422013-02-07 14:42:49 -0500265 cfg.StrOpt('catalog_type',
266 default='image',
Sean Dague83401992013-05-06 17:46:36 -0400267 help='Catalog type of the Image service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900268 cfg.StrOpt('region',
269 default='',
270 help="The image region name to use. If empty, the value "
271 "of identity.region is used instead. If no such region "
272 "is found in the service catalog, the first found one is "
273 "used."),
Sean Dague83401992013-05-06 17:46:36 -0400274 cfg.StrOpt('http_image',
275 default='http://download.cirros-cloud.net/0.3.1/'
276 'cirros-0.3.1-x86_64-uec.tar.gz',
DennyZhang8912d012013-09-25 18:08:34 -0500277 help='http accessible image')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500278]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400279
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000280image_feature_group = cfg.OptGroup(name='image-feature-enabled',
281 title='Enabled image service features')
282
283ImageFeaturesGroup = [
284 cfg.BoolOpt('api_v2',
285 default=True,
286 help="Is the v2 image API enabled"),
287 cfg.BoolOpt('api_v1',
288 default=True,
289 help="Is the v1 image API enabled"),
290]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400291
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500292network_group = cfg.OptGroup(name='network',
293 title='Network Service Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600294
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500295NetworkGroup = [
296 cfg.StrOpt('catalog_type',
297 default='network',
Mark McClainf2982e82013-07-06 17:48:03 -0400298 help='Catalog type of the Neutron service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900299 cfg.StrOpt('region',
300 default='',
301 help="The network region name to use. If empty, the value "
302 "of identity.region is used instead. If no such region "
303 "is found in the service catalog, the first found one is "
304 "used."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500305 cfg.StrOpt('tenant_network_cidr',
306 default="10.100.0.0/16",
307 help="The cidr block to allocate tenant networks from"),
308 cfg.IntOpt('tenant_network_mask_bits',
Attila Fazekas8ea181b2013-07-13 16:26:14 +0200309 default=28,
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500310 help="The mask bits for tenant networks"),
311 cfg.BoolOpt('tenant_networks_reachable',
312 default=False,
313 help="Whether tenant network connectivity should be "
314 "evaluated directly"),
315 cfg.StrOpt('public_network_id',
316 default="",
317 help="Id of the public network that provides external "
318 "connectivity"),
319 cfg.StrOpt('public_router_id',
320 default="",
321 help="Id of the public router that provides external "
322 "connectivity"),
323]
Jay Pipes3f981df2012-03-27 18:59:44 -0400324
Matthew Treinishe3d26142013-11-26 19:14:58 +0000325network_feature_group = cfg.OptGroup(name='network-feature-enabled',
326 title='Enabled network service features')
327
328NetworkFeaturesGroup = [
329 cfg.ListOpt('api_extensions',
330 default=['all'],
331 help='A list of enabled extensions with a special entry all '
332 'which indicates every extension is enabled'),
333]
334
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500335volume_group = cfg.OptGroup(name='volume',
336 title='Block Storage Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600337
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500338VolumeGroup = [
339 cfg.IntOpt('build_interval',
340 default=10,
341 help='Time in seconds between volume availability checks.'),
342 cfg.IntOpt('build_timeout',
343 default=300,
344 help='Timeout in seconds to wait for a volume to become'
345 'available.'),
346 cfg.StrOpt('catalog_type',
Matthew Treinisheb724512013-10-25 15:12:59 +0000347 default='volume',
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500348 help="Catalog type of the Volume Service"),
Arata Notsu8f440392013-09-13 16:14:20 +0900349 cfg.StrOpt('region',
350 default='',
351 help="The volume region name to use. If empty, the value "
352 "of identity.region is used instead. If no such region "
353 "is found in the service catalog, the first found one is "
354 "used."),
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100355 cfg.StrOpt('backend1_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200356 default='BACKEND_1',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100357 help="Name of the backend1 (must be declared in cinder.conf)"),
358 cfg.StrOpt('backend2_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200359 default='BACKEND_2',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100360 help="Name of the backend2 (must be declared in cinder.conf)"),
Adam Gandelman827ad332013-06-24 17:04:09 -0700361 cfg.StrOpt('storage_protocol',
362 default='iSCSI',
363 help='Backend protocol to target when creating volume types'),
364 cfg.StrOpt('vendor_name',
365 default='Open Source',
366 help='Backend vendor to target when creating volume types'),
Ryan Hsua67f4632013-08-29 16:03:06 -0700367 cfg.StrOpt('disk_format',
368 default='raw',
369 help='Disk format to use when copying a volume to image'),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500370]
K Jonathan Harkerd6ba4b42012-12-18 13:50:47 -0800371
Matthew Treinishd5c96022013-10-17 21:51:23 +0000372volume_feature_group = cfg.OptGroup(name='volume-feature-enabled',
373 title='Enabled Cinder Features')
374
375VolumeFeaturesGroup = [
376 cfg.BoolOpt('multi_backend',
377 default=False,
Matthew Treinishe3d26142013-11-26 19:14:58 +0000378 help="Runs Cinder multi-backend test (requires 2 backends)"),
379 cfg.ListOpt('api_extensions',
380 default=['all'],
381 help='A list of enabled extensions with a special entry all '
382 'which indicates every extension is enabled'),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000383]
384
Daryl Walleck587385b2012-03-03 13:00:26 -0600385
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500386object_storage_group = cfg.OptGroup(name='object-storage',
387 title='Object Storage Service Options')
Attila Fazekasa23f5002012-10-23 19:32:45 +0200388
DennyZhang1e71b612013-09-26 12:35:40 -0500389ObjectStoreGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500390 cfg.StrOpt('catalog_type',
391 default='object-store',
392 help="Catalog type of the Object-Storage service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900393 cfg.StrOpt('region',
394 default='',
395 help="The object-storage region name to use. If empty, the "
396 "value of identity.region is used instead. If no such "
397 "region is found in the service catalog, the first found "
398 "one is used."),
Matthew Treinishf319a732013-10-24 21:39:24 +0000399 cfg.IntOpt('container_sync_timeout',
nayna-patelb4989b32013-01-09 06:25:13 +0000400 default=120,
401 help="Number of seconds to time on waiting for a container"
402 "to container synchronization complete."),
Matthew Treinishf319a732013-10-24 21:39:24 +0000403 cfg.IntOpt('container_sync_interval',
nayna-patelb4989b32013-01-09 06:25:13 +0000404 default=5,
405 help="Number of seconds to wait while looping to check the"
406 "status of a container to container synchronization"),
Matthew Treinish3fdb80c2013-08-15 11:13:19 -0400407 cfg.StrOpt('operator_role',
408 default='Member',
409 help="Role to add to users created for swift tests to "
410 "enable creating containers"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500411]
Attila Fazekasa23f5002012-10-23 19:32:45 +0200412
Matthew Treinishd5c96022013-10-17 21:51:23 +0000413object_storage_feature_group = cfg.OptGroup(
414 name='object-storage-feature-enabled',
415 title='Enabled object-storage features')
416
417ObjectStoreFeaturesGroup = [
418 cfg.BoolOpt('container_quotas',
419 default=True,
Joe H. Rahme3f2d4c62013-11-19 18:25:31 +0100420 help="Set to True if the Container Quota middleware "
Matthew Treinishd5c96022013-10-17 21:51:23 +0000421 "is enabled"),
422 cfg.BoolOpt('accounts_quotas',
423 default=True,
424 help="Set to True if the Account Quota middleware is enabled"),
Joe H. Rahme836da3f2013-10-09 15:47:16 +0200425 cfg.BoolOpt('crossdomain',
426 default=True,
427 help="Set to True if the Crossdomain middleware is enabled"),
Joe H. Rahme3f2d4c62013-11-19 18:25:31 +0100428 cfg.BoolOpt('tempurl',
429 default=True,
430 help="Set to True if the TempURL middleware is enabled"),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000431]
432
Attila Fazekasa23f5002012-10-23 19:32:45 +0200433
Steve Bakerc60e4e32013-05-06 15:22:41 +1200434orchestration_group = cfg.OptGroup(name='orchestration',
435 title='Orchestration Service Options')
436
437OrchestrationGroup = [
438 cfg.StrOpt('catalog_type',
439 default='orchestration',
440 help="Catalog type of the Orchestration service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900441 cfg.StrOpt('region',
442 default='',
443 help="The orchestration region name to use. If empty, the "
444 "value of identity.region is used instead. If no such "
445 "region is found in the service catalog, the first found "
446 "one is used."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200447 cfg.BoolOpt('allow_tenant_isolation',
448 default=False,
449 help="Allows test cases to create/destroy tenants and "
450 "users. This option enables isolated test cases and "
451 "better parallel execution, but also requires that "
452 "OpenStack Identity API admin credentials are known."),
453 cfg.IntOpt('build_interval',
454 default=1,
455 help="Time in seconds between build status checks."),
456 cfg.IntOpt('build_timeout',
457 default=300,
458 help="Timeout in seconds to wait for a stack to build."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200459 cfg.StrOpt('instance_type',
Steve Baker9e86b832013-05-22 15:40:28 +1200460 default='m1.micro',
Steve Bakerc60e4e32013-05-06 15:22:41 +1200461 help="Instance type for tests. Needs to be big enough for a "
462 "full OS plus the test workload"),
463 cfg.StrOpt('image_ref',
464 default=None,
465 help="Name of heat-cfntools enabled image to use when "
466 "launching test instances."),
467 cfg.StrOpt('keypair_name',
468 default=None,
469 help="Name of existing keypair to launch servers with."),
Clint Byrum71f27632013-09-09 11:41:32 -0700470 cfg.IntOpt('max_template_size',
Joe Gordon0e51b222013-10-24 14:11:10 +0100471 default=524288,
Clint Byrum71f27632013-09-09 11:41:32 -0700472 help="Value must match heat configuration of the same name."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200473]
474
475
Julie Pichond1017642013-07-24 16:37:23 +0100476dashboard_group = cfg.OptGroup(name="dashboard",
477 title="Dashboard options")
478
479DashboardGroup = [
480 cfg.StrOpt('dashboard_url',
481 default='http://localhost/',
482 help="Where the dashboard can be found"),
483 cfg.StrOpt('login_url',
484 default='http://localhost/auth/login/',
485 help="Login page for the dashboard"),
486]
487
488
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500489boto_group = cfg.OptGroup(name='boto',
490 title='EC2/S3 options')
DennyZhang1e71b612013-09-26 12:35:40 -0500491BotoGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500492 cfg.StrOpt('ec2_url',
493 default="http://localhost:8773/services/Cloud",
494 help="EC2 URL"),
495 cfg.StrOpt('s3_url',
496 default="http://localhost:8080",
497 help="S3 URL"),
498 cfg.StrOpt('aws_secret',
499 default=None,
500 help="AWS Secret Key",
501 secret=True),
502 cfg.StrOpt('aws_access',
503 default=None,
504 help="AWS Access Key"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500505 cfg.StrOpt('s3_materials_path',
506 default="/opt/stack/devstack/files/images/"
507 "s3-materials/cirros-0.3.0",
508 help="S3 Materials Path"),
509 cfg.StrOpt('ari_manifest',
510 default="cirros-0.3.0-x86_64-initrd.manifest.xml",
511 help="ARI Ramdisk Image manifest"),
512 cfg.StrOpt('ami_manifest',
513 default="cirros-0.3.0-x86_64-blank.img.manifest.xml",
514 help="AMI Machine Image manifest"),
515 cfg.StrOpt('aki_manifest',
516 default="cirros-0.3.0-x86_64-vmlinuz.manifest.xml",
517 help="AKI Kernel Image manifest"),
518 cfg.StrOpt('instance_type',
519 default="m1.tiny",
520 help="Instance type"),
521 cfg.IntOpt('http_socket_timeout',
522 default=3,
523 help="boto Http socket timeout"),
524 cfg.IntOpt('num_retries',
525 default=1,
526 help="boto num_retries on error"),
527 cfg.IntOpt('build_timeout',
528 default=60,
529 help="Status Change Timeout"),
530 cfg.IntOpt('build_interval',
531 default=1,
532 help="Status Change Test Interval"),
533]
Attila Fazekasf7f2d932012-12-13 09:14:38 +0100534
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500535stress_group = cfg.OptGroup(name='stress', title='Stress Test Options')
536
537StressGroup = [
538 cfg.StrOpt('nova_logdir',
539 default=None,
540 help='Directory containing log files on the compute nodes'),
541 cfg.IntOpt('max_instances',
542 default=16,
543 help='Maximum number of instances to create during test.'),
544 cfg.StrOpt('controller',
545 default=None,
David Kranzb9d97502013-05-01 15:55:04 -0400546 help='Controller host.'),
547 # new stress options
548 cfg.StrOpt('target_controller',
549 default=None,
550 help='Controller host.'),
551 cfg.StrOpt('target_ssh_user',
552 default=None,
553 help='ssh user.'),
554 cfg.StrOpt('target_private_key_path',
555 default=None,
556 help='Path to private key.'),
557 cfg.StrOpt('target_logfiles',
558 default=None,
559 help='regexp for list of log files.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000560 cfg.IntOpt('log_check_interval',
David Kranzb9d97502013-05-01 15:55:04 -0400561 default=60,
Marc Koderer32221b8e2013-08-23 13:57:50 +0200562 help='time (in seconds) between log file error checks.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000563 cfg.IntOpt('default_thread_number_per_action',
Marc Koderer32221b8e2013-08-23 13:57:50 +0200564 default=4,
565 help='The number of threads created while stress test.')
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500566]
567
568
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900569scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options')
570
571ScenarioGroup = [
572 cfg.StrOpt('img_dir',
573 default='/opt/stack/new/devstack/files/images/'
574 'cirros-0.3.1-x86_64-uec',
575 help='Directory containing image files'),
576 cfg.StrOpt('ami_img_file',
577 default='cirros-0.3.1-x86_64-blank.img',
578 help='AMI image file name'),
579 cfg.StrOpt('ari_img_file',
580 default='cirros-0.3.1-x86_64-initrd',
581 help='ARI image file name'),
582 cfg.StrOpt('aki_img_file',
583 default='cirros-0.3.1-x86_64-vmlinuz',
584 help='AKI image file name'),
585 cfg.StrOpt('ssh_user',
586 default='cirros',
Joe Gordonb5e10cd2013-07-10 15:51:12 +0000587 help='ssh username for the image file'),
588 cfg.IntOpt(
589 'large_ops_number',
590 default=0,
591 help="specifies how many resources to request at once. Used "
592 "for large operations testing.")
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900593]
594
595
Matthew Treinish4c412922013-07-16 15:27:42 -0400596service_available_group = cfg.OptGroup(name="service_available",
597 title="Available OpenStack Services")
598
599ServiceAvailableGroup = [
600 cfg.BoolOpt('cinder',
601 default=True,
602 help="Whether or not cinder is expected to be available"),
Matthew Treinishfaa340d2013-07-19 16:26:21 -0400603 cfg.BoolOpt('neutron',
604 default=False,
605 help="Whether or not neutron is expected to be available"),
Matthew Treinish853ae442013-07-19 16:36:07 -0400606 cfg.BoolOpt('glance',
607 default=True,
608 help="Whether or not glance is expected to be available"),
Matthew Treinish61e332b2013-07-19 16:42:31 -0400609 cfg.BoolOpt('swift',
610 default=True,
611 help="Whether or not swift is expected to be available"),
Matthew Treinish6b41e242013-07-19 16:49:28 -0400612 cfg.BoolOpt('nova',
613 default=True,
614 help="Whether or not nova is expected to be available"),
Matthew Treinisha9d43882013-07-19 16:54:52 -0400615 cfg.BoolOpt('heat',
616 default=False,
617 help="Whether or not Heat is expected to be available"),
Mehdi Abaakouk8581c0b2013-10-04 10:45:42 +0200618 cfg.BoolOpt('ceilometer',
619 default=True,
620 help="Whether or not Ceilometer is expected to be available"),
Julie Pichond1017642013-07-24 16:37:23 +0100621 cfg.BoolOpt('horizon',
622 default=True,
623 help="Whether or not Horizon is expected to be available"),
Matthew Treinish4c412922013-07-16 15:27:42 -0400624]
625
Attila Fazekasaeeeefd2013-08-06 17:01:56 +0200626debug_group = cfg.OptGroup(name="debug",
627 title="Debug System")
628
629DebugGroup = [
630 cfg.BoolOpt('enable',
631 default=True,
632 help="Enable diagnostic commands"),
633]
634
635
Jay Pipes3f981df2012-03-27 18:59:44 -0400636@singleton
637class TempestConfig:
Daryl Walleck1465d612011-11-02 02:22:15 -0500638 """Provides OpenStack configuration information."""
639
Brian Waldon738cd632011-12-12 18:45:09 -0500640 DEFAULT_CONFIG_DIR = os.path.join(
Zhongyue Luoa1343de2013-01-04 16:21:35 +0800641 os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
Brian Waldon738cd632011-12-12 18:45:09 -0500642 "etc")
Daryl Walleck1465d612011-11-02 02:22:15 -0500643
Brian Waldon738cd632011-12-12 18:45:09 -0500644 DEFAULT_CONFIG_FILE = "tempest.conf"
645
646 def __init__(self):
647 """Initialize a configuration from a conf directory and conf file."""
Sean Dague2416cf32013-04-10 08:29:07 -0400648 config_files = []
Sean Dague2416cf32013-04-10 08:29:07 -0400649 failsafe_path = "/etc/tempest/" + self.DEFAULT_CONFIG_FILE
Brian Waldon738cd632011-12-12 18:45:09 -0500650
651 # Environment variables override defaults...
652 conf_dir = os.environ.get('TEMPEST_CONFIG_DIR',
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800653 self.DEFAULT_CONFIG_DIR)
654 conf_file = os.environ.get('TEMPEST_CONFIG', self.DEFAULT_CONFIG_FILE)
Brian Waldon738cd632011-12-12 18:45:09 -0500655
Jay Pipes7f757632011-12-02 15:53:32 -0500656 path = os.path.join(conf_dir, conf_file)
657
Zhongyue Luoafd43eb2013-02-04 11:32:57 +0800658 if not (os.path.isfile(path) or
659 'TEMPEST_CONFIG_DIR' in os.environ or
660 'TEMPEST_CONFIG' in os.environ):
Sean Dague2416cf32013-04-10 08:29:07 -0400661 path = failsafe_path
Attila Fazekas5abb2532012-12-04 11:30:49 +0100662
Jay Pipes7f757632011-12-02 15:53:32 -0500663 if not os.path.exists(path):
Sean Dague43cd9052013-07-19 12:20:04 -0400664 msg = "Config file %s not found" % path
Dirk Muellere746fc22013-06-29 16:29:29 +0200665 print(RuntimeError(msg), file=sys.stderr)
Sean Dague2416cf32013-04-10 08:29:07 -0400666 else:
667 config_files.append(path)
Jay Pipes7f757632011-12-02 15:53:32 -0500668
Sean Dague2416cf32013-04-10 08:29:07 -0400669 cfg.CONF([], project='tempest', default_config_files=config_files)
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -0400670 logging.setup('tempest')
671 LOG = logging.getLogger('tempest')
672 LOG.info("Using tempest config file %s" % path)
Daryl Walleck1465d612011-11-02 02:22:15 -0500673
DennyZhang88a2dd82013-10-07 12:55:35 -0500674 register_opt_group(cfg.CONF, compute_group, ComputeGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000675 register_opt_group(cfg.CONF, compute_features_group,
676 ComputeFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500677 register_opt_group(cfg.CONF, identity_group, IdentityGroup)
678 register_opt_group(cfg.CONF, image_group, ImageGroup)
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000679 register_opt_group(cfg.CONF, image_feature_group, ImageFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500680 register_opt_group(cfg.CONF, network_group, NetworkGroup)
Matthew Treinishe3d26142013-11-26 19:14:58 +0000681 register_opt_group(cfg.CONF, network_feature_group,
682 NetworkFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500683 register_opt_group(cfg.CONF, volume_group, VolumeGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000684 register_opt_group(cfg.CONF, volume_feature_group,
685 VolumeFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500686 register_opt_group(cfg.CONF, object_storage_group, ObjectStoreGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000687 register_opt_group(cfg.CONF, object_storage_feature_group,
688 ObjectStoreFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500689 register_opt_group(cfg.CONF, orchestration_group, OrchestrationGroup)
690 register_opt_group(cfg.CONF, dashboard_group, DashboardGroup)
691 register_opt_group(cfg.CONF, boto_group, BotoGroup)
692 register_opt_group(cfg.CONF, compute_admin_group, ComputeAdminGroup)
693 register_opt_group(cfg.CONF, stress_group, StressGroup)
694 register_opt_group(cfg.CONF, scenario_group, ScenarioGroup)
695 register_opt_group(cfg.CONF, service_available_group,
696 ServiceAvailableGroup)
697 register_opt_group(cfg.CONF, debug_group, DebugGroup)
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500698 self.compute = cfg.CONF.compute
Matthew Treinishd5c96022013-10-17 21:51:23 +0000699 self.compute_feature_enabled = cfg.CONF['compute-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500700 self.identity = cfg.CONF.identity
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500701 self.images = cfg.CONF.image
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000702 self.image_feature_enabled = cfg.CONF['image-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500703 self.network = cfg.CONF.network
Matthew Treinishe3d26142013-11-26 19:14:58 +0000704 self.network_feature_enabled = cfg.CONF['network-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500705 self.volume = cfg.CONF.volume
Matthew Treinishd5c96022013-10-17 21:51:23 +0000706 self.volume_feature_enabled = cfg.CONF['volume-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500707 self.object_storage = cfg.CONF['object-storage']
Matthew Treinishd5c96022013-10-17 21:51:23 +0000708 self.object_storage_feature_enabled = cfg.CONF[
709 'object-storage-feature-enabled']
Steve Bakerc60e4e32013-05-06 15:22:41 +1200710 self.orchestration = cfg.CONF.orchestration
Julie Pichond1017642013-07-24 16:37:23 +0100711 self.dashboard = cfg.CONF.dashboard
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500712 self.boto = cfg.CONF.boto
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100713 self.compute_admin = cfg.CONF['compute-admin']
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500714 self.stress = cfg.CONF.stress
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900715 self.scenario = cfg.CONF.scenario
Matthew Treinish4c412922013-07-16 15:27:42 -0400716 self.service_available = cfg.CONF.service_available
Attila Fazekas5fae7a32013-09-25 16:52:44 +0200717 self.debug = cfg.CONF.debug
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100718 if not self.compute_admin.username:
719 self.compute_admin.username = self.identity.admin_username
720 self.compute_admin.password = self.identity.admin_password
721 self.compute_admin.tenant_name = self.identity.admin_tenant_name