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