blob: 06fd541735bcd94eb3d65c9ba2acf5b61e79936c [file] [log] [blame]
Maru Newbyb096d9f2015-03-09 18:54:54 +00001# Copyright 2012 OpenStack Foundation
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16from __future__ import print_function
17
Maru Newbyb096d9f2015-03-09 18:54:54 +000018import os
19
Ihar Hrachyshkac695f9f2015-02-26 23:26:41 +010020from oslo_config import cfg
Maru Newby5690a352015-03-13 18:46:40 +000021
Ihar Hrachyshkac695f9f2015-02-26 23:26:41 +010022from oslo_log import log as logging
Maru Newbyb096d9f2015-03-09 18:54:54 +000023
24
25def register_opt_group(conf, opt_group, options):
26 conf.register_group(opt_group)
27 for opt in options:
28 conf.register_opt(opt, group=opt_group.name)
29
30
31auth_group = cfg.OptGroup(name='auth',
32 title="Options for authentication and credentials")
33
34
35AuthGroup = [
36 cfg.StrOpt('test_accounts_file',
37 default='etc/accounts.yaml',
38 help="Path to the yaml file that contains the list of "
39 "credentials to use for running tests"),
40 cfg.BoolOpt('allow_tenant_isolation',
41 default=True,
42 help="Allows test cases to create/destroy tenants and "
43 "users. This option requires that OpenStack Identity "
44 "API admin credentials are known. If false, isolated "
45 "test cases and parallel execution, can still be "
46 "achieved configuring a list of test accounts",
47 deprecated_opts=[cfg.DeprecatedOpt('allow_tenant_isolation',
48 group='compute'),
49 cfg.DeprecatedOpt('allow_tenant_isolation',
50 group='orchestration')]),
51 cfg.BoolOpt('locking_credentials_provider',
52 default=False,
53 help="If set to True it enables the Accounts provider, "
54 "which locks credentials to allow for parallel execution "
55 "with pre-provisioned accounts. It can only be used to "
56 "run tests that ensure credentials cleanup happens. "
57 "It requires at least `2 * CONC` distinct accounts "
58 "configured in `test_accounts_file`, with CONC == the "
59 "number of concurrent test processes."),
60 cfg.ListOpt('tempest_roles',
61 help="Roles to assign to all users created by tempest",
Assaf Muller95716a02016-01-04 20:30:43 -050062 default=[]),
63 cfg.StrOpt('admin_username',
64 help="Administrative Username to use for "
65 "Keystone API requests."),
66 cfg.StrOpt('admin_tenant_name',
67 help="Administrative Tenant name to use for Keystone API "
68 "requests."),
69 cfg.StrOpt('admin_password',
70 help="API key to use when authenticating as admin.",
71 secret=True),
72 cfg.StrOpt('admin_domain_name',
73 help="Admin domain name for authentication (Keystone V3)."
74 "The same domain applies to user and project"),
Maru Newbyb096d9f2015-03-09 18:54:54 +000075]
76
77identity_group = cfg.OptGroup(name='identity',
78 title="Keystone Configuration Options")
79
80IdentityGroup = [
81 cfg.StrOpt('catalog_type',
82 default='identity',
83 help="Catalog type of the Identity service."),
84 cfg.BoolOpt('disable_ssl_certificate_validation',
85 default=False,
86 help="Set to True if using self-signed SSL certificates."),
87 cfg.StrOpt('ca_certificates_file',
Maru Newbyb096d9f2015-03-09 18:54:54 +000088 help='Specify a CA bundle file to use in verifying a '
89 'TLS (https) server certificate.'),
90 cfg.StrOpt('uri',
91 help="Full URI of the OpenStack Identity API (Keystone), v2"),
92 cfg.StrOpt('uri_v3',
93 help='Full URI of the OpenStack Identity API (Keystone), v3'),
94 cfg.StrOpt('auth_version',
95 default='v2',
96 help="Identity API version to be used for authentication "
97 "for API tests."),
98 cfg.StrOpt('region',
99 default='RegionOne',
100 help="The identity region name to use. Also used as the other "
101 "services' region name unless they are set explicitly. "
102 "If no such region is found in the service catalog, the "
103 "first found one is used."),
104 cfg.StrOpt('endpoint_type',
105 default='publicURL',
106 choices=['public', 'admin', 'internal',
107 'publicURL', 'adminURL', 'internalURL'],
108 help="The endpoint type to use for the identity service."),
109 cfg.StrOpt('username',
110 help="Username to use for Nova API requests."),
111 cfg.StrOpt('tenant_name',
112 help="Tenant name to use for Nova API requests."),
113 cfg.StrOpt('admin_role',
114 default='admin',
115 help="Role required to administrate keystone."),
116 cfg.StrOpt('password',
117 help="API key to use when authenticating.",
118 secret=True),
119 cfg.StrOpt('domain_name',
120 help="Domain name for authentication (Keystone V3)."
121 "The same domain applies to user and project"),
122 cfg.StrOpt('alt_username',
123 help="Username of alternate user to use for Nova API "
124 "requests."),
125 cfg.StrOpt('alt_tenant_name',
126 help="Alternate user's Tenant name to use for Nova API "
127 "requests."),
128 cfg.StrOpt('alt_password',
129 help="API key to use when authenticating as alternate user.",
130 secret=True),
131 cfg.StrOpt('alt_domain_name',
132 help="Alternate domain name for authentication (Keystone V3)."
133 "The same domain applies to user and project"),
Maru Newbyb096d9f2015-03-09 18:54:54 +0000134]
135
136identity_feature_group = cfg.OptGroup(name='identity-feature-enabled',
137 title='Enabled Identity Features')
138
139IdentityFeatureGroup = [
140 cfg.BoolOpt('trust',
141 default=True,
142 help='Does the identity service have delegation and '
143 'impersonation enabled'),
144 cfg.BoolOpt('api_v2',
145 default=True,
146 help='Is the v2 identity API enabled'),
147 cfg.BoolOpt('api_v3',
148 default=True,
149 help='Is the v3 identity API enabled'),
150]
151
152compute_group = cfg.OptGroup(name='compute',
153 title='Compute Service Options')
154
155ComputeGroup = [
156 cfg.StrOpt('image_ref',
157 help="Valid primary image reference to be used in tests. "
158 "This is a required option"),
159 cfg.StrOpt('image_ref_alt',
160 help="Valid secondary image reference to be used in tests. "
161 "This is a required option, but if only one image is "
162 "available duplicate the value of image_ref above"),
163 cfg.StrOpt('flavor_ref',
164 default="1",
165 help="Valid primary flavor to use in tests."),
166 cfg.StrOpt('flavor_ref_alt',
167 default="2",
168 help='Valid secondary flavor to be used in tests.'),
169 cfg.StrOpt('image_ssh_user',
170 default="root",
171 help="User name used to authenticate to an instance."),
172 cfg.StrOpt('image_ssh_password',
173 default="password",
174 help="Password used to authenticate to an instance."),
175 cfg.StrOpt('image_alt_ssh_user',
176 default="root",
177 help="User name used to authenticate to an instance using "
178 "the alternate image."),
179 cfg.StrOpt('image_alt_ssh_password',
180 default="password",
181 help="Password used to authenticate to an instance using "
182 "the alternate image."),
183 cfg.IntOpt('build_interval',
184 default=1,
185 help="Time in seconds between build status checks."),
186 cfg.IntOpt('build_timeout',
187 default=300,
188 help="Timeout in seconds to wait for an instance to build. "
189 "Other services that do not define build_timeout will "
190 "inherit this value."),
191 cfg.BoolOpt('run_ssh',
192 default=False,
193 help="Should the tests ssh to instances?"),
194 cfg.StrOpt('ssh_auth_method',
195 default='keypair',
196 help="Auth method used for authenticate to the instance. "
197 "Valid choices are: keypair, configured, adminpass. "
198 "keypair: start the servers with an ssh keypair. "
199 "configured: use the configured user and password. "
200 "adminpass: use the injected adminPass. "
201 "disabled: avoid using ssh when it is an option."),
202 cfg.StrOpt('ssh_connect_method',
203 default='fixed',
204 help="How to connect to the instance? "
205 "fixed: using the first ip belongs the fixed network "
206 "floating: creating and using a floating ip"),
207 cfg.StrOpt('ssh_user',
208 default='root',
209 help="User name used to authenticate to an instance."),
210 cfg.IntOpt('ping_timeout',
211 default=120,
212 help="Timeout in seconds to wait for ping to "
213 "succeed."),
214 cfg.IntOpt('ssh_timeout',
215 default=300,
216 help="Timeout in seconds to wait for authentication to "
217 "succeed."),
218 cfg.IntOpt('ready_wait',
219 default=0,
220 help="Additional wait time for clean state, when there is "
221 "no OS-EXT-STS extension available"),
222 cfg.IntOpt('ssh_channel_timeout',
223 default=60,
224 help="Timeout in seconds to wait for output from ssh "
225 "channel."),
226 cfg.StrOpt('fixed_network_name',
227 default='private',
228 help="Name of the fixed network that is visible to all test "
229 "tenants."),
230 cfg.StrOpt('network_for_ssh',
231 default='public',
232 help="Network used for SSH connections. Ignored if "
233 "use_floatingip_for_ssh=true or run_ssh=false."),
234 cfg.IntOpt('ip_version_for_ssh',
235 default=4,
236 help="IP version used for SSH connections."),
237 cfg.BoolOpt('use_floatingip_for_ssh',
238 default=True,
239 help="Does SSH use Floating IPs?"),
240 cfg.StrOpt('catalog_type',
241 default='compute',
242 help="Catalog type of the Compute service."),
243 cfg.StrOpt('region',
244 default='',
245 help="The compute region name to use. If empty, the value "
246 "of identity.region is used instead. If no such region "
247 "is found in the service catalog, the first found one is "
248 "used."),
249 cfg.StrOpt('endpoint_type',
250 default='publicURL',
251 choices=['public', 'admin', 'internal',
252 'publicURL', 'adminURL', 'internalURL'],
253 help="The endpoint type to use for the compute service."),
254 cfg.StrOpt('path_to_private_key',
255 help="Path to a private key file for SSH access to remote "
256 "hosts"),
257 cfg.StrOpt('volume_device_name',
258 default='vdb',
259 help="Expected device name when a volume is attached to "
260 "an instance"),
261 cfg.IntOpt('shelved_offload_time',
262 default=0,
263 help='Time in seconds before a shelved instance is eligible '
264 'for removing from a host. -1 never offload, 0 offload '
265 'when shelved. This time should be the same as the time '
266 'of nova.conf, and some tests will run for as long as the '
267 'time.'),
268 cfg.StrOpt('floating_ip_range',
269 default='10.0.0.0/29',
270 help='Unallocated floating IP range, which will be used to '
271 'test the floating IP bulk feature for CRUD operation. '
272 'This block must not overlap an existing floating IP '
273 'pool.')
274]
275
276compute_features_group = cfg.OptGroup(name='compute-feature-enabled',
277 title="Enabled Compute Service Features")
278
279ComputeFeaturesGroup = [
280 cfg.BoolOpt('disk_config',
281 default=True,
282 help="If false, skip disk config tests"),
283 cfg.ListOpt('api_extensions',
284 default=['all'],
285 help='A list of enabled compute extensions with a special '
286 'entry all which indicates every extension is enabled. '
287 'Each extension should be specified with alias name. '
288 'Empty list indicates all extensions are disabled'),
289 cfg.BoolOpt('change_password',
290 default=False,
291 help="Does the test environment support changing the admin "
292 "password?"),
293 cfg.BoolOpt('console_output',
294 default=True,
295 help="Does the test environment support obtaining instance "
296 "serial console output?"),
297 cfg.BoolOpt('resize',
298 default=False,
299 help="Does the test environment support resizing?"),
300 cfg.BoolOpt('pause',
301 default=True,
302 help="Does the test environment support pausing?"),
303 cfg.BoolOpt('shelve',
304 default=True,
305 help="Does the test environment support shelving/unshelving?"),
306 cfg.BoolOpt('suspend',
307 default=True,
308 help="Does the test environment support suspend/resume?"),
309 cfg.BoolOpt('live_migration',
310 default=True,
311 help="Does the test environment support live migration "
312 "available?"),
313 cfg.BoolOpt('block_migration_for_live_migration',
314 default=False,
315 help="Does the test environment use block devices for live "
316 "migration"),
317 cfg.BoolOpt('block_migrate_cinder_iscsi',
318 default=False,
319 help="Does the test environment block migration support "
320 "cinder iSCSI volumes"),
321 cfg.BoolOpt('vnc_console',
322 default=False,
323 help='Enable VNC console. This configuration value should '
324 'be same as [nova.vnc]->vnc_enabled in nova.conf'),
325 cfg.BoolOpt('spice_console',
326 default=False,
327 help='Enable Spice console. This configuration value should '
328 'be same as [nova.spice]->enabled in nova.conf'),
329 cfg.BoolOpt('rdp_console',
330 default=False,
331 help='Enable RDP console. This configuration value should '
332 'be same as [nova.rdp]->enabled in nova.conf'),
333 cfg.BoolOpt('rescue',
334 default=True,
335 help='Does the test environment support instance rescue '
336 'mode?'),
337 cfg.BoolOpt('enable_instance_password',
338 default=True,
339 help='Enables returning of the instance password by the '
340 'relevant server API calls such as create, rebuild '
341 'or rescue.'),
342 cfg.BoolOpt('interface_attach',
343 default=True,
344 help='Does the test environment support dynamic network '
345 'interface attachment?'),
346 cfg.BoolOpt('snapshot',
347 default=True,
348 help='Does the test environment support creating snapshot '
349 'images of running instances?'),
350 cfg.BoolOpt('ec2_api',
351 default=True,
352 help='Does the test environment have the ec2 api running?')
353]
354
355
356image_group = cfg.OptGroup(name='image',
357 title="Image Service Options")
358
359ImageGroup = [
360 cfg.StrOpt('catalog_type',
361 default='image',
362 help='Catalog type of the Image service.'),
363 cfg.StrOpt('region',
364 default='',
365 help="The image region name to use. If empty, the value "
366 "of identity.region is used instead. If no such region "
367 "is found in the service catalog, the first found one is "
368 "used."),
369 cfg.StrOpt('endpoint_type',
370 default='publicURL',
371 choices=['public', 'admin', 'internal',
372 'publicURL', 'adminURL', 'internalURL'],
373 help="The endpoint type to use for the image service."),
374 cfg.StrOpt('http_image',
375 default='http://download.cirros-cloud.net/0.3.1/'
376 'cirros-0.3.1-x86_64-uec.tar.gz',
377 help='http accessible image'),
378 cfg.IntOpt('build_timeout',
379 default=300,
380 help="Timeout in seconds to wait for an image to "
381 "become available."),
382 cfg.IntOpt('build_interval',
383 default=1,
384 help="Time in seconds between image operation status "
385 "checks.")
386]
387
388image_feature_group = cfg.OptGroup(name='image-feature-enabled',
389 title='Enabled image service features')
390
391ImageFeaturesGroup = [
392 cfg.BoolOpt('api_v2',
393 default=True,
394 help="Is the v2 image API enabled"),
395 cfg.BoolOpt('api_v1',
396 default=True,
397 help="Is the v1 image API enabled"),
398]
399
400network_group = cfg.OptGroup(name='network',
401 title='Network Service Options')
402
403NetworkGroup = [
404 cfg.StrOpt('catalog_type',
405 default='network',
406 help='Catalog type of the Neutron service.'),
407 cfg.StrOpt('region',
408 default='',
409 help="The network region name to use. If empty, the value "
410 "of identity.region is used instead. If no such region "
411 "is found in the service catalog, the first found one is "
412 "used."),
413 cfg.StrOpt('endpoint_type',
414 default='publicURL',
415 choices=['public', 'admin', 'internal',
416 'publicURL', 'adminURL', 'internalURL'],
417 help="The endpoint type to use for the network service."),
418 cfg.StrOpt('tenant_network_cidr',
419 default="10.100.0.0/16",
420 help="The cidr block to allocate tenant ipv4 subnets from"),
421 cfg.IntOpt('tenant_network_mask_bits',
422 default=28,
423 help="The mask bits for tenant ipv4 subnets"),
424 cfg.StrOpt('tenant_network_v6_cidr',
425 default="2003::/48",
426 help="The cidr block to allocate tenant ipv6 subnets from"),
427 cfg.IntOpt('tenant_network_v6_mask_bits',
428 default=64,
429 help="The mask bits for tenant ipv6 subnets"),
430 cfg.BoolOpt('tenant_networks_reachable',
431 default=False,
432 help="Whether tenant network connectivity should be "
433 "evaluated directly"),
434 cfg.StrOpt('public_network_id',
435 default="",
436 help="Id of the public network that provides external "
437 "connectivity"),
438 cfg.StrOpt('public_router_id',
439 default="",
440 help="Id of the public router that provides external "
441 "connectivity. This should only be used when Neutron's "
442 "'allow_overlapping_ips' is set to 'False' in "
443 "neutron.conf. usually not needed past 'Grizzly' release"),
444 cfg.IntOpt('build_timeout',
445 default=300,
446 help="Timeout in seconds to wait for network operation to "
447 "complete."),
448 cfg.IntOpt('build_interval',
449 default=1,
450 help="Time in seconds between network operation status "
451 "checks."),
452 cfg.ListOpt('dns_servers',
453 default=["8.8.8.8", "8.8.4.4"],
454 help="List of dns servers which should be used"
455 " for subnet creation"),
456 cfg.StrOpt('port_vnic_type',
457 choices=[None, 'normal', 'direct', 'macvtap'],
458 help="vnic_type to use when Launching instances"
459 " with pre-configured ports."
460 " Supported ports are:"
461 " ['normal','direct','macvtap']"),
462]
463
464network_feature_group = cfg.OptGroup(name='network-feature-enabled',
465 title='Enabled network service features')
466
467NetworkFeaturesGroup = [
468 cfg.BoolOpt('ipv6',
469 default=True,
470 help="Allow the execution of IPv6 tests"),
471 cfg.ListOpt('api_extensions',
472 default=['all'],
473 help='A list of enabled network extensions with a special '
474 'entry all which indicates every extension is enabled. '
475 'Empty list indicates all extensions are disabled'),
476 cfg.BoolOpt('ipv6_subnet_attributes',
477 default=False,
478 help="Allow the execution of IPv6 subnet tests that use "
479 "the extended IPv6 attributes ipv6_ra_mode "
480 "and ipv6_address_mode"
481 ),
Yuuichi Fujioka1257b572015-06-10 17:18:12 +0900482 cfg.BoolOpt('specify_floating_ip_address_available',
483 default=True,
484 help='Allow passing an IP Address of the floating ip when '
485 'creating the floating ip'),
Maru Newbyb096d9f2015-03-09 18:54:54 +0000486]
487
488messaging_group = cfg.OptGroup(name='messaging',
489 title='Messaging Service')
490
491MessagingGroup = [
492 cfg.StrOpt('catalog_type',
493 default='messaging',
494 help='Catalog type of the Messaging service.'),
495 cfg.IntOpt('max_queues_per_page',
496 default=20,
497 help='The maximum number of queue records per page when '
498 'listing queues'),
499 cfg.IntOpt('max_queue_metadata',
500 default=65536,
501 help='The maximum metadata size for a queue'),
502 cfg.IntOpt('max_messages_per_page',
503 default=20,
504 help='The maximum number of queue message per page when '
505 'listing (or) posting messages'),
506 cfg.IntOpt('max_message_size',
507 default=262144,
508 help='The maximum size of a message body'),
509 cfg.IntOpt('max_messages_per_claim',
510 default=20,
511 help='The maximum number of messages per claim'),
512 cfg.IntOpt('max_message_ttl',
513 default=1209600,
514 help='The maximum ttl for a message'),
515 cfg.IntOpt('max_claim_ttl',
516 default=43200,
517 help='The maximum ttl for a claim'),
518 cfg.IntOpt('max_claim_grace',
519 default=43200,
520 help='The maximum grace period for a claim'),
521]
522
523volume_group = cfg.OptGroup(name='volume',
524 title='Block Storage Options')
525
526VolumeGroup = [
527 cfg.IntOpt('build_interval',
528 default=1,
529 help='Time in seconds between volume availability checks.'),
530 cfg.IntOpt('build_timeout',
531 default=300,
532 help='Timeout in seconds to wait for a volume to become '
533 'available.'),
534 cfg.StrOpt('catalog_type',
535 default='volume',
536 help="Catalog type of the Volume Service"),
537 cfg.StrOpt('region',
538 default='',
539 help="The volume region name to use. If empty, the value "
540 "of identity.region is used instead. If no such region "
541 "is found in the service catalog, the first found one is "
542 "used."),
543 cfg.StrOpt('endpoint_type',
544 default='publicURL',
545 choices=['public', 'admin', 'internal',
546 'publicURL', 'adminURL', 'internalURL'],
547 help="The endpoint type to use for the volume service."),
548 cfg.StrOpt('backend1_name',
549 default='BACKEND_1',
550 help="Name of the backend1 (must be declared in cinder.conf)"),
551 cfg.StrOpt('backend2_name',
552 default='BACKEND_2',
553 help="Name of the backend2 (must be declared in cinder.conf)"),
554 cfg.StrOpt('storage_protocol',
555 default='iSCSI',
556 help='Backend protocol to target when creating volume types'),
557 cfg.StrOpt('vendor_name',
558 default='Open Source',
559 help='Backend vendor to target when creating volume types'),
560 cfg.StrOpt('disk_format',
561 default='raw',
562 help='Disk format to use when copying a volume to image'),
563 cfg.IntOpt('volume_size',
564 default=1,
565 help='Default size in GB for volumes created by volumes tests'),
566]
567
568volume_feature_group = cfg.OptGroup(name='volume-feature-enabled',
569 title='Enabled Cinder Features')
570
571VolumeFeaturesGroup = [
572 cfg.BoolOpt('multi_backend',
573 default=False,
574 help="Runs Cinder multi-backend test (requires 2 backends)"),
575 cfg.BoolOpt('backup',
576 default=True,
577 help='Runs Cinder volumes backup test'),
578 cfg.BoolOpt('snapshot',
579 default=True,
580 help='Runs Cinder volume snapshot test'),
581 cfg.ListOpt('api_extensions',
582 default=['all'],
583 help='A list of enabled volume extensions with a special '
584 'entry all which indicates every extension is enabled. '
585 'Empty list indicates all extensions are disabled'),
586 cfg.BoolOpt('api_v1',
587 default=True,
588 help="Is the v1 volume API enabled"),
589 cfg.BoolOpt('api_v2',
590 default=True,
591 help="Is the v2 volume API enabled"),
592]
593
594
595object_storage_group = cfg.OptGroup(name='object-storage',
596 title='Object Storage Service Options')
597
598ObjectStoreGroup = [
599 cfg.StrOpt('catalog_type',
600 default='object-store',
601 help="Catalog type of the Object-Storage service."),
602 cfg.StrOpt('region',
603 default='',
604 help="The object-storage region name to use. If empty, the "
605 "value of identity.region is used instead. If no such "
606 "region is found in the service catalog, the first found "
607 "one is used."),
608 cfg.StrOpt('endpoint_type',
609 default='publicURL',
610 choices=['public', 'admin', 'internal',
611 'publicURL', 'adminURL', 'internalURL'],
612 help="The endpoint type to use for the object-store service."),
613 cfg.IntOpt('container_sync_timeout',
614 default=600,
615 help="Number of seconds to time on waiting for a container "
616 "to container synchronization complete."),
617 cfg.IntOpt('container_sync_interval',
618 default=5,
619 help="Number of seconds to wait while looping to check the "
620 "status of a container to container synchronization"),
621 cfg.StrOpt('operator_role',
622 default='Member',
623 help="Role to add to users created for swift tests to "
624 "enable creating containers"),
625 cfg.StrOpt('reseller_admin_role',
626 default='ResellerAdmin',
627 help="User role that has reseller admin"),
628 cfg.StrOpt('realm_name',
629 default='realm1',
630 help="Name of sync realm. A sync realm is a set of clusters "
631 "that have agreed to allow container syncing with each "
632 "other. Set the same realm name as Swift's "
633 "container-sync-realms.conf"),
634 cfg.StrOpt('cluster_name',
635 default='name1',
636 help="One name of cluster which is set in the realm whose name "
637 "is set in 'realm_name' item in this file. Set the "
638 "same cluster name as Swift's container-sync-realms.conf"),
639]
640
641object_storage_feature_group = cfg.OptGroup(
642 name='object-storage-feature-enabled',
643 title='Enabled object-storage features')
644
645ObjectStoreFeaturesGroup = [
646 cfg.ListOpt('discoverable_apis',
647 default=['all'],
648 help="A list of the enabled optional discoverable apis. "
649 "A single entry, all, indicates that all of these "
650 "features are expected to be enabled"),
651 cfg.BoolOpt('container_sync',
652 default=True,
653 help="Execute (old style) container-sync tests"),
654 cfg.BoolOpt('object_versioning',
655 default=True,
656 help="Execute object-versioning tests"),
657 cfg.BoolOpt('discoverability',
658 default=True,
659 help="Execute discoverability tests"),
660]
661
662database_group = cfg.OptGroup(name='database',
663 title='Database Service Options')
664
665DatabaseGroup = [
666 cfg.StrOpt('catalog_type',
667 default='database',
668 help="Catalog type of the Database service."),
669 cfg.StrOpt('db_flavor_ref',
670 default="1",
671 help="Valid primary flavor to use in database tests."),
672 cfg.StrOpt('db_current_version',
673 default="v1.0",
674 help="Current database version to use in database tests."),
675]
676
677orchestration_group = cfg.OptGroup(name='orchestration',
678 title='Orchestration Service Options')
679
680OrchestrationGroup = [
681 cfg.StrOpt('catalog_type',
682 default='orchestration',
683 help="Catalog type of the Orchestration service."),
684 cfg.StrOpt('region',
685 default='',
686 help="The orchestration region name to use. If empty, the "
687 "value of identity.region is used instead. If no such "
688 "region is found in the service catalog, the first found "
689 "one is used."),
690 cfg.StrOpt('endpoint_type',
691 default='publicURL',
692 choices=['public', 'admin', 'internal',
693 'publicURL', 'adminURL', 'internalURL'],
694 help="The endpoint type to use for the orchestration service."),
695 cfg.IntOpt('build_interval',
696 default=1,
697 help="Time in seconds between build status checks."),
698 cfg.IntOpt('build_timeout',
699 default=1200,
700 help="Timeout in seconds to wait for a stack to build."),
701 cfg.StrOpt('instance_type',
702 default='m1.micro',
703 help="Instance type for tests. Needs to be big enough for a "
704 "full OS plus the test workload"),
Maru Newbyb096d9f2015-03-09 18:54:54 +0000705 cfg.StrOpt('keypair_name',
706 help="Name of existing keypair to launch servers with."),
707 cfg.IntOpt('max_template_size',
708 default=524288,
709 help="Value must match heat configuration of the same name."),
710 cfg.IntOpt('max_resources_per_stack',
711 default=1000,
712 help="Value must match heat configuration of the same name."),
713]
714
715
716telemetry_group = cfg.OptGroup(name='telemetry',
717 title='Telemetry Service Options')
718
719TelemetryGroup = [
720 cfg.StrOpt('catalog_type',
721 default='metering',
722 help="Catalog type of the Telemetry service."),
723 cfg.StrOpt('endpoint_type',
724 default='publicURL',
725 choices=['public', 'admin', 'internal',
726 'publicURL', 'adminURL', 'internalURL'],
727 help="The endpoint type to use for the telemetry service."),
728 cfg.BoolOpt('too_slow_to_test',
729 default=True,
730 help="This variable is used as flag to enable "
731 "notification tests")
732]
733
734
735dashboard_group = cfg.OptGroup(name="dashboard",
736 title="Dashboard options")
737
738DashboardGroup = [
739 cfg.StrOpt('dashboard_url',
740 default='http://localhost/',
741 help="Where the dashboard can be found"),
742 cfg.StrOpt('login_url',
743 default='http://localhost/auth/login/',
744 help="Login page for the dashboard"),
745]
746
747
748data_processing_group = cfg.OptGroup(name="data_processing",
749 title="Data Processing options")
750
751DataProcessingGroup = [
752 cfg.StrOpt('catalog_type',
753 default='data_processing',
754 help="Catalog type of the data processing service."),
755 cfg.StrOpt('endpoint_type',
756 default='publicURL',
757 choices=['public', 'admin', 'internal',
758 'publicURL', 'adminURL', 'internalURL'],
759 help="The endpoint type to use for the data processing "
760 "service."),
761]
762
763
764data_processing_feature_group = cfg.OptGroup(
765 name="data_processing-feature-enabled",
766 title="Enabled Data Processing features")
767
768DataProcessingFeaturesGroup = [
769 cfg.ListOpt('plugins',
770 default=["vanilla", "hdp"],
771 help="List of enabled data processing plugins")
772]
773
774
775boto_group = cfg.OptGroup(name='boto',
776 title='EC2/S3 options')
777BotoGroup = [
778 cfg.StrOpt('ec2_url',
779 default="http://localhost:8773/services/Cloud",
780 help="EC2 URL"),
781 cfg.StrOpt('s3_url',
782 default="http://localhost:8080",
783 help="S3 URL"),
784 cfg.StrOpt('aws_secret',
785 help="AWS Secret Key",
786 secret=True),
787 cfg.StrOpt('aws_access',
788 help="AWS Access Key"),
789 cfg.StrOpt('aws_zone',
790 default="nova",
791 help="AWS Zone for EC2 tests"),
792 cfg.StrOpt('s3_materials_path',
793 default="/opt/stack/devstack/files/images/"
794 "s3-materials/cirros-0.3.0",
795 help="S3 Materials Path"),
796 cfg.StrOpt('ari_manifest',
797 default="cirros-0.3.0-x86_64-initrd.manifest.xml",
798 help="ARI Ramdisk Image manifest"),
799 cfg.StrOpt('ami_manifest',
800 default="cirros-0.3.0-x86_64-blank.img.manifest.xml",
801 help="AMI Machine Image manifest"),
802 cfg.StrOpt('aki_manifest',
803 default="cirros-0.3.0-x86_64-vmlinuz.manifest.xml",
804 help="AKI Kernel Image manifest"),
805 cfg.StrOpt('instance_type',
806 default="m1.tiny",
807 help="Instance type"),
808 cfg.IntOpt('http_socket_timeout',
809 default=3,
810 help="boto Http socket timeout"),
811 cfg.IntOpt('num_retries',
812 default=1,
813 help="boto num_retries on error"),
814 cfg.IntOpt('build_timeout',
815 default=60,
816 help="Status Change Timeout"),
817 cfg.IntOpt('build_interval',
818 default=1,
819 help="Status Change Test Interval"),
820]
821
822stress_group = cfg.OptGroup(name='stress', title='Stress Test Options')
823
824StressGroup = [
825 cfg.StrOpt('nova_logdir',
826 help='Directory containing log files on the compute nodes'),
827 cfg.IntOpt('max_instances',
828 default=16,
829 help='Maximum number of instances to create during test.'),
830 cfg.StrOpt('controller',
831 help='Controller host.'),
832 # new stress options
833 cfg.StrOpt('target_controller',
834 help='Controller host.'),
835 cfg.StrOpt('target_ssh_user',
836 help='ssh user.'),
837 cfg.StrOpt('target_private_key_path',
838 help='Path to private key.'),
839 cfg.StrOpt('target_logfiles',
840 help='regexp for list of log files.'),
841 cfg.IntOpt('log_check_interval',
842 default=60,
843 help='time (in seconds) between log file error checks.'),
844 cfg.IntOpt('default_thread_number_per_action',
845 default=4,
846 help='The number of threads created while stress test.'),
847 cfg.BoolOpt('leave_dirty_stack',
848 default=False,
849 help='Prevent the cleaning (tearDownClass()) between'
850 ' each stress test run if an exception occurs'
851 ' during this run.'),
852 cfg.BoolOpt('full_clean_stack',
853 default=False,
854 help='Allows a full cleaning process after a stress test.'
855 ' Caution : this cleanup will remove every objects of'
856 ' every tenant.')
857]
858
859
860scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options')
861
862ScenarioGroup = [
863 cfg.StrOpt('img_dir',
864 default='/opt/stack/new/devstack/files/images/'
865 'cirros-0.3.1-x86_64-uec',
866 help='Directory containing image files'),
867 cfg.StrOpt('img_file', deprecated_name='qcow2_img_file',
868 default='cirros-0.3.1-x86_64-disk.img',
869 help='Image file name'),
870 cfg.StrOpt('img_disk_format',
871 default='qcow2',
872 help='Image disk format'),
873 cfg.StrOpt('img_container_format',
874 default='bare',
875 help='Image container format'),
876 cfg.StrOpt('ami_img_file',
877 default='cirros-0.3.1-x86_64-blank.img',
878 help='AMI image file name'),
879 cfg.StrOpt('ari_img_file',
880 default='cirros-0.3.1-x86_64-initrd',
881 help='ARI image file name'),
882 cfg.StrOpt('aki_img_file',
883 default='cirros-0.3.1-x86_64-vmlinuz',
884 help='AKI image file name'),
885 cfg.StrOpt('ssh_user',
886 default='cirros',
887 help='ssh username for the image file'),
888 cfg.IntOpt(
889 'large_ops_number',
890 default=0,
891 help="specifies how many resources to request at once. Used "
892 "for large operations testing."),
893 # TODO(yfried): add support for dhcpcd
894 cfg.StrOpt('dhcp_client',
895 default='udhcpc',
896 choices=["udhcpc", "dhclient"],
897 help='DHCP client used by images to renew DCHP lease. '
898 'If left empty, update operation will be skipped. '
899 'Supported clients: "udhcpc", "dhclient"')
900]
901
902
903service_available_group = cfg.OptGroup(name="service_available",
904 title="Available OpenStack Services")
905
906ServiceAvailableGroup = [
907 cfg.BoolOpt('cinder',
908 default=True,
909 help="Whether or not cinder is expected to be available"),
910 cfg.BoolOpt('neutron',
911 default=False,
912 help="Whether or not neutron is expected to be available"),
913 cfg.BoolOpt('glance',
914 default=True,
915 help="Whether or not glance is expected to be available"),
916 cfg.BoolOpt('swift',
917 default=True,
918 help="Whether or not swift is expected to be available"),
919 cfg.BoolOpt('nova',
920 default=True,
921 help="Whether or not nova is expected to be available"),
922 cfg.BoolOpt('heat',
923 default=False,
924 help="Whether or not Heat is expected to be available"),
925 cfg.BoolOpt('ceilometer',
926 default=True,
927 help="Whether or not Ceilometer is expected to be available"),
928 cfg.BoolOpt('horizon',
929 default=True,
930 help="Whether or not Horizon is expected to be available"),
931 cfg.BoolOpt('sahara',
932 default=False,
933 help="Whether or not Sahara is expected to be available"),
934 cfg.BoolOpt('ironic',
935 default=False,
936 help="Whether or not Ironic is expected to be available"),
937 cfg.BoolOpt('trove',
938 default=False,
939 help="Whether or not Trove is expected to be available"),
940 cfg.BoolOpt('zaqar',
941 default=False,
942 help="Whether or not Zaqar is expected to be available"),
943]
944
945debug_group = cfg.OptGroup(name="debug",
946 title="Debug System")
947
948DebugGroup = [
949 cfg.StrOpt('trace_requests',
950 default='',
951 help="""A regex to determine which requests should be traced.
952
953This is a regex to match the caller for rest client requests to be able to
954selectively trace calls out of specific classes and methods. It largely
955exists for test development, and is not expected to be used in a real deploy
956of tempest. This will be matched against the discovered ClassName:method
957in the test environment.
958
959Expected values for this field are:
960
961 * ClassName:test_method_name - traces one test_method
962 * ClassName:setUp(Class) - traces specific setup functions
963 * ClassName:tearDown(Class) - traces specific teardown functions
964 * ClassName:_run_cleanups - traces the cleanup functions
965
966If nothing is specified, this feature is not enabled. To trace everything
967specify .* as the regex.
968""")
969]
970
971input_scenario_group = cfg.OptGroup(name="input-scenario",
972 title="Filters and values for"
973 " input scenarios")
974
975InputScenarioGroup = [
976 cfg.StrOpt('image_regex',
977 default='^cirros-0.3.1-x86_64-uec$',
978 help="Matching images become parameters for scenario tests"),
979 cfg.StrOpt('flavor_regex',
980 default='^m1.nano$',
981 help="Matching flavors become parameters for scenario tests"),
982 cfg.StrOpt('non_ssh_image_regex',
983 default='^.*[Ww]in.*$',
984 help="SSH verification in tests is skipped"
985 "for matching images"),
986 cfg.StrOpt('ssh_user_regex',
987 default="[[\"^.*[Cc]irros.*$\", \"root\"]]",
988 help="List of user mapped to regex "
989 "to matching image names."),
990]
991
992
993baremetal_group = cfg.OptGroup(name='baremetal',
994 title='Baremetal provisioning service options',
995 help='When enabling baremetal tests, Nova '
996 'must be configured to use the Ironic '
997 'driver. The following paremeters for the '
998 '[compute] section must be disabled: '
999 'console_output, interface_attach, '
1000 'live_migration, pause, rescue, resize '
1001 'shelve, snapshot, and suspend')
1002
1003BaremetalGroup = [
1004 cfg.StrOpt('catalog_type',
1005 default='baremetal',
1006 help="Catalog type of the baremetal provisioning service"),
1007 cfg.BoolOpt('driver_enabled',
1008 default=False,
1009 help="Whether the Ironic nova-compute driver is enabled"),
1010 cfg.StrOpt('driver',
1011 default='fake',
1012 help="Driver name which Ironic uses"),
1013 cfg.StrOpt('endpoint_type',
1014 default='publicURL',
1015 choices=['public', 'admin', 'internal',
1016 'publicURL', 'adminURL', 'internalURL'],
1017 help="The endpoint type to use for the baremetal provisioning "
1018 "service"),
1019 cfg.IntOpt('active_timeout',
1020 default=300,
1021 help="Timeout for Ironic node to completely provision"),
1022 cfg.IntOpt('association_timeout',
1023 default=30,
1024 help="Timeout for association of Nova instance and Ironic "
1025 "node"),
1026 cfg.IntOpt('power_timeout',
1027 default=60,
1028 help="Timeout for Ironic power transitions."),
1029 cfg.IntOpt('unprovision_timeout',
1030 default=60,
1031 help="Timeout for unprovisioning an Ironic node.")
1032]
1033
1034cli_group = cfg.OptGroup(name='cli', title="cli Configuration Options")
1035
1036CLIGroup = [
1037 cfg.BoolOpt('enabled',
1038 default=True,
1039 help="enable cli tests"),
1040 cfg.StrOpt('cli_dir',
1041 default='/usr/local/bin',
1042 help="directory where python client binaries are located"),
1043 cfg.BoolOpt('has_manage',
1044 default=True,
1045 help=("Whether the tempest run location has access to the "
1046 "*-manage commands. In a pure blackbox environment "
1047 "it will not.")),
1048 cfg.IntOpt('timeout',
1049 default=15,
1050 help="Number of seconds to wait on a CLI timeout"),
1051]
1052
1053negative_group = cfg.OptGroup(name='negative', title="Negative Test Options")
1054
1055NegativeGroup = [
1056 cfg.StrOpt('test_generator',
1057 default='tempest.common.' +
1058 'generator.negative_generator.NegativeTestGenerator',
1059 help="Test generator class for all negative tests"),
1060]
1061
1062_opts = [
1063 (auth_group, AuthGroup),
1064 (compute_group, ComputeGroup),
1065 (compute_features_group, ComputeFeaturesGroup),
1066 (identity_group, IdentityGroup),
1067 (identity_feature_group, IdentityFeatureGroup),
1068 (image_group, ImageGroup),
1069 (image_feature_group, ImageFeaturesGroup),
1070 (network_group, NetworkGroup),
1071 (network_feature_group, NetworkFeaturesGroup),
1072 (messaging_group, MessagingGroup),
1073 (volume_group, VolumeGroup),
1074 (volume_feature_group, VolumeFeaturesGroup),
1075 (object_storage_group, ObjectStoreGroup),
1076 (object_storage_feature_group, ObjectStoreFeaturesGroup),
1077 (database_group, DatabaseGroup),
1078 (orchestration_group, OrchestrationGroup),
1079 (telemetry_group, TelemetryGroup),
1080 (dashboard_group, DashboardGroup),
1081 (data_processing_group, DataProcessingGroup),
1082 (data_processing_feature_group, DataProcessingFeaturesGroup),
1083 (boto_group, BotoGroup),
1084 (stress_group, StressGroup),
1085 (scenario_group, ScenarioGroup),
1086 (service_available_group, ServiceAvailableGroup),
1087 (debug_group, DebugGroup),
1088 (baremetal_group, BaremetalGroup),
1089 (input_scenario_group, InputScenarioGroup),
1090 (cli_group, CLIGroup),
1091 (negative_group, NegativeGroup)
1092]
1093
1094
1095def register_opts():
1096 for g, o in _opts:
1097 register_opt_group(cfg.CONF, g, o)
1098
1099
1100def list_opts():
1101 """Return a list of oslo.config options available.
1102
1103 The purpose of this is to allow tools like the Oslo sample config file
1104 generator to discover the options exposed to users.
1105 """
Maru Newby5690a352015-03-13 18:46:40 +00001106 return [(g.name, o) for g, o in _opts]
Maru Newbyb096d9f2015-03-09 18:54:54 +00001107
1108
1109# this should never be called outside of this class
1110class TempestConfigPrivate(object):
1111 """Provides OpenStack configuration information."""
1112
1113 DEFAULT_CONFIG_DIR = os.path.join(
1114 os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
1115 "etc")
1116
1117 DEFAULT_CONFIG_FILE = "tempest.conf"
1118
1119 def __getattr__(self, attr):
1120 # Handles config options from the default group
1121 return getattr(cfg.CONF, attr)
1122
1123 def _set_attrs(self):
1124 self.auth = cfg.CONF.auth
1125 self.compute = cfg.CONF.compute
1126 self.compute_feature_enabled = cfg.CONF['compute-feature-enabled']
1127 self.identity = cfg.CONF.identity
1128 self.identity_feature_enabled = cfg.CONF['identity-feature-enabled']
1129 self.image = cfg.CONF.image
1130 self.image_feature_enabled = cfg.CONF['image-feature-enabled']
1131 self.network = cfg.CONF.network
1132 self.network_feature_enabled = cfg.CONF['network-feature-enabled']
1133 self.volume = cfg.CONF.volume
1134 self.volume_feature_enabled = cfg.CONF['volume-feature-enabled']
1135 self.object_storage = cfg.CONF['object-storage']
1136 self.object_storage_feature_enabled = cfg.CONF[
1137 'object-storage-feature-enabled']
1138 self.database = cfg.CONF.database
1139 self.orchestration = cfg.CONF.orchestration
1140 self.messaging = cfg.CONF.messaging
1141 self.telemetry = cfg.CONF.telemetry
1142 self.dashboard = cfg.CONF.dashboard
1143 self.data_processing = cfg.CONF.data_processing
1144 self.data_processing_feature_enabled = cfg.CONF[
1145 'data_processing-feature-enabled']
1146 self.boto = cfg.CONF.boto
1147 self.stress = cfg.CONF.stress
1148 self.scenario = cfg.CONF.scenario
1149 self.service_available = cfg.CONF.service_available
1150 self.debug = cfg.CONF.debug
1151 self.baremetal = cfg.CONF.baremetal
1152 self.input_scenario = cfg.CONF['input-scenario']
1153 self.cli = cfg.CONF.cli
1154 self.negative = cfg.CONF.negative
Assaf Muller95716a02016-01-04 20:30:43 -05001155
1156 self.identity.admin_username = self.auth.admin_username
1157 self.identity.admin_password = self.auth.admin_password
1158 self.identity.admin_tenant_name = self.auth.admin_tenant_name
1159 self.identity.admin_domain_name = self.auth.admin_domain_name
1160 self.identity.password = self.auth.admin_password
1161 self.identity.tenant_name = 'demo'
1162 self.identity.username = 'demo'
1163 self.identity.alt_username = 'alt_demo'
1164 self.identity.alt_tenant_name = 'alt_demo'
1165 self.identity.alt_password = self.auth.admin_password
1166
Maru Newbyb096d9f2015-03-09 18:54:54 +00001167 cfg.CONF.set_default('domain_name', self.identity.admin_domain_name,
1168 group='identity')
1169 cfg.CONF.set_default('alt_domain_name',
1170 self.identity.admin_domain_name,
1171 group='identity')
1172
1173 def __init__(self, parse_conf=True, config_path=None):
1174 """Initialize a configuration from a conf directory and conf file."""
1175 super(TempestConfigPrivate, self).__init__()
1176 config_files = []
1177 failsafe_path = "/etc/tempest/" + self.DEFAULT_CONFIG_FILE
1178
1179 if config_path:
1180 path = config_path
1181 else:
1182 # Environment variables override defaults...
1183 conf_dir = os.environ.get('TEMPEST_CONFIG_DIR',
1184 self.DEFAULT_CONFIG_DIR)
1185 conf_file = os.environ.get('TEMPEST_CONFIG',
1186 self.DEFAULT_CONFIG_FILE)
1187
1188 path = os.path.join(conf_dir, conf_file)
1189
1190 if not os.path.isfile(path):
1191 path = failsafe_path
1192
1193 # only parse the config file if we expect one to exist. This is needed
1194 # to remove an issue with the config file up to date checker.
1195 if parse_conf:
1196 config_files.append(path)
Maru Newby5690a352015-03-13 18:46:40 +00001197 logging.register_options(cfg.CONF)
Maru Newbyb096d9f2015-03-09 18:54:54 +00001198 if os.path.isfile(path):
1199 cfg.CONF([], project='tempest', default_config_files=config_files)
1200 else:
1201 cfg.CONF([], project='tempest')
Ihar Hrachyshkac695f9f2015-02-26 23:26:41 +01001202 logging.setup(cfg.CONF, 'tempest')
Maru Newbyb096d9f2015-03-09 18:54:54 +00001203 LOG = logging.getLogger('tempest')
1204 LOG.info("Using tempest config file %s" % path)
1205 register_opts()
1206 self._set_attrs()
1207 if parse_conf:
Sergey Vilgelm8bf2b792015-08-10 15:46:27 +03001208 cfg.CONF.log_opt_values(LOG, logging.DEBUG)
Maru Newbyb096d9f2015-03-09 18:54:54 +00001209
1210
1211class TempestConfigProxy(object):
1212 _config = None
1213 _path = None
1214
1215 _extra_log_defaults = [
Sergey Vilgelm8bf2b792015-08-10 15:46:27 +03001216 ('keystoneclient.session', logging.INFO),
1217 ('paramiko.transport', logging.INFO),
1218 ('requests.packages.urllib3.connectionpool', logging.WARN),
Maru Newbyb096d9f2015-03-09 18:54:54 +00001219 ]
1220
1221 def _fix_log_levels(self):
1222 """Tweak the oslo log defaults."""
Maru Newby5690a352015-03-13 18:46:40 +00001223 for name, level in self._extra_log_defaults:
Sergey Vilgelm8bf2b792015-08-10 15:46:27 +03001224 logging.getLogger(name).logger.setLevel(level)
Maru Newbyb096d9f2015-03-09 18:54:54 +00001225
1226 def __getattr__(self, attr):
1227 if not self._config:
1228 self._fix_log_levels()
1229 self._config = TempestConfigPrivate(config_path=self._path)
1230
1231 return getattr(self._config, attr)
1232
1233 def set_config_path(self, path):
1234 self._path = path
1235
1236
1237CONF = TempestConfigProxy()