blob: 0342380a8126f967799dfb8e98a05c62d2a3a144 [file] [log] [blame]
Jay Pipes3f981df2012-03-27 18:59:44 -04001# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
ZhiQiang Fan39f97222013-09-20 04:49:44 +08003# Copyright 2012 OpenStack Foundation
Jay Pipes3f981df2012-03-27 18:59:44 -04004# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
Dirk Muellere746fc22013-06-29 16:29:29 +020018from __future__ import print_function
19
Jay Pipes7f757632011-12-02 15:53:32 -050020import os
Jay Pipes3f981df2012-03-27 18:59:44 -040021
Matthew Treinish90aedd12013-02-25 17:56:49 -050022from oslo.config import cfg
23
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -040024from tempest.openstack.common import log as logging
Jay Pipes7f757632011-12-02 15:53:32 -050025
Daryl Walleck1465d612011-11-02 02:22:15 -050026
DennyZhang88a2dd82013-10-07 12:55:35 -050027def register_opt_group(conf, opt_group, options):
28 conf.register_group(opt_group)
29 for opt in options:
30 conf.register_opt(opt, group=opt_group.name)
31
32
Matthew Treinish39e48ef2012-12-21 13:36:15 -050033identity_group = cfg.OptGroup(name='identity',
34 title="Keystone Configuration Options")
Daryl Walleck1465d612011-11-02 02:22:15 -050035
Matthew Treinish39e48ef2012-12-21 13:36:15 -050036IdentityGroup = [
37 cfg.StrOpt('catalog_type',
38 default='identity',
39 help="Catalog type of the Identity service."),
Jay Pipescd8eaec2013-01-16 21:03:48 -050040 cfg.BoolOpt('disable_ssl_certificate_validation',
41 default=False,
42 help="Set to True if using self-signed SSL certificates."),
Jay Pipes7c88eb22013-01-16 21:32:43 -050043 cfg.StrOpt('uri',
44 default=None,
Brant Knudsonc7ca3342013-03-28 21:08:50 -050045 help="Full URI of the OpenStack Identity API (Keystone), v2"),
46 cfg.StrOpt('uri_v3',
47 help='Full URI of the OpenStack Identity API (Keystone), v3'),
Matthew Treinish39e48ef2012-12-21 13:36:15 -050048 cfg.StrOpt('region',
Attila Fazekascadcb1f2013-01-21 23:10:53 +010049 default='RegionOne',
Arata Notsu8f440392013-09-13 16:14:20 +090050 help="The identity region name to use. Also used as the other "
51 "services' region name unless they are set explicitly. "
52 "If no such region is found in the service catalog, the "
53 "first found one is used."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +010054 cfg.StrOpt('username',
55 default='demo',
56 help="Username to use for Nova API requests."),
57 cfg.StrOpt('tenant_name',
58 default='demo',
59 help="Tenant name to use for Nova API requests."),
Russell Sim7f894a52013-09-13 10:35:21 +100060 cfg.StrOpt('admin_role',
61 default='admin',
62 help="Role required to administrate keystone."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +010063 cfg.StrOpt('password',
64 default='pass',
65 help="API key to use when authenticating.",
66 secret=True),
67 cfg.StrOpt('alt_username',
68 default=None,
69 help="Username of alternate user to use for Nova API "
70 "requests."),
71 cfg.StrOpt('alt_tenant_name',
72 default=None,
73 help="Alternate user's Tenant name to use for Nova API "
74 "requests."),
75 cfg.StrOpt('alt_password',
76 default=None,
77 help="API key to use when authenticating as alternate user.",
78 secret=True),
79 cfg.StrOpt('admin_username',
80 default='admin',
81 help="Administrative Username to use for"
82 "Keystone API requests."),
83 cfg.StrOpt('admin_tenant_name',
84 default='admin',
85 help="Administrative Tenant name to use for Keystone API "
86 "requests."),
87 cfg.StrOpt('admin_password',
88 default='pass',
89 help="API key to use when authenticating as admin.",
90 secret=True),
Matthew Treinish39e48ef2012-12-21 13:36:15 -050091]
Jay Pipes3f981df2012-03-27 18:59:44 -040092
Matthew Treinish39e48ef2012-12-21 13:36:15 -050093compute_group = cfg.OptGroup(name='compute',
94 title='Compute Service Options')
Rohit Karajgie1b050d2011-12-02 16:13:18 -080095
Matthew Treinish39e48ef2012-12-21 13:36:15 -050096ComputeGroup = [
97 cfg.BoolOpt('allow_tenant_isolation',
98 default=False,
99 help="Allows test cases to create/destroy tenants and "
100 "users. This option enables isolated test cases and "
101 "better parallel execution, but also requires that "
102 "OpenStack Identity API admin credentials are known."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500103 cfg.StrOpt('image_ref',
104 default="{$IMAGE_ID}",
105 help="Valid secondary image reference to be used in tests."),
106 cfg.StrOpt('image_ref_alt',
107 default="{$IMAGE_ID_ALT}",
108 help="Valid secondary image reference to be used in tests."),
Ken'ichi Ohmichi35772602013-11-14 15:03:27 +0900109 cfg.StrOpt('flavor_ref',
110 default="1",
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500111 help="Valid primary flavor to use in tests."),
Ken'ichi Ohmichi35772602013-11-14 15:03:27 +0900112 cfg.StrOpt('flavor_ref_alt',
113 default="2",
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500114 help='Valid secondary flavor to be used in tests.'),
Maru Newbyaf292e82013-05-20 21:32:28 +0000115 cfg.StrOpt('image_ssh_user',
116 default="root",
117 help="User name used to authenticate to an instance."),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700118 cfg.StrOpt('image_ssh_password',
119 default="password",
120 help="Password used to authenticate to an instance."),
Maru Newbyaf292e82013-05-20 21:32:28 +0000121 cfg.StrOpt('image_alt_ssh_user',
122 default="root",
123 help="User name used to authenticate to an instance using "
124 "the alternate image."),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700125 cfg.StrOpt('image_alt_ssh_password',
126 default="password",
127 help="Password used to authenticate to an instance using "
128 "the alternate image."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500129 cfg.IntOpt('build_interval',
130 default=10,
131 help="Time in seconds between build status checks."),
132 cfg.IntOpt('build_timeout',
133 default=300,
134 help="Timeout in seconds to wait for an instance to build."),
135 cfg.BoolOpt('run_ssh',
136 default=False,
Derek Higgins85cd5142013-12-17 17:10:11 +0000137 help="Should the tests ssh to instances?"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500138 cfg.StrOpt('ssh_user',
139 default='root',
140 help="User name used to authenticate to an instance."),
Nachi Ueno6d580be2013-07-24 10:58:11 -0700141 cfg.IntOpt('ping_timeout',
142 default=60,
143 help="Timeout in seconds to wait for ping to "
144 "succeed."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500145 cfg.IntOpt('ssh_timeout',
146 default=300,
Chris Yeoh76916042013-02-27 16:25:25 +1030147 help="Timeout in seconds to wait for authentication to "
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500148 "succeed."),
Attila Fazekas0abbc952013-07-01 19:19:42 +0200149 cfg.IntOpt('ready_wait',
150 default=0,
DennyZhang8912d012013-09-25 18:08:34 -0500151 help="Additional wait time for clean state, when there is "
152 "no OS-EXT-STS extension available"),
Chris Yeoh76916042013-02-27 16:25:25 +1030153 cfg.IntOpt('ssh_channel_timeout',
154 default=60,
155 help="Timeout in seconds to wait for output from ssh "
156 "channel."),
Attila Fazekasb0661652013-05-08 13:01:36 +0200157 cfg.StrOpt('fixed_network_name',
158 default='private',
159 help="Visible fixed network name "),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500160 cfg.StrOpt('network_for_ssh',
161 default='public',
162 help="Network used for SSH connections."),
163 cfg.IntOpt('ip_version_for_ssh',
164 default=4,
165 help="IP version used for SSH connections."),
fujioka yuuichia11994e2013-07-09 11:19:51 +0900166 cfg.BoolOpt('use_floatingip_for_ssh',
167 default=True,
168 help="Dose the SSH uses Floating IP?"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500169 cfg.StrOpt('catalog_type',
170 default='compute',
171 help="Catalog type of the Compute service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900172 cfg.StrOpt('region',
173 default='',
174 help="The compute region name to use. If empty, the value "
175 "of identity.region is used instead. If no such region "
176 "is found in the service catalog, the first found one is "
177 "used."),
ivan-zhu8f992be2013-07-31 14:56:58 +0800178 cfg.StrOpt('catalog_v3_type',
179 default='computev3',
180 help="Catalog type of the Compute v3 service."),
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100181 cfg.StrOpt('path_to_private_key',
182 default=None,
183 help="Path to a private key file for SSH access to remote "
184 "hosts"),
Ryan Hsucb2e1252013-09-03 21:44:49 -0700185 cfg.StrOpt('volume_device_name',
186 default='vdb',
187 help="Expected device name when a volume is attached to "
Ken'ichi Ohmichi39437e22013-10-06 00:21:38 +0900188 "an instance"),
189 cfg.IntOpt('shelved_offload_time',
190 default=0,
191 help='Time in seconds before a shelved instance is eligible '
192 'for removing from a host. -1 never offload, 0 offload '
193 'when shelved. This time should be the same as the time '
194 'of nova.conf, and some tests will run for as long as the '
195 'time.')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500196]
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800197
Matthew Treinishd5c96022013-10-17 21:51:23 +0000198compute_features_group = cfg.OptGroup(name='compute-feature-enabled',
199 title="Enabled Compute Service Features")
200
201ComputeFeaturesGroup = [
ivan-zhu8f992be2013-07-31 14:56:58 +0800202 cfg.BoolOpt('api_v3',
Chris Yeohfbc15de2013-11-26 10:20:08 +1030203 default=True,
ivan-zhu8f992be2013-07-31 14:56:58 +0800204 help="If false, skip all nova v3 tests."),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000205 cfg.BoolOpt('disk_config',
206 default=True,
207 help="If false, skip disk config tests"),
Matthew Treinishe3d26142013-11-26 19:14:58 +0000208 cfg.ListOpt('api_extensions',
209 default=['all'],
210 help='A list of enabled extensions with a special entry all '
211 'which indicates every extension is enabled'),
212 cfg.ListOpt('api_v3_extensions',
213 default=['all'],
214 help='A list of enabled v3 extensions with a special entry all'
215 ' which indicates every extension is enabled'),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000216 cfg.BoolOpt('change_password',
217 default=False,
218 help="Does the test environment support changing the admin "
219 "password?"),
220 cfg.BoolOpt('create_image',
221 default=False,
222 help="Does the test environment support snapshots?"),
223 cfg.BoolOpt('resize',
224 default=False,
225 help="Does the test environment support resizing?"),
226 cfg.BoolOpt('live_migration',
227 default=False,
228 help="Does the test environment support live migration "
229 "available?"),
230 cfg.BoolOpt('block_migration_for_live_migration',
231 default=False,
232 help="Does the test environment use block devices for live "
233 "migration"),
234 cfg.BoolOpt('block_migrate_cinder_iscsi',
235 default=False,
236 help="Does the test environment block migration support "
237 "cinder iSCSI volumes")
238]
239
240
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500241compute_admin_group = cfg.OptGroup(name='compute-admin',
242 title="Compute Admin Options")
donald-ngo7fb1efa2011-12-13 17:17:36 -0800243
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500244ComputeAdminGroup = [
245 cfg.StrOpt('username',
246 default='admin',
247 help="Administrative Username to use for Nova API requests."),
248 cfg.StrOpt('tenant_name',
249 default='admin',
250 help="Administrative Tenant name to use for Nova API "
251 "requests."),
252 cfg.StrOpt('password',
253 default='pass',
254 help="API key to use when authenticating as admin.",
255 secret=True),
256]
Daryl Walleck587385b2012-03-03 13:00:26 -0600257
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500258image_group = cfg.OptGroup(name='image',
259 title="Image Service Options")
Jay Pipesf38eaac2012-06-21 13:37:35 -0400260
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500261ImageGroup = [
Matthew Treinish72ea4422013-02-07 14:42:49 -0500262 cfg.StrOpt('catalog_type',
263 default='image',
Sean Dague83401992013-05-06 17:46:36 -0400264 help='Catalog type of the Image service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900265 cfg.StrOpt('region',
266 default='',
267 help="The image region name to use. If empty, the value "
268 "of identity.region is used instead. If no such region "
269 "is found in the service catalog, the first found one is "
270 "used."),
Sean Dague83401992013-05-06 17:46:36 -0400271 cfg.StrOpt('http_image',
272 default='http://download.cirros-cloud.net/0.3.1/'
273 'cirros-0.3.1-x86_64-uec.tar.gz',
DennyZhang8912d012013-09-25 18:08:34 -0500274 help='http accessible image')
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500275]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400276
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000277image_feature_group = cfg.OptGroup(name='image-feature-enabled',
278 title='Enabled image service features')
279
280ImageFeaturesGroup = [
281 cfg.BoolOpt('api_v2',
282 default=True,
283 help="Is the v2 image API enabled"),
284 cfg.BoolOpt('api_v1',
285 default=True,
286 help="Is the v1 image API enabled"),
287]
Jay Pipesf38eaac2012-06-21 13:37:35 -0400288
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500289network_group = cfg.OptGroup(name='network',
290 title='Network Service Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600291
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500292NetworkGroup = [
293 cfg.StrOpt('catalog_type',
294 default='network',
Mark McClainf2982e82013-07-06 17:48:03 -0400295 help='Catalog type of the Neutron service.'),
Arata Notsu8f440392013-09-13 16:14:20 +0900296 cfg.StrOpt('region',
297 default='',
298 help="The network region name to use. If empty, the value "
299 "of identity.region is used instead. If no such region "
300 "is found in the service catalog, the first found one is "
301 "used."),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500302 cfg.StrOpt('tenant_network_cidr',
303 default="10.100.0.0/16",
304 help="The cidr block to allocate tenant networks from"),
305 cfg.IntOpt('tenant_network_mask_bits',
Attila Fazekas8ea181b2013-07-13 16:26:14 +0200306 default=28,
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500307 help="The mask bits for tenant networks"),
308 cfg.BoolOpt('tenant_networks_reachable',
309 default=False,
310 help="Whether tenant network connectivity should be "
311 "evaluated directly"),
312 cfg.StrOpt('public_network_id',
313 default="",
314 help="Id of the public network that provides external "
315 "connectivity"),
316 cfg.StrOpt('public_router_id',
317 default="",
318 help="Id of the public router that provides external "
319 "connectivity"),
320]
Jay Pipes3f981df2012-03-27 18:59:44 -0400321
Matthew Treinishe3d26142013-11-26 19:14:58 +0000322network_feature_group = cfg.OptGroup(name='network-feature-enabled',
323 title='Enabled network service features')
324
325NetworkFeaturesGroup = [
326 cfg.ListOpt('api_extensions',
327 default=['all'],
328 help='A list of enabled extensions with a special entry all '
329 'which indicates every extension is enabled'),
330]
331
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500332volume_group = cfg.OptGroup(name='volume',
333 title='Block Storage Options')
Daryl Walleck587385b2012-03-03 13:00:26 -0600334
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500335VolumeGroup = [
336 cfg.IntOpt('build_interval',
337 default=10,
338 help='Time in seconds between volume availability checks.'),
339 cfg.IntOpt('build_timeout',
340 default=300,
341 help='Timeout in seconds to wait for a volume to become'
342 'available.'),
343 cfg.StrOpt('catalog_type',
Matthew Treinisheb724512013-10-25 15:12:59 +0000344 default='volume',
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500345 help="Catalog type of the Volume Service"),
Arata Notsu8f440392013-09-13 16:14:20 +0900346 cfg.StrOpt('region',
347 default='',
348 help="The volume region name to use. If empty, the value "
349 "of identity.region is used instead. If no such region "
350 "is found in the service catalog, the first found one is "
351 "used."),
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100352 cfg.StrOpt('backend1_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200353 default='BACKEND_1',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100354 help="Name of the backend1 (must be declared in cinder.conf)"),
355 cfg.StrOpt('backend2_name',
Giulio Fidentef4fa8942013-05-28 18:48:03 +0200356 default='BACKEND_2',
Jérôme Gallard86551ce2013-03-08 11:41:26 +0100357 help="Name of the backend2 (must be declared in cinder.conf)"),
Adam Gandelman827ad332013-06-24 17:04:09 -0700358 cfg.StrOpt('storage_protocol',
359 default='iSCSI',
360 help='Backend protocol to target when creating volume types'),
361 cfg.StrOpt('vendor_name',
362 default='Open Source',
363 help='Backend vendor to target when creating volume types'),
Ryan Hsua67f4632013-08-29 16:03:06 -0700364 cfg.StrOpt('disk_format',
365 default='raw',
366 help='Disk format to use when copying a volume to image'),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500367]
K Jonathan Harkerd6ba4b42012-12-18 13:50:47 -0800368
Matthew Treinishd5c96022013-10-17 21:51:23 +0000369volume_feature_group = cfg.OptGroup(name='volume-feature-enabled',
370 title='Enabled Cinder Features')
371
372VolumeFeaturesGroup = [
373 cfg.BoolOpt('multi_backend',
374 default=False,
Matthew Treinishe3d26142013-11-26 19:14:58 +0000375 help="Runs Cinder multi-backend test (requires 2 backends)"),
376 cfg.ListOpt('api_extensions',
377 default=['all'],
378 help='A list of enabled extensions with a special entry all '
379 'which indicates every extension is enabled'),
Zhi Kun Liubb363a22013-11-28 18:47:39 +0800380 cfg.BoolOpt('api_v1',
381 default=True,
382 help="Is the v1 volume API 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,
Fabien Boucher2178d312013-12-31 15:38:57 +0100401 help="Number of seconds to time on waiting for a container "
nayna-patelb4989b32013-01-09 06:25:13 +0000402 "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,
Fabien Boucher2178d312013-12-31 15:38:57 +0100405 help="Number of seconds to wait while looping to check the "
nayna-patelb4989b32013-01-09 06:25:13 +0000406 "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 = [
Matthew Treinish20345382013-12-13 17:04:23 +0000418 cfg.ListOpt('discoverable_apis',
419 default=['all'],
420 help="A list of the enabled optional discoverable apis. "
421 "A single entry, all, indicates that all of these "
422 "features are expected to be enabled"),
Matthew Treinishd5c96022013-10-17 21:51:23 +0000423]
424
Attila Fazekasa23f5002012-10-23 19:32:45 +0200425
Steve Bakerc60e4e32013-05-06 15:22:41 +1200426orchestration_group = cfg.OptGroup(name='orchestration',
427 title='Orchestration Service Options')
428
429OrchestrationGroup = [
430 cfg.StrOpt('catalog_type',
431 default='orchestration',
432 help="Catalog type of the Orchestration service."),
Arata Notsu8f440392013-09-13 16:14:20 +0900433 cfg.StrOpt('region',
434 default='',
435 help="The orchestration region name to use. If empty, the "
436 "value of identity.region is used instead. If no such "
437 "region is found in the service catalog, the first found "
438 "one is used."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200439 cfg.BoolOpt('allow_tenant_isolation',
440 default=False,
441 help="Allows test cases to create/destroy tenants and "
442 "users. This option enables isolated test cases and "
443 "better parallel execution, but also requires that "
444 "OpenStack Identity API admin credentials are known."),
445 cfg.IntOpt('build_interval',
446 default=1,
447 help="Time in seconds between build status checks."),
448 cfg.IntOpt('build_timeout',
449 default=300,
450 help="Timeout in seconds to wait for a stack to build."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200451 cfg.StrOpt('instance_type',
Steve Baker9e86b832013-05-22 15:40:28 +1200452 default='m1.micro',
Steve Bakerc60e4e32013-05-06 15:22:41 +1200453 help="Instance type for tests. Needs to be big enough for a "
454 "full OS plus the test workload"),
455 cfg.StrOpt('image_ref',
456 default=None,
457 help="Name of heat-cfntools enabled image to use when "
458 "launching test instances."),
459 cfg.StrOpt('keypair_name',
460 default=None,
461 help="Name of existing keypair to launch servers with."),
Clint Byrum71f27632013-09-09 11:41:32 -0700462 cfg.IntOpt('max_template_size',
Joe Gordon0e51b222013-10-24 14:11:10 +0100463 default=524288,
Clint Byrum71f27632013-09-09 11:41:32 -0700464 help="Value must match heat configuration of the same name."),
Steve Bakerc60e4e32013-05-06 15:22:41 +1200465]
466
467
Yassine Lamgarchalb158d412013-12-27 19:29:42 +0100468telemetry_group = cfg.OptGroup(name='telemetry',
469 title='Telemetry Service Options')
470
471TelemetryGroup = [
472 cfg.StrOpt('catalog_type',
473 default='metering',
474 help="Catalog type of the Telemetry service."),
475]
476
477
Julie Pichond1017642013-07-24 16:37:23 +0100478dashboard_group = cfg.OptGroup(name="dashboard",
479 title="Dashboard options")
480
481DashboardGroup = [
482 cfg.StrOpt('dashboard_url',
483 default='http://localhost/',
484 help="Where the dashboard can be found"),
485 cfg.StrOpt('login_url',
486 default='http://localhost/auth/login/',
487 help="Login page for the dashboard"),
488]
489
490
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400491data_processing_group = cfg.OptGroup(name="data_processing",
492 title="Data Processing options")
493
494DataProcessingGroup = [
495 cfg.StrOpt('catalog_type',
496 default='data_processing',
497 help="Catalog type of the data processing service.")
498]
499
500
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500501boto_group = cfg.OptGroup(name='boto',
502 title='EC2/S3 options')
DennyZhang1e71b612013-09-26 12:35:40 -0500503BotoGroup = [
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500504 cfg.StrOpt('ec2_url',
505 default="http://localhost:8773/services/Cloud",
506 help="EC2 URL"),
507 cfg.StrOpt('s3_url',
508 default="http://localhost:8080",
509 help="S3 URL"),
510 cfg.StrOpt('aws_secret',
511 default=None,
512 help="AWS Secret Key",
513 secret=True),
514 cfg.StrOpt('aws_access',
515 default=None,
516 help="AWS Access Key"),
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500517 cfg.StrOpt('s3_materials_path',
518 default="/opt/stack/devstack/files/images/"
519 "s3-materials/cirros-0.3.0",
520 help="S3 Materials Path"),
521 cfg.StrOpt('ari_manifest',
522 default="cirros-0.3.0-x86_64-initrd.manifest.xml",
523 help="ARI Ramdisk Image manifest"),
524 cfg.StrOpt('ami_manifest',
525 default="cirros-0.3.0-x86_64-blank.img.manifest.xml",
526 help="AMI Machine Image manifest"),
527 cfg.StrOpt('aki_manifest',
528 default="cirros-0.3.0-x86_64-vmlinuz.manifest.xml",
529 help="AKI Kernel Image manifest"),
530 cfg.StrOpt('instance_type',
531 default="m1.tiny",
532 help="Instance type"),
533 cfg.IntOpt('http_socket_timeout',
534 default=3,
535 help="boto Http socket timeout"),
536 cfg.IntOpt('num_retries',
537 default=1,
538 help="boto num_retries on error"),
539 cfg.IntOpt('build_timeout',
540 default=60,
541 help="Status Change Timeout"),
542 cfg.IntOpt('build_interval',
543 default=1,
544 help="Status Change Test Interval"),
545]
Attila Fazekasf7f2d932012-12-13 09:14:38 +0100546
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500547stress_group = cfg.OptGroup(name='stress', title='Stress Test Options')
548
549StressGroup = [
550 cfg.StrOpt('nova_logdir',
551 default=None,
552 help='Directory containing log files on the compute nodes'),
553 cfg.IntOpt('max_instances',
554 default=16,
555 help='Maximum number of instances to create during test.'),
556 cfg.StrOpt('controller',
557 default=None,
David Kranzb9d97502013-05-01 15:55:04 -0400558 help='Controller host.'),
559 # new stress options
560 cfg.StrOpt('target_controller',
561 default=None,
562 help='Controller host.'),
563 cfg.StrOpt('target_ssh_user',
564 default=None,
565 help='ssh user.'),
566 cfg.StrOpt('target_private_key_path',
567 default=None,
568 help='Path to private key.'),
569 cfg.StrOpt('target_logfiles',
570 default=None,
571 help='regexp for list of log files.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000572 cfg.IntOpt('log_check_interval',
David Kranzb9d97502013-05-01 15:55:04 -0400573 default=60,
Marc Koderer32221b8e2013-08-23 13:57:50 +0200574 help='time (in seconds) between log file error checks.'),
Matthew Treinishf319a732013-10-24 21:39:24 +0000575 cfg.IntOpt('default_thread_number_per_action',
Marc Koderer32221b8e2013-08-23 13:57:50 +0200576 default=4,
577 help='The number of threads created while stress test.')
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500578]
579
580
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900581scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options')
582
583ScenarioGroup = [
584 cfg.StrOpt('img_dir',
585 default='/opt/stack/new/devstack/files/images/'
586 'cirros-0.3.1-x86_64-uec',
587 help='Directory containing image files'),
588 cfg.StrOpt('ami_img_file',
589 default='cirros-0.3.1-x86_64-blank.img',
590 help='AMI image file name'),
591 cfg.StrOpt('ari_img_file',
592 default='cirros-0.3.1-x86_64-initrd',
593 help='ARI image file name'),
594 cfg.StrOpt('aki_img_file',
595 default='cirros-0.3.1-x86_64-vmlinuz',
596 help='AKI image file name'),
597 cfg.StrOpt('ssh_user',
598 default='cirros',
Joe Gordonb5e10cd2013-07-10 15:51:12 +0000599 help='ssh username for the image file'),
600 cfg.IntOpt(
601 'large_ops_number',
602 default=0,
603 help="specifies how many resources to request at once. Used "
604 "for large operations testing.")
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900605]
606
607
Matthew Treinish4c412922013-07-16 15:27:42 -0400608service_available_group = cfg.OptGroup(name="service_available",
609 title="Available OpenStack Services")
610
611ServiceAvailableGroup = [
612 cfg.BoolOpt('cinder',
613 default=True,
614 help="Whether or not cinder is expected to be available"),
Matthew Treinishfaa340d2013-07-19 16:26:21 -0400615 cfg.BoolOpt('neutron',
616 default=False,
617 help="Whether or not neutron is expected to be available"),
Matthew Treinish853ae442013-07-19 16:36:07 -0400618 cfg.BoolOpt('glance',
619 default=True,
620 help="Whether or not glance is expected to be available"),
Matthew Treinish61e332b2013-07-19 16:42:31 -0400621 cfg.BoolOpt('swift',
622 default=True,
623 help="Whether or not swift is expected to be available"),
Matthew Treinish6b41e242013-07-19 16:49:28 -0400624 cfg.BoolOpt('nova',
625 default=True,
626 help="Whether or not nova is expected to be available"),
Matthew Treinisha9d43882013-07-19 16:54:52 -0400627 cfg.BoolOpt('heat',
628 default=False,
629 help="Whether or not Heat is expected to be available"),
Mehdi Abaakouk8581c0b2013-10-04 10:45:42 +0200630 cfg.BoolOpt('ceilometer',
631 default=True,
632 help="Whether or not Ceilometer is expected to be available"),
Julie Pichond1017642013-07-24 16:37:23 +0100633 cfg.BoolOpt('horizon',
634 default=True,
635 help="Whether or not Horizon is expected to be available"),
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400636 cfg.BoolOpt('savanna',
637 default=False,
638 help="Whether or not Savanna is expected to be available"),
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300639 cfg.BoolOpt('ironic',
640 default=False,
641 help="Whether or not Ironic is expected to be available"),
Matthew Treinish4c412922013-07-16 15:27:42 -0400642]
643
Attila Fazekasaeeeefd2013-08-06 17:01:56 +0200644debug_group = cfg.OptGroup(name="debug",
645 title="Debug System")
646
647DebugGroup = [
648 cfg.BoolOpt('enable',
649 default=True,
650 help="Enable diagnostic commands"),
651]
652
Andrea Frittolif5da28b2013-12-06 07:08:07 +0000653input_scenario_group = cfg.OptGroup(name="input-scenario",
654 title="Filters and values for"
655 " input scenarios")
656
657InputScenarioGroup = [
658 cfg.StrOpt('image_regex',
659 default='^cirros-0.3.1-x86_64-uec$',
660 help="Matching images become parameters for scenario tests"),
661 cfg.StrOpt('flavor_regex',
662 default='^m1.(micro|nano|tiny)$',
663 help="Matching flavors become parameters for scenario tests"),
664 cfg.StrOpt('non_ssh_image_regex',
665 default='^.*[Ww]in.*$',
666 help="SSH verification in tests is skipped"
667 "for matching images"),
668 cfg.StrOpt('ssh_user_regex',
669 default="[[\"^.*[Cc]irros.*$\", \"root\"]]",
670 help="List of user mapped to regex "
671 "to matching image names."),
672]
673
Attila Fazekasaeeeefd2013-08-06 17:01:56 +0200674
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300675baremetal_group = cfg.OptGroup(name='baremetal',
676 title='Baremetal provisioning service options')
677
678BaremetalGroup = [
679 cfg.StrOpt('catalog_type',
680 default='baremetal',
681 help="Catalog type of the baremetal provisioning service."),
682]
683
684
Sean Dague3b9b1f32013-12-20 17:04:54 -0500685# this should never be called outside of this class
686class TempestConfigPrivate(object):
Daryl Walleck1465d612011-11-02 02:22:15 -0500687 """Provides OpenStack configuration information."""
688
Brian Waldon738cd632011-12-12 18:45:09 -0500689 DEFAULT_CONFIG_DIR = os.path.join(
Zhongyue Luoa1343de2013-01-04 16:21:35 +0800690 os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
Brian Waldon738cd632011-12-12 18:45:09 -0500691 "etc")
Daryl Walleck1465d612011-11-02 02:22:15 -0500692
Brian Waldon738cd632011-12-12 18:45:09 -0500693 DEFAULT_CONFIG_FILE = "tempest.conf"
694
Sean Dague2ec4c2c2013-12-22 11:30:06 -0500695 def __init__(self, parse_conf=True):
Brian Waldon738cd632011-12-12 18:45:09 -0500696 """Initialize a configuration from a conf directory and conf file."""
Sean Dague3b9b1f32013-12-20 17:04:54 -0500697 super(TempestConfigPrivate, self).__init__()
Sean Dague2416cf32013-04-10 08:29:07 -0400698 config_files = []
Sean Dague2416cf32013-04-10 08:29:07 -0400699 failsafe_path = "/etc/tempest/" + self.DEFAULT_CONFIG_FILE
Brian Waldon738cd632011-12-12 18:45:09 -0500700
701 # Environment variables override defaults...
702 conf_dir = os.environ.get('TEMPEST_CONFIG_DIR',
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800703 self.DEFAULT_CONFIG_DIR)
704 conf_file = os.environ.get('TEMPEST_CONFIG', self.DEFAULT_CONFIG_FILE)
Brian Waldon738cd632011-12-12 18:45:09 -0500705
Jay Pipes7f757632011-12-02 15:53:32 -0500706 path = os.path.join(conf_dir, conf_file)
707
Zhongyue Luoafd43eb2013-02-04 11:32:57 +0800708 if not (os.path.isfile(path) or
709 'TEMPEST_CONFIG_DIR' in os.environ or
710 'TEMPEST_CONFIG' in os.environ):
Sean Dague2416cf32013-04-10 08:29:07 -0400711 path = failsafe_path
Attila Fazekas5abb2532012-12-04 11:30:49 +0100712
Sean Dague2ec4c2c2013-12-22 11:30:06 -0500713 # only parse the config file if we expect one to exist. This is needed
714 # to remove an issue with the config file up to date checker.
715 if parse_conf:
Sean Dague2416cf32013-04-10 08:29:07 -0400716 config_files.append(path)
Jay Pipes7f757632011-12-02 15:53:32 -0500717
Sean Dague2416cf32013-04-10 08:29:07 -0400718 cfg.CONF([], project='tempest', default_config_files=config_files)
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -0400719 logging.setup('tempest')
720 LOG = logging.getLogger('tempest')
721 LOG.info("Using tempest config file %s" % path)
Daryl Walleck1465d612011-11-02 02:22:15 -0500722
DennyZhang88a2dd82013-10-07 12:55:35 -0500723 register_opt_group(cfg.CONF, compute_group, ComputeGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000724 register_opt_group(cfg.CONF, compute_features_group,
725 ComputeFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500726 register_opt_group(cfg.CONF, identity_group, IdentityGroup)
727 register_opt_group(cfg.CONF, image_group, ImageGroup)
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000728 register_opt_group(cfg.CONF, image_feature_group, ImageFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500729 register_opt_group(cfg.CONF, network_group, NetworkGroup)
Matthew Treinishe3d26142013-11-26 19:14:58 +0000730 register_opt_group(cfg.CONF, network_feature_group,
731 NetworkFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500732 register_opt_group(cfg.CONF, volume_group, VolumeGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000733 register_opt_group(cfg.CONF, volume_feature_group,
734 VolumeFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500735 register_opt_group(cfg.CONF, object_storage_group, ObjectStoreGroup)
Matthew Treinishd5c96022013-10-17 21:51:23 +0000736 register_opt_group(cfg.CONF, object_storage_feature_group,
737 ObjectStoreFeaturesGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500738 register_opt_group(cfg.CONF, orchestration_group, OrchestrationGroup)
Yassine Lamgarchalb158d412013-12-27 19:29:42 +0100739 register_opt_group(cfg.CONF, telemetry_group, TelemetryGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500740 register_opt_group(cfg.CONF, dashboard_group, DashboardGroup)
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400741 register_opt_group(cfg.CONF, data_processing_group,
742 DataProcessingGroup)
DennyZhang88a2dd82013-10-07 12:55:35 -0500743 register_opt_group(cfg.CONF, boto_group, BotoGroup)
744 register_opt_group(cfg.CONF, compute_admin_group, ComputeAdminGroup)
745 register_opt_group(cfg.CONF, stress_group, StressGroup)
746 register_opt_group(cfg.CONF, scenario_group, ScenarioGroup)
747 register_opt_group(cfg.CONF, service_available_group,
748 ServiceAvailableGroup)
749 register_opt_group(cfg.CONF, debug_group, DebugGroup)
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300750 register_opt_group(cfg.CONF, baremetal_group, BaremetalGroup)
Andrea Frittolif5da28b2013-12-06 07:08:07 +0000751 register_opt_group(cfg.CONF, input_scenario_group, InputScenarioGroup)
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500752 self.compute = cfg.CONF.compute
Matthew Treinishd5c96022013-10-17 21:51:23 +0000753 self.compute_feature_enabled = cfg.CONF['compute-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500754 self.identity = cfg.CONF.identity
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500755 self.images = cfg.CONF.image
Matthew Treinish2b5287d2013-10-22 17:40:34 +0000756 self.image_feature_enabled = cfg.CONF['image-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500757 self.network = cfg.CONF.network
Matthew Treinishe3d26142013-11-26 19:14:58 +0000758 self.network_feature_enabled = cfg.CONF['network-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500759 self.volume = cfg.CONF.volume
Matthew Treinishd5c96022013-10-17 21:51:23 +0000760 self.volume_feature_enabled = cfg.CONF['volume-feature-enabled']
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500761 self.object_storage = cfg.CONF['object-storage']
Matthew Treinishd5c96022013-10-17 21:51:23 +0000762 self.object_storage_feature_enabled = cfg.CONF[
763 'object-storage-feature-enabled']
Steve Bakerc60e4e32013-05-06 15:22:41 +1200764 self.orchestration = cfg.CONF.orchestration
Yassine Lamgarchalb158d412013-12-27 19:29:42 +0100765 self.telemetry = cfg.CONF.telemetry
Julie Pichond1017642013-07-24 16:37:23 +0100766 self.dashboard = cfg.CONF.dashboard
Sergey Lukjanovcec6c3f2013-12-10 12:38:21 +0400767 self.data_processing = cfg.CONF.data_processing
Matthew Treinish39e48ef2012-12-21 13:36:15 -0500768 self.boto = cfg.CONF.boto
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100769 self.compute_admin = cfg.CONF['compute-admin']
Matthew Treinish615ea6a2013-02-25 17:26:59 -0500770 self.stress = cfg.CONF.stress
Masayuki Igawa73d9f3a2013-05-24 10:30:01 +0900771 self.scenario = cfg.CONF.scenario
Matthew Treinish4c412922013-07-16 15:27:42 -0400772 self.service_available = cfg.CONF.service_available
Attila Fazekas5fae7a32013-09-25 16:52:44 +0200773 self.debug = cfg.CONF.debug
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +0300774 self.baremetal = cfg.CONF.baremetal
Andrea Frittolif5da28b2013-12-06 07:08:07 +0000775 self.input_scenario = cfg.CONF['input-scenario']
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100776 if not self.compute_admin.username:
777 self.compute_admin.username = self.identity.admin_username
778 self.compute_admin.password = self.identity.admin_password
779 self.compute_admin.tenant_name = self.identity.admin_tenant_name
Sean Dague86bd8422013-12-20 09:56:44 -0500780
781
782class TempestConfigProxy(object):
783 _config = None
784
785 def __getattr__(self, attr):
786 if not self._config:
Sean Dague3b9b1f32013-12-20 17:04:54 -0500787 self._config = TempestConfigPrivate()
Sean Dague86bd8422013-12-20 09:56:44 -0500788
789 return getattr(self._config, attr)
790
791
792CONF = TempestConfigProxy()