blob: ff0cddbbd08c2a2c8cb591812801a7e3e38e86aa [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.BoolOpt('resize_available',
141 default=False,
142 help="Does the test environment support resizing?"),
143 cfg.BoolOpt('live_migration_available',
144 default=False,
145 help="Does the test environment support live migration "
146 "available?"),
147 cfg.BoolOpt('use_block_migration_for_live_migration',
148 default=False,
149 help="Does the test environment use block devices for live "
150 "migration"),
Bob Ballc078be92013-04-09 14:25:00 +0100151 cfg.BoolOpt('block_migrate_supports_cinder_iscsi',
152 default=False,
153 help="Does the test environment block migration support "
154 "cinder iSCSI volumes"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500155 cfg.BoolOpt('change_password_available',
156 default=False,
157 help="Does the test environment support changing the admin "
158 "password?"),
159 cfg.BoolOpt('create_image_enabled',
160 default=False,
161 help="Does the test environment support snapshots?"),
162 cfg.IntOpt('build_interval',
163 default=10,
164 help="Time in seconds between build status checks."),
165 cfg.IntOpt('build_timeout',
166 default=300,
167 help="Timeout in seconds to wait for an instance to build."),
168 cfg.BoolOpt('run_ssh',
169 default=False,
170 help="Does the test environment support snapshots?"),
171 cfg.StrOpt('ssh_user',
172 default='root',
173 help="User name used to authenticate to an instance."),
Nachi Ueno6d580be2013-07-24 10:58:11 -0700174 cfg.IntOpt('ping_timeout',
175 default=60,
176 help="Timeout in seconds to wait for ping to "
177 "succeed."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500178 cfg.IntOpt('ssh_timeout',
179 default=300,
Chris Yeoh76916042013-02-27 16:25:25 +1030180 help="Timeout in seconds to wait for authentication to "
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500181 "succeed."),
Attila Fazekas0abbc952013-07-01 19:19:42 +0200182 cfg.IntOpt('ready_wait',
183 default=0,
DennyZhang8912d012013-09-25 18:08:34 -0500184 help="Additional wait time for clean state, when there is "
185 "no OS-EXT-STS extension available"),
Chris Yeoh76916042013-02-27 16:25:25 +1030186 cfg.IntOpt('ssh_channel_timeout',
187 default=60,
188 help="Timeout in seconds to wait for output from ssh "
189 "channel."),
Attila Fazekasb0661652013-05-08 13:01:36 +0200190 cfg.StrOpt('fixed_network_name',
191 default='private',
192 help="Visible fixed network name "),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500193 cfg.StrOpt('network_for_ssh',
194 default='public',
195 help="Network used for SSH connections."),
196 cfg.IntOpt('ip_version_for_ssh',
197 default=4,
198 help="IP version used for SSH connections."),
fujioka yuuichia11994e2013-07-09 11:19:51 +0900199 cfg.BoolOpt('use_floatingip_for_ssh',
200 default=True,
201 help="Dose the SSH uses Floating IP?"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500202 cfg.StrOpt('catalog_type',
203 default='compute',
204 help="Catalog type of the Compute service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900205 cfg.StrOpt('region',
206 default='',
207 help="The compute region name to use. If empty, the value "
208 "of identity.region is used instead. If no such region "
209 "is found in the service catalog, the first found one is "
210 "used."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100211 cfg.StrOpt('path_to_private_key',
212 default=None,
213 help="Path to a private key file for SSH access to remote "
214 "hosts"),
Attila Fazekas86950732013-06-08 09:33:08 +0200215 cfg.BoolOpt('disk_config_enabled',
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100216 default=True,
Attila Fazekas86950732013-06-08 09:33:08 +0200217 help="If false, skip disk config tests"),
218 cfg.BoolOpt('flavor_extra_enabled',
219 default=True,
220 help="If false, skip flavor extra data test"),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700221 cfg.StrOpt('volume_device_name',
222 default='vdb',
223 help="Expected device name when a volume is attached to "
224 "an instance")
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500225]
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800226
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500227compute_admin_group = cfg.OptGroup(name='compute-admin',
228 title="Compute Admin Options")
donald-ngo7fb1efa2011-12-13 17:17:36 -0800229
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500230ComputeAdminGroup = [
231 cfg.StrOpt('username',
232 default='admin',
233 help="Administrative Username to use for Nova API requests."),
234 cfg.StrOpt('tenant_name',
235 default='admin',
236 help="Administrative Tenant name to use for Nova API "
237 "requests."),
238 cfg.StrOpt('password',
239 default='pass',
240 help="API key to use when authenticating as admin.",
241 secret=True),
242]
Daryl Walleck587385b2012-03-03 13:00:26 -0600243
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500244image_group = cfg.OptGroup(name='image',
245 title="Image Service Options")
Jay Pipesf38eaac2012-06-21 13:37:35 -0400246
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500247ImageGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500248 cfg.StrOpt('api_version',
249 default='1',
250 help="Version of the API"),
Matthew Treinish72ea4422013-02-07 14:42:49 -0500251 cfg.StrOpt('catalog_type',
252 default='image',
Sean Dague83401992013-05-06 17:46:36 -0400253 help='Catalog type of the Image service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900254 cfg.StrOpt('region',
255 default='',
256 help="The image region name to use. If empty, the value "
257 "of identity.region is used instead. If no such region "
258 "is found in the service catalog, the first found one is "
259 "used."),
Sean Dague83401992013-05-06 17:46:36 -0400260 cfg.StrOpt('http_image',
261 default='http://download.cirros-cloud.net/0.3.1/'
262 'cirros-0.3.1-x86_64-uec.tar.gz',
DennyZhang8912d012013-09-25 18:08:34 -0500263 help='http accessible image')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500264]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400265
Jay Pipesf38eaac2012-06-21 13:37:35 -0400266
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500267network_group = cfg.OptGroup(name='network',
268 title='Network Service Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600269
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500270NetworkGroup = [
271 cfg.StrOpt('catalog_type',
272 default='network',
Mark McClainf2982e82013-07-06 17:48:03 -0400273 help='Catalog type of the Neutron service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900274 cfg.StrOpt('region',
275 default='',
276 help="The network region name to use. If empty, the value "
277 "of identity.region is used instead. If no such region "
278 "is found in the service catalog, the first found one is "
279 "used."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500280 cfg.StrOpt('tenant_network_cidr',
281 default="10.100.0.0/16",
282 help="The cidr block to allocate tenant networks from"),
283 cfg.IntOpt('tenant_network_mask_bits',
Attila Fazekas8ea181b2013-07-13 16:26:14 +0200284 default=28,
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500285 help="The mask bits for tenant networks"),
286 cfg.BoolOpt('tenant_networks_reachable',
287 default=False,
288 help="Whether tenant network connectivity should be "
289 "evaluated directly"),
290 cfg.StrOpt('public_network_id',
291 default="",
292 help="Id of the public network that provides external "
293 "connectivity"),
294 cfg.StrOpt('public_router_id',
295 default="",
296 help="Id of the public router that provides external "
297 "connectivity"),
298]
Jay Pipes3f981df2012-03-27 18:59:44 -0400299
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500300volume_group = cfg.OptGroup(name='volume',
301 title='Block Storage Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600302
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500303VolumeGroup = [
304 cfg.IntOpt('build_interval',
305 default=10,
306 help='Time in seconds between volume availability checks.'),
307 cfg.IntOpt('build_timeout',
308 default=300,
309 help='Timeout in seconds to wait for a volume to become'
310 'available.'),
311 cfg.StrOpt('catalog_type',
312 default='Volume',
313 help="Catalog type of the Volume Service"),
Arata Notsu8f440392013-09-13 16:14:20 +0900314 cfg.StrOpt('region',
315 default='',
316 help="The volume region name to use. If empty, the value "
317 "of identity.region is used instead. If no such region "
318 "is found in the service catalog, the first found one is "
319 "used."),
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100320 cfg.BoolOpt('multi_backend_enabled',
321 default=False,
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200322 help="Runs Cinder multi-backend test (requires 2 backends)"),
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100323 cfg.StrOpt('backend1_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200324 default='BACKEND_1',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100325 help="Name of the backend1 (must be declared in cinder.conf)"),
326 cfg.StrOpt('backend2_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200327 default='BACKEND_2',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100328 help="Name of the backend2 (must be declared in cinder.conf)"),
Adam Gandelman827ad332013-06-24 17:04:09 -0700329 cfg.StrOpt('storage_protocol',
330 default='iSCSI',
331 help='Backend protocol to target when creating volume types'),
332 cfg.StrOpt('vendor_name',
333 default='Open Source',
334 help='Backend vendor to target when creating volume types'),
Ryan Hsua67f4632013-08-29 16:03:06 -0700335 cfg.StrOpt('disk_format',
336 default='raw',
337 help='Disk format to use when copying a volume to image'),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500338]
K Jonathan Harkerd6ba4b42012-12-18 13:50:47 -0800339
Daryl Walleck587385b2012-03-03 13:00:26 -0600340
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500341object_storage_group = cfg.OptGroup(name='object-storage',
342 title='Object Storage Service Options')
Attila Fazekasa23f5002012-10-23 19:32:45 +0200343
DennyZhang1e71b612013-09-26 12:35:40 -0500344ObjectStoreGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500345 cfg.StrOpt('catalog_type',
346 default='object-store',
347 help="Catalog type of the Object-Storage service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900348 cfg.StrOpt('region',
349 default='',
350 help="The object-storage region name to use. If empty, the "
351 "value of identity.region is used instead. If no such "
352 "region is found in the service catalog, the first found "
353 "one is used."),
nayna-patelb4989b32013-01-09 06:25:13 +0000354 cfg.StrOpt('container_sync_timeout',
355 default=120,
356 help="Number of seconds to time on waiting for a container"
357 "to container synchronization complete."),
358 cfg.StrOpt('container_sync_interval',
359 default=5,
360 help="Number of seconds to wait while looping to check the"
361 "status of a container to container synchronization"),
Joe H. Rahme2b312572013-07-31 17:53:23 +0200362 cfg.BoolOpt('accounts_quotas_available',
363 default=True,
364 help="Set to True if the Account Quota middleware is enabled"),
Sahid Orentino Ferdjaoui44388b42013-09-12 09:07:40 +0000365 cfg.BoolOpt('container_quotas_available',
366 default=True,
367 help="Set to True if the container quota middleware "
368 "is enabled"),
Matthew Treinish3fdb80c2013-08-15 11:13:19 -0400369 cfg.StrOpt('operator_role',
370 default='Member',
371 help="Role to add to users created for swift tests to "
372 "enable creating containers"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500373]
Attila Fazekasa23f5002012-10-23 19:32:45 +0200374
Attila Fazekasa23f5002012-10-23 19:32:45 +0200375
Steve Bakerc60e4e32013-05-06 15:22:41 +1200376orchestration_group = cfg.OptGroup(name='orchestration',
377 title='Orchestration Service Options')
378
379OrchestrationGroup = [
380 cfg.StrOpt('catalog_type',
381 default='orchestration',
382 help="Catalog type of the Orchestration service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900383 cfg.StrOpt('region',
384 default='',
385 help="The orchestration region name to use. If empty, the "
386 "value of identity.region is used instead. If no such "
387 "region is found in the service catalog, the first found "
388 "one is used."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200389 cfg.BoolOpt('allow_tenant_isolation',
390 default=False,
391 help="Allows test cases to create/destroy tenants and "
392 "users. This option enables isolated test cases and "
393 "better parallel execution, but also requires that "
394 "OpenStack Identity API admin credentials are known."),
395 cfg.IntOpt('build_interval',
396 default=1,
397 help="Time in seconds between build status checks."),
398 cfg.IntOpt('build_timeout',
399 default=300,
400 help="Timeout in seconds to wait for a stack to build."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200401 cfg.StrOpt('instance_type',
Steve Baker9e86b832013-05-22 15:40:28 +1200402 default='m1.micro',
Steve Bakerc60e4e32013-05-06 15:22:41 +1200403 help="Instance type for tests. Needs to be big enough for a "
404 "full OS plus the test workload"),
405 cfg.StrOpt('image_ref',
406 default=None,
407 help="Name of heat-cfntools enabled image to use when "
408 "launching test instances."),
409 cfg.StrOpt('keypair_name',
410 default=None,
411 help="Name of existing keypair to launch servers with."),
Clint Byrum71f27632013-09-09 11:41:32 -0700412 cfg.IntOpt('max_template_size',
413 default=10240,
414 help="Value must match heat configuration of the same name."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200415]
416
417
Julie Pichond1017642013-07-24 16:37:23 +0100418dashboard_group = cfg.OptGroup(name="dashboard",
419 title="Dashboard options")
420
421DashboardGroup = [
422 cfg.StrOpt('dashboard_url',
423 default='http://localhost/',
424 help="Where the dashboard can be found"),
425 cfg.StrOpt('login_url',
426 default='http://localhost/auth/login/',
427 help="Login page for the dashboard"),
428]
429
430
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500431boto_group = cfg.OptGroup(name='boto',
432 title='EC2/S3 options')
DennyZhang1e71b612013-09-26 12:35:40 -0500433BotoGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500434 cfg.StrOpt('ec2_url',
435 default="http://localhost:8773/services/Cloud",
436 help="EC2 URL"),
437 cfg.StrOpt('s3_url',
438 default="http://localhost:8080",
439 help="S3 URL"),
440 cfg.StrOpt('aws_secret',
441 default=None,
442 help="AWS Secret Key",
443 secret=True),
444 cfg.StrOpt('aws_access',
445 default=None,
446 help="AWS Access Key"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500447 cfg.StrOpt('s3_materials_path',
448 default="/opt/stack/devstack/files/images/"
449 "s3-materials/cirros-0.3.0",
450 help="S3 Materials Path"),
451 cfg.StrOpt('ari_manifest',
452 default="cirros-0.3.0-x86_64-initrd.manifest.xml",
453 help="ARI Ramdisk Image manifest"),
454 cfg.StrOpt('ami_manifest',
455 default="cirros-0.3.0-x86_64-blank.img.manifest.xml",
456 help="AMI Machine Image manifest"),
457 cfg.StrOpt('aki_manifest',
458 default="cirros-0.3.0-x86_64-vmlinuz.manifest.xml",
459 help="AKI Kernel Image manifest"),
460 cfg.StrOpt('instance_type',
461 default="m1.tiny",
462 help="Instance type"),
463 cfg.IntOpt('http_socket_timeout',
464 default=3,
465 help="boto Http socket timeout"),
466 cfg.IntOpt('num_retries',
467 default=1,
468 help="boto num_retries on error"),
469 cfg.IntOpt('build_timeout',
470 default=60,
471 help="Status Change Timeout"),
472 cfg.IntOpt('build_interval',
473 default=1,
474 help="Status Change Test Interval"),
475]
Attila Fazekasf7f2d932012-12-13 09:14:38 +0100476
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500477stress_group = cfg.OptGroup(name='stress', title='Stress Test Options')
478
479StressGroup = [
480 cfg.StrOpt('nova_logdir',
481 default=None,
482 help='Directory containing log files on the compute nodes'),
483 cfg.IntOpt('max_instances',
484 default=16,
485 help='Maximum number of instances to create during test.'),
486 cfg.StrOpt('controller',
487 default=None,
David Kranzb9d97502013-05-01 15:55:04 -0400488 help='Controller host.'),
489 # new stress options
490 cfg.StrOpt('target_controller',
491 default=None,
492 help='Controller host.'),
493 cfg.StrOpt('target_ssh_user',
494 default=None,
495 help='ssh user.'),
496 cfg.StrOpt('target_private_key_path',
497 default=None,
498 help='Path to private key.'),
499 cfg.StrOpt('target_logfiles',
500 default=None,
501 help='regexp for list of log files.'),
502 cfg.StrOpt('log_check_interval',
503 default=60,
Marc Koderer32221b8e2013-08-23 13:57:50 +0200504 help='time (in seconds) between log file error checks.'),
505 cfg.StrOpt('default_thread_number_per_action',
506 default=4,
507 help='The number of threads created while stress test.')
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500508]
509
510
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900511scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options')
512
513ScenarioGroup = [
514 cfg.StrOpt('img_dir',
515 default='/opt/stack/new/devstack/files/images/'
516 'cirros-0.3.1-x86_64-uec',
517 help='Directory containing image files'),
518 cfg.StrOpt('ami_img_file',
519 default='cirros-0.3.1-x86_64-blank.img',
520 help='AMI image file name'),
521 cfg.StrOpt('ari_img_file',
522 default='cirros-0.3.1-x86_64-initrd',
523 help='ARI image file name'),
524 cfg.StrOpt('aki_img_file',
525 default='cirros-0.3.1-x86_64-vmlinuz',
526 help='AKI image file name'),
527 cfg.StrOpt('ssh_user',
528 default='cirros',
Joe Gordonb5e10cd2013-07-10 15:51:12 +0000529 help='ssh username for the image file'),
530 cfg.IntOpt(
531 'large_ops_number',
532 default=0,
533 help="specifies how many resources to request at once. Used "
534 "for large operations testing.")
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900535]
536
537
Matthew Treinish4c412922013-07-16 15:27:42 -0400538service_available_group = cfg.OptGroup(name="service_available",
539 title="Available OpenStack Services")
540
541ServiceAvailableGroup = [
542 cfg.BoolOpt('cinder',
543 default=True,
544 help="Whether or not cinder is expected to be available"),
Matthew Treinishfaa340d2013-07-19 16:26:21 -0400545 cfg.BoolOpt('neutron',
546 default=False,
547 help="Whether or not neutron is expected to be available"),
Matthew Treinish853ae442013-07-19 16:36:07 -0400548 cfg.BoolOpt('glance',
549 default=True,
550 help="Whether or not glance is expected to be available"),
Matthew Treinish61e332b2013-07-19 16:42:31 -0400551 cfg.BoolOpt('swift',
552 default=True,
553 help="Whether or not swift is expected to be available"),
Matthew Treinish6b41e242013-07-19 16:49:28 -0400554 cfg.BoolOpt('nova',
555 default=True,
556 help="Whether or not nova is expected to be available"),
Matthew Treinisha9d43882013-07-19 16:54:52 -0400557 cfg.BoolOpt('heat',
558 default=False,
559 help="Whether or not Heat is expected to be available"),
Julie Pichond1017642013-07-24 16:37:23 +0100560 cfg.BoolOpt('horizon',
561 default=True,
562 help="Whether or not Horizon is expected to be available"),
Matthew Treinish4c412922013-07-16 15:27:42 -0400563]
564
Attila Fazekasaeeeefd2013-08-06 17:01:56 +0200565debug_group = cfg.OptGroup(name="debug",
566 title="Debug System")
567
568DebugGroup = [
569 cfg.BoolOpt('enable',
570 default=True,
571 help="Enable diagnostic commands"),
572]
573
574
Jay Pipes3f981df2012-03-27 18:59:44 -0400575@singleton
576class TempestConfig:
Daryl Walleck1465d612011-11-02 02:22:15 -0500577 """Provides OpenStack configuration information."""
578
Brian Waldon738cd632011-12-12 18:45:09 -0500579 DEFAULT_CONFIG_DIR = os.path.join(
Zhongyue Luoa1343de2013-01-04 16:21:35 +0800580 os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
Brian Waldon738cd632011-12-12 18:45:09 -0500581 "etc")
Daryl Walleck1465d612011-11-02 02:22:15 -0500582
Brian Waldon738cd632011-12-12 18:45:09 -0500583 DEFAULT_CONFIG_FILE = "tempest.conf"
584
585 def __init__(self):
586 """Initialize a configuration from a conf directory and conf file."""
Sean Dague2416cf32013-04-10 08:29:07 -0400587 config_files = []
Sean Dague2416cf32013-04-10 08:29:07 -0400588 failsafe_path = "/etc/tempest/" + self.DEFAULT_CONFIG_FILE
Brian Waldon738cd632011-12-12 18:45:09 -0500589
590 # Environment variables override defaults...
591 conf_dir = os.environ.get('TEMPEST_CONFIG_DIR',
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800592 self.DEFAULT_CONFIG_DIR)
593 conf_file = os.environ.get('TEMPEST_CONFIG', self.DEFAULT_CONFIG_FILE)
Brian Waldon738cd632011-12-12 18:45:09 -0500594
Jay Pipes7f757632011-12-02 15:53:32 -0500595 path = os.path.join(conf_dir, conf_file)
596
Zhongyue Luoafd43eb2013-02-04 11:32:57 +0800597 if not (os.path.isfile(path) or
598 'TEMPEST_CONFIG_DIR' in os.environ or
599 'TEMPEST_CONFIG' in os.environ):
Sean Dague2416cf32013-04-10 08:29:07 -0400600 path = failsafe_path
Attila Fazekas5abb2532012-12-04 11:30:49 +0100601
Jay Pipes7f757632011-12-02 15:53:32 -0500602 if not os.path.exists(path):
Sean Dague43cd9052013-07-19 12:20:04 -0400603 msg = "Config file %s not found" % path
Dirk Muellere746fc22013-06-29 16:29:29 +0200604 print(RuntimeError(msg), file=sys.stderr)
Sean Dague2416cf32013-04-10 08:29:07 -0400605 else:
606 config_files.append(path)
Jay Pipes7f757632011-12-02 15:53:32 -0500607
Sean Dague2416cf32013-04-10 08:29:07 -0400608 cfg.CONF([], project='tempest', default_config_files=config_files)
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -0400609 logging.setup('tempest')
610 LOG = logging.getLogger('tempest')
611 LOG.info("Using tempest config file %s" % path)
Daryl Walleck1465d612011-11-02 02:22:15 -0500612
DennyZhang88a2dd82013-10-07 12:55:35 -0500613 register_opt_group(cfg.CONF, compute_group, ComputeGroup)
614 register_opt_group(cfg.CONF, identity_group, IdentityGroup)
615 register_opt_group(cfg.CONF, image_group, ImageGroup)
616 register_opt_group(cfg.CONF, network_group, NetworkGroup)
617 register_opt_group(cfg.CONF, volume_group, VolumeGroup)
618 register_opt_group(cfg.CONF, object_storage_group, ObjectStoreGroup)
619 register_opt_group(cfg.CONF, orchestration_group, OrchestrationGroup)
620 register_opt_group(cfg.CONF, dashboard_group, DashboardGroup)
621 register_opt_group(cfg.CONF, boto_group, BotoGroup)
622 register_opt_group(cfg.CONF, compute_admin_group, ComputeAdminGroup)
623 register_opt_group(cfg.CONF, stress_group, StressGroup)
624 register_opt_group(cfg.CONF, scenario_group, ScenarioGroup)
625 register_opt_group(cfg.CONF, service_available_group,
626 ServiceAvailableGroup)
627 register_opt_group(cfg.CONF, debug_group, DebugGroup)
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500628 self.compute = cfg.CONF.compute
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500629 self.identity = cfg.CONF.identity
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500630 self.images = cfg.CONF.image
631 self.network = cfg.CONF.network
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500632 self.volume = cfg.CONF.volume
633 self.object_storage = cfg.CONF['object-storage']
Steve Bakerc60e4e32013-05-06 15:22:41 +1200634 self.orchestration = cfg.CONF.orchestration
Julie Pichond1017642013-07-24 16:37:23 +0100635 self.dashboard = cfg.CONF.dashboard
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500636 self.boto = cfg.CONF.boto
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100637 self.compute_admin = cfg.CONF['compute-admin']
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500638 self.stress = cfg.CONF.stress
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900639 self.scenario = cfg.CONF.scenario
Matthew Treinish4c412922013-07-16 15:27:42 -0400640 self.service_available = cfg.CONF.service_available
Attila Fazekas5fae7a32013-09-25 16:52:44 +0200641 self.debug = cfg.CONF.debug
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100642 if not self.compute_admin.username:
643 self.compute_admin.username = self.identity.admin_username
644 self.compute_admin.password = self.identity.admin_password
645 self.compute_admin.tenant_name = self.identity.admin_tenant_name