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