blob: 76461fbe4b1e216f93f5879d466c3d96670ba465 [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 "
199 "an instance")
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500200]
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800201
Matthew Treinishd5c96022013-10-17 21:51:23 +0000202compute_features_group = cfg.OptGroup(name='compute-feature-enabled',
203 title="Enabled Compute Service Features")
204
205ComputeFeaturesGroup = [
ivan-zhu8f992be2013-07-31 14:56:58 +0800206 cfg.BoolOpt('api_v3',
Ken'ichi Ohmichi943e82d2013-11-12 15:02:57 +0900207 default=False,
ivan-zhu8f992be2013-07-31 14:56:58 +0800208 help="If false, skip all nova v3 tests."),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000209 cfg.BoolOpt('disk_config',
210 default=True,
211 help="If false, skip disk config tests"),
212 cfg.BoolOpt('flavor_extra',
213 default=True,
214 help="If false, skip flavor extra data test"),
215 cfg.BoolOpt('change_password',
216 default=False,
217 help="Does the test environment support changing the admin "
218 "password?"),
219 cfg.BoolOpt('create_image',
220 default=False,
221 help="Does the test environment support snapshots?"),
222 cfg.BoolOpt('resize',
223 default=False,
224 help="Does the test environment support resizing?"),
225 cfg.BoolOpt('live_migration',
226 default=False,
227 help="Does the test environment support live migration "
228 "available?"),
229 cfg.BoolOpt('block_migration_for_live_migration',
230 default=False,
231 help="Does the test environment use block devices for live "
232 "migration"),
233 cfg.BoolOpt('block_migrate_cinder_iscsi',
234 default=False,
235 help="Does the test environment block migration support "
236 "cinder iSCSI volumes")
237]
238
239
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500240compute_admin_group = cfg.OptGroup(name='compute-admin',
241 title="Compute Admin Options")
donald-ngo7fb1efa2011-12-13 17:17:36 -0800242
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500243ComputeAdminGroup = [
244 cfg.StrOpt('username',
245 default='admin',
246 help="Administrative Username to use for Nova API requests."),
247 cfg.StrOpt('tenant_name',
248 default='admin',
249 help="Administrative Tenant name to use for Nova API "
250 "requests."),
251 cfg.StrOpt('password',
252 default='pass',
253 help="API key to use when authenticating as admin.",
254 secret=True),
255]
Daryl Walleck587385b2012-03-03 13:00:26 -0600256
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500257image_group = cfg.OptGroup(name='image',
258 title="Image Service Options")
Jay Pipesf38eaac2012-06-21 13:37:35 -0400259
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500260ImageGroup = [
Matthew Treinish72ea4422013-02-07 14:42:49 -0500261 cfg.StrOpt('catalog_type',
262 default='image',
Sean Dague83401992013-05-06 17:46:36 -0400263 help='Catalog type of the Image service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900264 cfg.StrOpt('region',
265 default='',
266 help="The image region name to use. If empty, the value "
267 "of identity.region is used instead. If no such region "
268 "is found in the service catalog, the first found one is "
269 "used."),
Sean Dague83401992013-05-06 17:46:36 -0400270 cfg.StrOpt('http_image',
271 default='http://download.cirros-cloud.net/0.3.1/'
272 'cirros-0.3.1-x86_64-uec.tar.gz',
DennyZhang8912d012013-09-25 18:08:34 -0500273 help='http accessible image')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500274]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400275
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000276image_feature_group = cfg.OptGroup(name='image-feature-enabled',
277 title='Enabled image service features')
278
279ImageFeaturesGroup = [
280 cfg.BoolOpt('api_v2',
281 default=True,
282 help="Is the v2 image API enabled"),
283 cfg.BoolOpt('api_v1',
284 default=True,
285 help="Is the v1 image API enabled"),
286]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400287
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500288network_group = cfg.OptGroup(name='network',
289 title='Network Service Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600290
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500291NetworkGroup = [
292 cfg.StrOpt('catalog_type',
293 default='network',
Mark McClainf2982e82013-07-06 17:48:03 -0400294 help='Catalog type of the Neutron service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900295 cfg.StrOpt('region',
296 default='',
297 help="The network region name to use. If empty, the value "
298 "of identity.region is used instead. If no such region "
299 "is found in the service catalog, the first found one is "
300 "used."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500301 cfg.StrOpt('tenant_network_cidr',
302 default="10.100.0.0/16",
303 help="The cidr block to allocate tenant networks from"),
304 cfg.IntOpt('tenant_network_mask_bits',
Attila Fazekas8ea181b2013-07-13 16:26:14 +0200305 default=28,
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500306 help="The mask bits for tenant networks"),
307 cfg.BoolOpt('tenant_networks_reachable',
308 default=False,
309 help="Whether tenant network connectivity should be "
310 "evaluated directly"),
311 cfg.StrOpt('public_network_id',
312 default="",
313 help="Id of the public network that provides external "
314 "connectivity"),
315 cfg.StrOpt('public_router_id',
316 default="",
317 help="Id of the public router that provides external "
318 "connectivity"),
319]
Jay Pipes3f981df2012-03-27 18:59:44 -0400320
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500321volume_group = cfg.OptGroup(name='volume',
322 title='Block Storage Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600323
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500324VolumeGroup = [
325 cfg.IntOpt('build_interval',
326 default=10,
327 help='Time in seconds between volume availability checks.'),
328 cfg.IntOpt('build_timeout',
329 default=300,
330 help='Timeout in seconds to wait for a volume to become'
331 'available.'),
332 cfg.StrOpt('catalog_type',
Matthew Treinisheb724512013-10-25 15:12:59 +0000333 default='volume',
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500334 help="Catalog type of the Volume Service"),
Arata Notsu8f440392013-09-13 16:14:20 +0900335 cfg.StrOpt('region',
336 default='',
337 help="The volume region name to use. If empty, the value "
338 "of identity.region is used instead. If no such region "
339 "is found in the service catalog, the first found one is "
340 "used."),
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100341 cfg.StrOpt('backend1_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200342 default='BACKEND_1',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100343 help="Name of the backend1 (must be declared in cinder.conf)"),
344 cfg.StrOpt('backend2_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200345 default='BACKEND_2',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100346 help="Name of the backend2 (must be declared in cinder.conf)"),
Adam Gandelman827ad332013-06-24 17:04:09 -0700347 cfg.StrOpt('storage_protocol',
348 default='iSCSI',
349 help='Backend protocol to target when creating volume types'),
350 cfg.StrOpt('vendor_name',
351 default='Open Source',
352 help='Backend vendor to target when creating volume types'),
Ryan Hsua67f4632013-08-29 16:03:06 -0700353 cfg.StrOpt('disk_format',
354 default='raw',
355 help='Disk format to use when copying a volume to image'),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500356]
K Jonathan Harkerd6ba4b42012-12-18 13:50:47 -0800357
Matthew Treinishd5c96022013-10-17 21:51:23 +0000358volume_feature_group = cfg.OptGroup(name='volume-feature-enabled',
359 title='Enabled Cinder Features')
360
361VolumeFeaturesGroup = [
362 cfg.BoolOpt('multi_backend',
363 default=False,
364 help="Runs Cinder multi-backend test (requires 2 backends)")
365]
366
Daryl Walleck587385b2012-03-03 13:00:26 -0600367
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500368object_storage_group = cfg.OptGroup(name='object-storage',
369 title='Object Storage Service Options')
Attila Fazekasa23f5002012-10-23 19:32:45 +0200370
DennyZhang1e71b612013-09-26 12:35:40 -0500371ObjectStoreGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500372 cfg.StrOpt('catalog_type',
373 default='object-store',
374 help="Catalog type of the Object-Storage service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900375 cfg.StrOpt('region',
376 default='',
377 help="The object-storage region name to use. If empty, the "
378 "value of identity.region is used instead. If no such "
379 "region is found in the service catalog, the first found "
380 "one is used."),
Matthew Treinishf319a732013-10-24 21:39:24 +0000381 cfg.IntOpt('container_sync_timeout',
nayna-patelb4989b32013-01-09 06:25:13 +0000382 default=120,
383 help="Number of seconds to time on waiting for a container"
384 "to container synchronization complete."),
Matthew Treinishf319a732013-10-24 21:39:24 +0000385 cfg.IntOpt('container_sync_interval',
nayna-patelb4989b32013-01-09 06:25:13 +0000386 default=5,
387 help="Number of seconds to wait while looping to check the"
388 "status of a container to container synchronization"),
Matthew Treinish3fdb80c2013-08-15 11:13:19 -0400389 cfg.StrOpt('operator_role',
390 default='Member',
391 help="Role to add to users created for swift tests to "
392 "enable creating containers"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500393]
Attila Fazekasa23f5002012-10-23 19:32:45 +0200394
Matthew Treinishd5c96022013-10-17 21:51:23 +0000395object_storage_feature_group = cfg.OptGroup(
396 name='object-storage-feature-enabled',
397 title='Enabled object-storage features')
398
399ObjectStoreFeaturesGroup = [
400 cfg.BoolOpt('container_quotas',
401 default=True,
402 help="Set to True if the container quota middleware "
403 "is enabled"),
404 cfg.BoolOpt('accounts_quotas',
405 default=True,
406 help="Set to True if the Account Quota middleware is enabled"),
407]
408
Attila Fazekasa23f5002012-10-23 19:32:45 +0200409
Steve Bakerc60e4e32013-05-06 15:22:41 +1200410orchestration_group = cfg.OptGroup(name='orchestration',
411 title='Orchestration Service Options')
412
413OrchestrationGroup = [
414 cfg.StrOpt('catalog_type',
415 default='orchestration',
416 help="Catalog type of the Orchestration service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900417 cfg.StrOpt('region',
418 default='',
419 help="The orchestration region name to use. If empty, the "
420 "value of identity.region is used instead. If no such "
421 "region is found in the service catalog, the first found "
422 "one is used."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200423 cfg.BoolOpt('allow_tenant_isolation',
424 default=False,
425 help="Allows test cases to create/destroy tenants and "
426 "users. This option enables isolated test cases and "
427 "better parallel execution, but also requires that "
428 "OpenStack Identity API admin credentials are known."),
429 cfg.IntOpt('build_interval',
430 default=1,
431 help="Time in seconds between build status checks."),
432 cfg.IntOpt('build_timeout',
433 default=300,
434 help="Timeout in seconds to wait for a stack to build."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200435 cfg.StrOpt('instance_type',
Steve Baker9e86b832013-05-22 15:40:28 +1200436 default='m1.micro',
Steve Bakerc60e4e32013-05-06 15:22:41 +1200437 help="Instance type for tests. Needs to be big enough for a "
438 "full OS plus the test workload"),
439 cfg.StrOpt('image_ref',
440 default=None,
441 help="Name of heat-cfntools enabled image to use when "
442 "launching test instances."),
443 cfg.StrOpt('keypair_name',
444 default=None,
445 help="Name of existing keypair to launch servers with."),
Clint Byrum71f27632013-09-09 11:41:32 -0700446 cfg.IntOpt('max_template_size',
Joe Gordon0e51b222013-10-24 14:11:10 +0100447 default=524288,
Clint Byrum71f27632013-09-09 11:41:32 -0700448 help="Value must match heat configuration of the same name."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200449]
450
451
Julie Pichond1017642013-07-24 16:37:23 +0100452dashboard_group = cfg.OptGroup(name="dashboard",
453 title="Dashboard options")
454
455DashboardGroup = [
456 cfg.StrOpt('dashboard_url',
457 default='http://localhost/',
458 help="Where the dashboard can be found"),
459 cfg.StrOpt('login_url',
460 default='http://localhost/auth/login/',
461 help="Login page for the dashboard"),
462]
463
464
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500465boto_group = cfg.OptGroup(name='boto',
466 title='EC2/S3 options')
DennyZhang1e71b612013-09-26 12:35:40 -0500467BotoGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500468 cfg.StrOpt('ec2_url',
469 default="http://localhost:8773/services/Cloud",
470 help="EC2 URL"),
471 cfg.StrOpt('s3_url',
472 default="http://localhost:8080",
473 help="S3 URL"),
474 cfg.StrOpt('aws_secret',
475 default=None,
476 help="AWS Secret Key",
477 secret=True),
478 cfg.StrOpt('aws_access',
479 default=None,
480 help="AWS Access Key"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500481 cfg.StrOpt('s3_materials_path',
482 default="/opt/stack/devstack/files/images/"
483 "s3-materials/cirros-0.3.0",
484 help="S3 Materials Path"),
485 cfg.StrOpt('ari_manifest',
486 default="cirros-0.3.0-x86_64-initrd.manifest.xml",
487 help="ARI Ramdisk Image manifest"),
488 cfg.StrOpt('ami_manifest',
489 default="cirros-0.3.0-x86_64-blank.img.manifest.xml",
490 help="AMI Machine Image manifest"),
491 cfg.StrOpt('aki_manifest',
492 default="cirros-0.3.0-x86_64-vmlinuz.manifest.xml",
493 help="AKI Kernel Image manifest"),
494 cfg.StrOpt('instance_type',
495 default="m1.tiny",
496 help="Instance type"),
497 cfg.IntOpt('http_socket_timeout',
498 default=3,
499 help="boto Http socket timeout"),
500 cfg.IntOpt('num_retries',
501 default=1,
502 help="boto num_retries on error"),
503 cfg.IntOpt('build_timeout',
504 default=60,
505 help="Status Change Timeout"),
506 cfg.IntOpt('build_interval',
507 default=1,
508 help="Status Change Test Interval"),
509]
Attila Fazekasf7f2d932012-12-13 09:14:38 +0100510
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500511stress_group = cfg.OptGroup(name='stress', title='Stress Test Options')
512
513StressGroup = [
514 cfg.StrOpt('nova_logdir',
515 default=None,
516 help='Directory containing log files on the compute nodes'),
517 cfg.IntOpt('max_instances',
518 default=16,
519 help='Maximum number of instances to create during test.'),
520 cfg.StrOpt('controller',
521 default=None,
David Kranzb9d97502013-05-01 15:55:04 -0400522 help='Controller host.'),
523 # new stress options
524 cfg.StrOpt('target_controller',
525 default=None,
526 help='Controller host.'),
527 cfg.StrOpt('target_ssh_user',
528 default=None,
529 help='ssh user.'),
530 cfg.StrOpt('target_private_key_path',
531 default=None,
532 help='Path to private key.'),
533 cfg.StrOpt('target_logfiles',
534 default=None,
535 help='regexp for list of log files.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000536 cfg.IntOpt('log_check_interval',
David Kranzb9d97502013-05-01 15:55:04 -0400537 default=60,
Marc Koderer32221b8e2013-08-23 13:57:50 +0200538 help='time (in seconds) between log file error checks.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000539 cfg.IntOpt('default_thread_number_per_action',
Marc Koderer32221b8e2013-08-23 13:57:50 +0200540 default=4,
541 help='The number of threads created while stress test.')
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500542]
543
544
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900545scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options')
546
547ScenarioGroup = [
548 cfg.StrOpt('img_dir',
549 default='/opt/stack/new/devstack/files/images/'
550 'cirros-0.3.1-x86_64-uec',
551 help='Directory containing image files'),
552 cfg.StrOpt('ami_img_file',
553 default='cirros-0.3.1-x86_64-blank.img',
554 help='AMI image file name'),
555 cfg.StrOpt('ari_img_file',
556 default='cirros-0.3.1-x86_64-initrd',
557 help='ARI image file name'),
558 cfg.StrOpt('aki_img_file',
559 default='cirros-0.3.1-x86_64-vmlinuz',
560 help='AKI image file name'),
561 cfg.StrOpt('ssh_user',
562 default='cirros',
Joe Gordonb5e10cd2013-07-10 15:51:12 +0000563 help='ssh username for the image file'),
564 cfg.IntOpt(
565 'large_ops_number',
566 default=0,
567 help="specifies how many resources to request at once. Used "
568 "for large operations testing.")
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900569]
570
571
Matthew Treinish4c412922013-07-16 15:27:42 -0400572service_available_group = cfg.OptGroup(name="service_available",
573 title="Available OpenStack Services")
574
575ServiceAvailableGroup = [
576 cfg.BoolOpt('cinder',
577 default=True,
578 help="Whether or not cinder is expected to be available"),
Matthew Treinishfaa340d2013-07-19 16:26:21 -0400579 cfg.BoolOpt('neutron',
580 default=False,
581 help="Whether or not neutron is expected to be available"),
Matthew Treinish853ae442013-07-19 16:36:07 -0400582 cfg.BoolOpt('glance',
583 default=True,
584 help="Whether or not glance is expected to be available"),
Matthew Treinish61e332b2013-07-19 16:42:31 -0400585 cfg.BoolOpt('swift',
586 default=True,
587 help="Whether or not swift is expected to be available"),
Matthew Treinish6b41e242013-07-19 16:49:28 -0400588 cfg.BoolOpt('nova',
589 default=True,
590 help="Whether or not nova is expected to be available"),
Matthew Treinisha9d43882013-07-19 16:54:52 -0400591 cfg.BoolOpt('heat',
592 default=False,
593 help="Whether or not Heat is expected to be available"),
Mehdi Abaakouk8581c0b2013-10-04 10:45:42 +0200594 cfg.BoolOpt('ceilometer',
595 default=True,
596 help="Whether or not Ceilometer is expected to be available"),
Julie Pichond1017642013-07-24 16:37:23 +0100597 cfg.BoolOpt('horizon',
598 default=True,
599 help="Whether or not Horizon is expected to be available"),
Matthew Treinish4c412922013-07-16 15:27:42 -0400600]
601
Attila Fazekasaeeeefd2013-08-06 17:01:56 +0200602debug_group = cfg.OptGroup(name="debug",
603 title="Debug System")
604
605DebugGroup = [
606 cfg.BoolOpt('enable',
607 default=True,
608 help="Enable diagnostic commands"),
609]
610
611
Jay Pipes3f981df2012-03-27 18:59:44 -0400612@singleton
613class TempestConfig:
Daryl Walleck1465d612011-11-02 02:22:15 -0500614 """Provides OpenStack configuration information."""
615
Brian Waldon738cd632011-12-12 18:45:09 -0500616 DEFAULT_CONFIG_DIR = os.path.join(
Zhongyue Luoa1343de2013-01-04 16:21:35 +0800617 os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
Brian Waldon738cd632011-12-12 18:45:09 -0500618 "etc")
Daryl Walleck1465d612011-11-02 02:22:15 -0500619
Brian Waldon738cd632011-12-12 18:45:09 -0500620 DEFAULT_CONFIG_FILE = "tempest.conf"
621
622 def __init__(self):
623 """Initialize a configuration from a conf directory and conf file."""
Sean Dague2416cf32013-04-10 08:29:07 -0400624 config_files = []
Sean Dague2416cf32013-04-10 08:29:07 -0400625 failsafe_path = "/etc/tempest/" + self.DEFAULT_CONFIG_FILE
Brian Waldon738cd632011-12-12 18:45:09 -0500626
627 # Environment variables override defaults...
628 conf_dir = os.environ.get('TEMPEST_CONFIG_DIR',
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800629 self.DEFAULT_CONFIG_DIR)
630 conf_file = os.environ.get('TEMPEST_CONFIG', self.DEFAULT_CONFIG_FILE)
Brian Waldon738cd632011-12-12 18:45:09 -0500631
Jay Pipes7f757632011-12-02 15:53:32 -0500632 path = os.path.join(conf_dir, conf_file)
633
Zhongyue Luoafd43eb2013-02-04 11:32:57 +0800634 if not (os.path.isfile(path) or
635 'TEMPEST_CONFIG_DIR' in os.environ or
636 'TEMPEST_CONFIG' in os.environ):
Sean Dague2416cf32013-04-10 08:29:07 -0400637 path = failsafe_path
Attila Fazekas5abb2532012-12-04 11:30:49 +0100638
Jay Pipes7f757632011-12-02 15:53:32 -0500639 if not os.path.exists(path):
Sean Dague43cd9052013-07-19 12:20:04 -0400640 msg = "Config file %s not found" % path
Dirk Muellere746fc22013-06-29 16:29:29 +0200641 print(RuntimeError(msg), file=sys.stderr)
Sean Dague2416cf32013-04-10 08:29:07 -0400642 else:
643 config_files.append(path)
Jay Pipes7f757632011-12-02 15:53:32 -0500644
Sean Dague2416cf32013-04-10 08:29:07 -0400645 cfg.CONF([], project='tempest', default_config_files=config_files)
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -0400646 logging.setup('tempest')
647 LOG = logging.getLogger('tempest')
648 LOG.info("Using tempest config file %s" % path)
Daryl Walleck1465d612011-11-02 02:22:15 -0500649
DennyZhang88a2dd82013-10-07 12:55:35 -0500650 register_opt_group(cfg.CONF, compute_group, ComputeGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000651 register_opt_group(cfg.CONF, compute_features_group,
652 ComputeFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500653 register_opt_group(cfg.CONF, identity_group, IdentityGroup)
654 register_opt_group(cfg.CONF, image_group, ImageGroup)
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000655 register_opt_group(cfg.CONF, image_feature_group, ImageFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500656 register_opt_group(cfg.CONF, network_group, NetworkGroup)
657 register_opt_group(cfg.CONF, volume_group, VolumeGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000658 register_opt_group(cfg.CONF, volume_feature_group,
659 VolumeFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500660 register_opt_group(cfg.CONF, object_storage_group, ObjectStoreGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000661 register_opt_group(cfg.CONF, object_storage_feature_group,
662 ObjectStoreFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500663 register_opt_group(cfg.CONF, orchestration_group, OrchestrationGroup)
664 register_opt_group(cfg.CONF, dashboard_group, DashboardGroup)
665 register_opt_group(cfg.CONF, boto_group, BotoGroup)
666 register_opt_group(cfg.CONF, compute_admin_group, ComputeAdminGroup)
667 register_opt_group(cfg.CONF, stress_group, StressGroup)
668 register_opt_group(cfg.CONF, scenario_group, ScenarioGroup)
669 register_opt_group(cfg.CONF, service_available_group,
670 ServiceAvailableGroup)
671 register_opt_group(cfg.CONF, debug_group, DebugGroup)
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500672 self.compute = cfg.CONF.compute
Matthew Treinishd5c96022013-10-17 21:51:23 +0000673 self.compute_feature_enabled = cfg.CONF['compute-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500674 self.identity = cfg.CONF.identity
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500675 self.images = cfg.CONF.image
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000676 self.image_feature_enabled = cfg.CONF['image-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500677 self.network = cfg.CONF.network
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500678 self.volume = cfg.CONF.volume
Matthew Treinishd5c96022013-10-17 21:51:23 +0000679 self.volume_feature_enabled = cfg.CONF['volume-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500680 self.object_storage = cfg.CONF['object-storage']
Matthew Treinishd5c96022013-10-17 21:51:23 +0000681 self.object_storage_feature_enabled = cfg.CONF[
682 'object-storage-feature-enabled']
Steve Bakerc60e4e32013-05-06 15:22:41 +1200683 self.orchestration = cfg.CONF.orchestration
Julie Pichond1017642013-07-24 16:37:23 +0100684 self.dashboard = cfg.CONF.dashboard
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500685 self.boto = cfg.CONF.boto
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100686 self.compute_admin = cfg.CONF['compute-admin']
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500687 self.stress = cfg.CONF.stress
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900688 self.scenario = cfg.CONF.scenario
Matthew Treinish4c412922013-07-16 15:27:42 -0400689 self.service_available = cfg.CONF.service_available
Attila Fazekas5fae7a32013-09-25 16:52:44 +0200690 self.debug = cfg.CONF.debug
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100691 if not self.compute_admin.username:
692 self.compute_admin.username = self.identity.admin_username
693 self.compute_admin.password = self.identity.admin_password
694 self.compute_admin.tenant_name = self.identity.admin_tenant_name