blob: 256d687dd8de67ca50f4f5dd4e5ebd474befbac5 [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',
Maru Newbyb096d9f2015-03-09 18:54:54 +000076 help='Specify a CA bundle file to use in verifying a '
77 'TLS (https) server certificate.'),
78 cfg.StrOpt('uri',
79 help="Full URI of the OpenStack Identity API (Keystone), v2"),
80 cfg.StrOpt('uri_v3',
81 help='Full URI of the OpenStack Identity API (Keystone), v3'),
82 cfg.StrOpt('auth_version',
83 default='v2',
84 help="Identity API version to be used for authentication "
85 "for API tests."),
86 cfg.StrOpt('region',
87 default='RegionOne',
88 help="The identity region name to use. Also used as the other "
89 "services' region name unless they are set explicitly. "
90 "If no such region is found in the service catalog, the "
91 "first found one is used."),
92 cfg.StrOpt('endpoint_type',
93 default='publicURL',
94 choices=['public', 'admin', 'internal',
95 'publicURL', 'adminURL', 'internalURL'],
96 help="The endpoint type to use for the identity service."),
97 cfg.StrOpt('username',
98 help="Username to use for Nova API requests."),
99 cfg.StrOpt('tenant_name',
100 help="Tenant name to use for Nova API requests."),
101 cfg.StrOpt('admin_role',
102 default='admin',
103 help="Role required to administrate keystone."),
104 cfg.StrOpt('password',
105 help="API key to use when authenticating.",
106 secret=True),
107 cfg.StrOpt('domain_name',
108 help="Domain name for authentication (Keystone V3)."
109 "The same domain applies to user and project"),
110 cfg.StrOpt('alt_username',
111 help="Username of alternate user to use for Nova API "
112 "requests."),
113 cfg.StrOpt('alt_tenant_name',
114 help="Alternate user's Tenant name to use for Nova API "
115 "requests."),
116 cfg.StrOpt('alt_password',
117 help="API key to use when authenticating as alternate user.",
118 secret=True),
119 cfg.StrOpt('alt_domain_name',
120 help="Alternate domain name for authentication (Keystone V3)."
121 "The same domain applies to user and project"),
122 cfg.StrOpt('admin_username',
123 help="Administrative Username to use for "
124 "Keystone API requests."),
125 cfg.StrOpt('admin_tenant_name',
126 help="Administrative Tenant name to use for Keystone API "
127 "requests."),
128 cfg.StrOpt('admin_password',
129 help="API key to use when authenticating as admin.",
130 secret=True),
131 cfg.StrOpt('admin_domain_name',
132 help="Admin domain name for authentication (Keystone V3)."
133 "The same domain applies to user and project"),
134]
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 ),
482]
483
484messaging_group = cfg.OptGroup(name='messaging',
485 title='Messaging Service')
486
487MessagingGroup = [
488 cfg.StrOpt('catalog_type',
489 default='messaging',
490 help='Catalog type of the Messaging service.'),
491 cfg.IntOpt('max_queues_per_page',
492 default=20,
493 help='The maximum number of queue records per page when '
494 'listing queues'),
495 cfg.IntOpt('max_queue_metadata',
496 default=65536,
497 help='The maximum metadata size for a queue'),
498 cfg.IntOpt('max_messages_per_page',
499 default=20,
500 help='The maximum number of queue message per page when '
501 'listing (or) posting messages'),
502 cfg.IntOpt('max_message_size',
503 default=262144,
504 help='The maximum size of a message body'),
505 cfg.IntOpt('max_messages_per_claim',
506 default=20,
507 help='The maximum number of messages per claim'),
508 cfg.IntOpt('max_message_ttl',
509 default=1209600,
510 help='The maximum ttl for a message'),
511 cfg.IntOpt('max_claim_ttl',
512 default=43200,
513 help='The maximum ttl for a claim'),
514 cfg.IntOpt('max_claim_grace',
515 default=43200,
516 help='The maximum grace period for a claim'),
517]
518
519volume_group = cfg.OptGroup(name='volume',
520 title='Block Storage Options')
521
522VolumeGroup = [
523 cfg.IntOpt('build_interval',
524 default=1,
525 help='Time in seconds between volume availability checks.'),
526 cfg.IntOpt('build_timeout',
527 default=300,
528 help='Timeout in seconds to wait for a volume to become '
529 'available.'),
530 cfg.StrOpt('catalog_type',
531 default='volume',
532 help="Catalog type of the Volume Service"),
533 cfg.StrOpt('region',
534 default='',
535 help="The volume region name to use. If empty, the value "
536 "of identity.region is used instead. If no such region "
537 "is found in the service catalog, the first found one is "
538 "used."),
539 cfg.StrOpt('endpoint_type',
540 default='publicURL',
541 choices=['public', 'admin', 'internal',
542 'publicURL', 'adminURL', 'internalURL'],
543 help="The endpoint type to use for the volume service."),
544 cfg.StrOpt('backend1_name',
545 default='BACKEND_1',
546 help="Name of the backend1 (must be declared in cinder.conf)"),
547 cfg.StrOpt('backend2_name',
548 default='BACKEND_2',
549 help="Name of the backend2 (must be declared in cinder.conf)"),
550 cfg.StrOpt('storage_protocol',
551 default='iSCSI',
552 help='Backend protocol to target when creating volume types'),
553 cfg.StrOpt('vendor_name',
554 default='Open Source',
555 help='Backend vendor to target when creating volume types'),
556 cfg.StrOpt('disk_format',
557 default='raw',
558 help='Disk format to use when copying a volume to image'),
559 cfg.IntOpt('volume_size',
560 default=1,
561 help='Default size in GB for volumes created by volumes tests'),
562]
563
564volume_feature_group = cfg.OptGroup(name='volume-feature-enabled',
565 title='Enabled Cinder Features')
566
567VolumeFeaturesGroup = [
568 cfg.BoolOpt('multi_backend',
569 default=False,
570 help="Runs Cinder multi-backend test (requires 2 backends)"),
571 cfg.BoolOpt('backup',
572 default=True,
573 help='Runs Cinder volumes backup test'),
574 cfg.BoolOpt('snapshot',
575 default=True,
576 help='Runs Cinder volume snapshot test'),
577 cfg.ListOpt('api_extensions',
578 default=['all'],
579 help='A list of enabled volume extensions with a special '
580 'entry all which indicates every extension is enabled. '
581 'Empty list indicates all extensions are disabled'),
582 cfg.BoolOpt('api_v1',
583 default=True,
584 help="Is the v1 volume API enabled"),
585 cfg.BoolOpt('api_v2',
586 default=True,
587 help="Is the v2 volume API enabled"),
588]
589
590
591object_storage_group = cfg.OptGroup(name='object-storage',
592 title='Object Storage Service Options')
593
594ObjectStoreGroup = [
595 cfg.StrOpt('catalog_type',
596 default='object-store',
597 help="Catalog type of the Object-Storage service."),
598 cfg.StrOpt('region',
599 default='',
600 help="The object-storage region name to use. If empty, the "
601 "value of identity.region is used instead. If no such "
602 "region is found in the service catalog, the first found "
603 "one is used."),
604 cfg.StrOpt('endpoint_type',
605 default='publicURL',
606 choices=['public', 'admin', 'internal',
607 'publicURL', 'adminURL', 'internalURL'],
608 help="The endpoint type to use for the object-store service."),
609 cfg.IntOpt('container_sync_timeout',
610 default=600,
611 help="Number of seconds to time on waiting for a container "
612 "to container synchronization complete."),
613 cfg.IntOpt('container_sync_interval',
614 default=5,
615 help="Number of seconds to wait while looping to check the "
616 "status of a container to container synchronization"),
617 cfg.StrOpt('operator_role',
618 default='Member',
619 help="Role to add to users created for swift tests to "
620 "enable creating containers"),
621 cfg.StrOpt('reseller_admin_role',
622 default='ResellerAdmin',
623 help="User role that has reseller admin"),
624 cfg.StrOpt('realm_name',
625 default='realm1',
626 help="Name of sync realm. A sync realm is a set of clusters "
627 "that have agreed to allow container syncing with each "
628 "other. Set the same realm name as Swift's "
629 "container-sync-realms.conf"),
630 cfg.StrOpt('cluster_name',
631 default='name1',
632 help="One name of cluster which is set in the realm whose name "
633 "is set in 'realm_name' item in this file. Set the "
634 "same cluster name as Swift's container-sync-realms.conf"),
635]
636
637object_storage_feature_group = cfg.OptGroup(
638 name='object-storage-feature-enabled',
639 title='Enabled object-storage features')
640
641ObjectStoreFeaturesGroup = [
642 cfg.ListOpt('discoverable_apis',
643 default=['all'],
644 help="A list of the enabled optional discoverable apis. "
645 "A single entry, all, indicates that all of these "
646 "features are expected to be enabled"),
647 cfg.BoolOpt('container_sync',
648 default=True,
649 help="Execute (old style) container-sync tests"),
650 cfg.BoolOpt('object_versioning',
651 default=True,
652 help="Execute object-versioning tests"),
653 cfg.BoolOpt('discoverability',
654 default=True,
655 help="Execute discoverability tests"),
656]
657
658database_group = cfg.OptGroup(name='database',
659 title='Database Service Options')
660
661DatabaseGroup = [
662 cfg.StrOpt('catalog_type',
663 default='database',
664 help="Catalog type of the Database service."),
665 cfg.StrOpt('db_flavor_ref',
666 default="1",
667 help="Valid primary flavor to use in database tests."),
668 cfg.StrOpt('db_current_version',
669 default="v1.0",
670 help="Current database version to use in database tests."),
671]
672
673orchestration_group = cfg.OptGroup(name='orchestration',
674 title='Orchestration Service Options')
675
676OrchestrationGroup = [
677 cfg.StrOpt('catalog_type',
678 default='orchestration',
679 help="Catalog type of the Orchestration service."),
680 cfg.StrOpt('region',
681 default='',
682 help="The orchestration region name to use. If empty, the "
683 "value of identity.region is used instead. If no such "
684 "region is found in the service catalog, the first found "
685 "one is used."),
686 cfg.StrOpt('endpoint_type',
687 default='publicURL',
688 choices=['public', 'admin', 'internal',
689 'publicURL', 'adminURL', 'internalURL'],
690 help="The endpoint type to use for the orchestration service."),
691 cfg.IntOpt('build_interval',
692 default=1,
693 help="Time in seconds between build status checks."),
694 cfg.IntOpt('build_timeout',
695 default=1200,
696 help="Timeout in seconds to wait for a stack to build."),
697 cfg.StrOpt('instance_type',
698 default='m1.micro',
699 help="Instance type for tests. Needs to be big enough for a "
700 "full OS plus the test workload"),
Maru Newbyb096d9f2015-03-09 18:54:54 +0000701 cfg.StrOpt('keypair_name',
702 help="Name of existing keypair to launch servers with."),
703 cfg.IntOpt('max_template_size',
704 default=524288,
705 help="Value must match heat configuration of the same name."),
706 cfg.IntOpt('max_resources_per_stack',
707 default=1000,
708 help="Value must match heat configuration of the same name."),
709]
710
711
712telemetry_group = cfg.OptGroup(name='telemetry',
713 title='Telemetry Service Options')
714
715TelemetryGroup = [
716 cfg.StrOpt('catalog_type',
717 default='metering',
718 help="Catalog type of the Telemetry service."),
719 cfg.StrOpt('endpoint_type',
720 default='publicURL',
721 choices=['public', 'admin', 'internal',
722 'publicURL', 'adminURL', 'internalURL'],
723 help="The endpoint type to use for the telemetry service."),
724 cfg.BoolOpt('too_slow_to_test',
725 default=True,
726 help="This variable is used as flag to enable "
727 "notification tests")
728]
729
730
731dashboard_group = cfg.OptGroup(name="dashboard",
732 title="Dashboard options")
733
734DashboardGroup = [
735 cfg.StrOpt('dashboard_url',
736 default='http://localhost/',
737 help="Where the dashboard can be found"),
738 cfg.StrOpt('login_url',
739 default='http://localhost/auth/login/',
740 help="Login page for the dashboard"),
741]
742
743
744data_processing_group = cfg.OptGroup(name="data_processing",
745 title="Data Processing options")
746
747DataProcessingGroup = [
748 cfg.StrOpt('catalog_type',
749 default='data_processing',
750 help="Catalog type of the data processing service."),
751 cfg.StrOpt('endpoint_type',
752 default='publicURL',
753 choices=['public', 'admin', 'internal',
754 'publicURL', 'adminURL', 'internalURL'],
755 help="The endpoint type to use for the data processing "
756 "service."),
757]
758
759
760data_processing_feature_group = cfg.OptGroup(
761 name="data_processing-feature-enabled",
762 title="Enabled Data Processing features")
763
764DataProcessingFeaturesGroup = [
765 cfg.ListOpt('plugins',
766 default=["vanilla", "hdp"],
767 help="List of enabled data processing plugins")
768]
769
770
771boto_group = cfg.OptGroup(name='boto',
772 title='EC2/S3 options')
773BotoGroup = [
774 cfg.StrOpt('ec2_url',
775 default="http://localhost:8773/services/Cloud",
776 help="EC2 URL"),
777 cfg.StrOpt('s3_url',
778 default="http://localhost:8080",
779 help="S3 URL"),
780 cfg.StrOpt('aws_secret',
781 help="AWS Secret Key",
782 secret=True),
783 cfg.StrOpt('aws_access',
784 help="AWS Access Key"),
785 cfg.StrOpt('aws_zone',
786 default="nova",
787 help="AWS Zone for EC2 tests"),
788 cfg.StrOpt('s3_materials_path',
789 default="/opt/stack/devstack/files/images/"
790 "s3-materials/cirros-0.3.0",
791 help="S3 Materials Path"),
792 cfg.StrOpt('ari_manifest',
793 default="cirros-0.3.0-x86_64-initrd.manifest.xml",
794 help="ARI Ramdisk Image manifest"),
795 cfg.StrOpt('ami_manifest',
796 default="cirros-0.3.0-x86_64-blank.img.manifest.xml",
797 help="AMI Machine Image manifest"),
798 cfg.StrOpt('aki_manifest',
799 default="cirros-0.3.0-x86_64-vmlinuz.manifest.xml",
800 help="AKI Kernel Image manifest"),
801 cfg.StrOpt('instance_type',
802 default="m1.tiny",
803 help="Instance type"),
804 cfg.IntOpt('http_socket_timeout',
805 default=3,
806 help="boto Http socket timeout"),
807 cfg.IntOpt('num_retries',
808 default=1,
809 help="boto num_retries on error"),
810 cfg.IntOpt('build_timeout',
811 default=60,
812 help="Status Change Timeout"),
813 cfg.IntOpt('build_interval',
814 default=1,
815 help="Status Change Test Interval"),
816]
817
818stress_group = cfg.OptGroup(name='stress', title='Stress Test Options')
819
820StressGroup = [
821 cfg.StrOpt('nova_logdir',
822 help='Directory containing log files on the compute nodes'),
823 cfg.IntOpt('max_instances',
824 default=16,
825 help='Maximum number of instances to create during test.'),
826 cfg.StrOpt('controller',
827 help='Controller host.'),
828 # new stress options
829 cfg.StrOpt('target_controller',
830 help='Controller host.'),
831 cfg.StrOpt('target_ssh_user',
832 help='ssh user.'),
833 cfg.StrOpt('target_private_key_path',
834 help='Path to private key.'),
835 cfg.StrOpt('target_logfiles',
836 help='regexp for list of log files.'),
837 cfg.IntOpt('log_check_interval',
838 default=60,
839 help='time (in seconds) between log file error checks.'),
840 cfg.IntOpt('default_thread_number_per_action',
841 default=4,
842 help='The number of threads created while stress test.'),
843 cfg.BoolOpt('leave_dirty_stack',
844 default=False,
845 help='Prevent the cleaning (tearDownClass()) between'
846 ' each stress test run if an exception occurs'
847 ' during this run.'),
848 cfg.BoolOpt('full_clean_stack',
849 default=False,
850 help='Allows a full cleaning process after a stress test.'
851 ' Caution : this cleanup will remove every objects of'
852 ' every tenant.')
853]
854
855
856scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options')
857
858ScenarioGroup = [
859 cfg.StrOpt('img_dir',
860 default='/opt/stack/new/devstack/files/images/'
861 'cirros-0.3.1-x86_64-uec',
862 help='Directory containing image files'),
863 cfg.StrOpt('img_file', deprecated_name='qcow2_img_file',
864 default='cirros-0.3.1-x86_64-disk.img',
865 help='Image file name'),
866 cfg.StrOpt('img_disk_format',
867 default='qcow2',
868 help='Image disk format'),
869 cfg.StrOpt('img_container_format',
870 default='bare',
871 help='Image container format'),
872 cfg.StrOpt('ami_img_file',
873 default='cirros-0.3.1-x86_64-blank.img',
874 help='AMI image file name'),
875 cfg.StrOpt('ari_img_file',
876 default='cirros-0.3.1-x86_64-initrd',
877 help='ARI image file name'),
878 cfg.StrOpt('aki_img_file',
879 default='cirros-0.3.1-x86_64-vmlinuz',
880 help='AKI image file name'),
881 cfg.StrOpt('ssh_user',
882 default='cirros',
883 help='ssh username for the image file'),
884 cfg.IntOpt(
885 'large_ops_number',
886 default=0,
887 help="specifies how many resources to request at once. Used "
888 "for large operations testing."),
889 # TODO(yfried): add support for dhcpcd
890 cfg.StrOpt('dhcp_client',
891 default='udhcpc',
892 choices=["udhcpc", "dhclient"],
893 help='DHCP client used by images to renew DCHP lease. '
894 'If left empty, update operation will be skipped. '
895 'Supported clients: "udhcpc", "dhclient"')
896]
897
898
899service_available_group = cfg.OptGroup(name="service_available",
900 title="Available OpenStack Services")
901
902ServiceAvailableGroup = [
903 cfg.BoolOpt('cinder',
904 default=True,
905 help="Whether or not cinder is expected to be available"),
906 cfg.BoolOpt('neutron',
907 default=False,
908 help="Whether or not neutron is expected to be available"),
909 cfg.BoolOpt('glance',
910 default=True,
911 help="Whether or not glance is expected to be available"),
912 cfg.BoolOpt('swift',
913 default=True,
914 help="Whether or not swift is expected to be available"),
915 cfg.BoolOpt('nova',
916 default=True,
917 help="Whether or not nova is expected to be available"),
918 cfg.BoolOpt('heat',
919 default=False,
920 help="Whether or not Heat is expected to be available"),
921 cfg.BoolOpt('ceilometer',
922 default=True,
923 help="Whether or not Ceilometer is expected to be available"),
924 cfg.BoolOpt('horizon',
925 default=True,
926 help="Whether or not Horizon is expected to be available"),
927 cfg.BoolOpt('sahara',
928 default=False,
929 help="Whether or not Sahara is expected to be available"),
930 cfg.BoolOpt('ironic',
931 default=False,
932 help="Whether or not Ironic is expected to be available"),
933 cfg.BoolOpt('trove',
934 default=False,
935 help="Whether or not Trove is expected to be available"),
936 cfg.BoolOpt('zaqar',
937 default=False,
938 help="Whether or not Zaqar is expected to be available"),
939]
940
941debug_group = cfg.OptGroup(name="debug",
942 title="Debug System")
943
944DebugGroup = [
945 cfg.StrOpt('trace_requests',
946 default='',
947 help="""A regex to determine which requests should be traced.
948
949This is a regex to match the caller for rest client requests to be able to
950selectively trace calls out of specific classes and methods. It largely
951exists for test development, and is not expected to be used in a real deploy
952of tempest. This will be matched against the discovered ClassName:method
953in the test environment.
954
955Expected values for this field are:
956
957 * ClassName:test_method_name - traces one test_method
958 * ClassName:setUp(Class) - traces specific setup functions
959 * ClassName:tearDown(Class) - traces specific teardown functions
960 * ClassName:_run_cleanups - traces the cleanup functions
961
962If nothing is specified, this feature is not enabled. To trace everything
963specify .* as the regex.
964""")
965]
966
967input_scenario_group = cfg.OptGroup(name="input-scenario",
968 title="Filters and values for"
969 " input scenarios")
970
971InputScenarioGroup = [
972 cfg.StrOpt('image_regex',
973 default='^cirros-0.3.1-x86_64-uec$',
974 help="Matching images become parameters for scenario tests"),
975 cfg.StrOpt('flavor_regex',
976 default='^m1.nano$',
977 help="Matching flavors become parameters for scenario tests"),
978 cfg.StrOpt('non_ssh_image_regex',
979 default='^.*[Ww]in.*$',
980 help="SSH verification in tests is skipped"
981 "for matching images"),
982 cfg.StrOpt('ssh_user_regex',
983 default="[[\"^.*[Cc]irros.*$\", \"root\"]]",
984 help="List of user mapped to regex "
985 "to matching image names."),
986]
987
988
989baremetal_group = cfg.OptGroup(name='baremetal',
990 title='Baremetal provisioning service options',
991 help='When enabling baremetal tests, Nova '
992 'must be configured to use the Ironic '
993 'driver. The following paremeters for the '
994 '[compute] section must be disabled: '
995 'console_output, interface_attach, '
996 'live_migration, pause, rescue, resize '
997 'shelve, snapshot, and suspend')
998
999BaremetalGroup = [
1000 cfg.StrOpt('catalog_type',
1001 default='baremetal',
1002 help="Catalog type of the baremetal provisioning service"),
1003 cfg.BoolOpt('driver_enabled',
1004 default=False,
1005 help="Whether the Ironic nova-compute driver is enabled"),
1006 cfg.StrOpt('driver',
1007 default='fake',
1008 help="Driver name which Ironic uses"),
1009 cfg.StrOpt('endpoint_type',
1010 default='publicURL',
1011 choices=['public', 'admin', 'internal',
1012 'publicURL', 'adminURL', 'internalURL'],
1013 help="The endpoint type to use for the baremetal provisioning "
1014 "service"),
1015 cfg.IntOpt('active_timeout',
1016 default=300,
1017 help="Timeout for Ironic node to completely provision"),
1018 cfg.IntOpt('association_timeout',
1019 default=30,
1020 help="Timeout for association of Nova instance and Ironic "
1021 "node"),
1022 cfg.IntOpt('power_timeout',
1023 default=60,
1024 help="Timeout for Ironic power transitions."),
1025 cfg.IntOpt('unprovision_timeout',
1026 default=60,
1027 help="Timeout for unprovisioning an Ironic node.")
1028]
1029
1030cli_group = cfg.OptGroup(name='cli', title="cli Configuration Options")
1031
1032CLIGroup = [
1033 cfg.BoolOpt('enabled',
1034 default=True,
1035 help="enable cli tests"),
1036 cfg.StrOpt('cli_dir',
1037 default='/usr/local/bin',
1038 help="directory where python client binaries are located"),
1039 cfg.BoolOpt('has_manage',
1040 default=True,
1041 help=("Whether the tempest run location has access to the "
1042 "*-manage commands. In a pure blackbox environment "
1043 "it will not.")),
1044 cfg.IntOpt('timeout',
1045 default=15,
1046 help="Number of seconds to wait on a CLI timeout"),
1047]
1048
1049negative_group = cfg.OptGroup(name='negative', title="Negative Test Options")
1050
1051NegativeGroup = [
1052 cfg.StrOpt('test_generator',
1053 default='tempest.common.' +
1054 'generator.negative_generator.NegativeTestGenerator',
1055 help="Test generator class for all negative tests"),
1056]
1057
1058_opts = [
1059 (auth_group, AuthGroup),
1060 (compute_group, ComputeGroup),
1061 (compute_features_group, ComputeFeaturesGroup),
1062 (identity_group, IdentityGroup),
1063 (identity_feature_group, IdentityFeatureGroup),
1064 (image_group, ImageGroup),
1065 (image_feature_group, ImageFeaturesGroup),
1066 (network_group, NetworkGroup),
1067 (network_feature_group, NetworkFeaturesGroup),
1068 (messaging_group, MessagingGroup),
1069 (volume_group, VolumeGroup),
1070 (volume_feature_group, VolumeFeaturesGroup),
1071 (object_storage_group, ObjectStoreGroup),
1072 (object_storage_feature_group, ObjectStoreFeaturesGroup),
1073 (database_group, DatabaseGroup),
1074 (orchestration_group, OrchestrationGroup),
1075 (telemetry_group, TelemetryGroup),
1076 (dashboard_group, DashboardGroup),
1077 (data_processing_group, DataProcessingGroup),
1078 (data_processing_feature_group, DataProcessingFeaturesGroup),
1079 (boto_group, BotoGroup),
1080 (stress_group, StressGroup),
1081 (scenario_group, ScenarioGroup),
1082 (service_available_group, ServiceAvailableGroup),
1083 (debug_group, DebugGroup),
1084 (baremetal_group, BaremetalGroup),
1085 (input_scenario_group, InputScenarioGroup),
1086 (cli_group, CLIGroup),
1087 (negative_group, NegativeGroup)
1088]
1089
1090
1091def register_opts():
1092 for g, o in _opts:
1093 register_opt_group(cfg.CONF, g, o)
1094
1095
1096def list_opts():
1097 """Return a list of oslo.config options available.
1098
1099 The purpose of this is to allow tools like the Oslo sample config file
1100 generator to discover the options exposed to users.
1101 """
Maru Newby5690a352015-03-13 18:46:40 +00001102 return [(g.name, o) for g, o in _opts]
Maru Newbyb096d9f2015-03-09 18:54:54 +00001103
1104
1105# this should never be called outside of this class
1106class TempestConfigPrivate(object):
1107 """Provides OpenStack configuration information."""
1108
1109 DEFAULT_CONFIG_DIR = os.path.join(
1110 os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
1111 "etc")
1112
1113 DEFAULT_CONFIG_FILE = "tempest.conf"
1114
1115 def __getattr__(self, attr):
1116 # Handles config options from the default group
1117 return getattr(cfg.CONF, attr)
1118
1119 def _set_attrs(self):
1120 self.auth = cfg.CONF.auth
1121 self.compute = cfg.CONF.compute
1122 self.compute_feature_enabled = cfg.CONF['compute-feature-enabled']
1123 self.identity = cfg.CONF.identity
1124 self.identity_feature_enabled = cfg.CONF['identity-feature-enabled']
1125 self.image = cfg.CONF.image
1126 self.image_feature_enabled = cfg.CONF['image-feature-enabled']
1127 self.network = cfg.CONF.network
1128 self.network_feature_enabled = cfg.CONF['network-feature-enabled']
1129 self.volume = cfg.CONF.volume
1130 self.volume_feature_enabled = cfg.CONF['volume-feature-enabled']
1131 self.object_storage = cfg.CONF['object-storage']
1132 self.object_storage_feature_enabled = cfg.CONF[
1133 'object-storage-feature-enabled']
1134 self.database = cfg.CONF.database
1135 self.orchestration = cfg.CONF.orchestration
1136 self.messaging = cfg.CONF.messaging
1137 self.telemetry = cfg.CONF.telemetry
1138 self.dashboard = cfg.CONF.dashboard
1139 self.data_processing = cfg.CONF.data_processing
1140 self.data_processing_feature_enabled = cfg.CONF[
1141 'data_processing-feature-enabled']
1142 self.boto = cfg.CONF.boto
1143 self.stress = cfg.CONF.stress
1144 self.scenario = cfg.CONF.scenario
1145 self.service_available = cfg.CONF.service_available
1146 self.debug = cfg.CONF.debug
1147 self.baremetal = cfg.CONF.baremetal
1148 self.input_scenario = cfg.CONF['input-scenario']
1149 self.cli = cfg.CONF.cli
1150 self.negative = cfg.CONF.negative
1151 cfg.CONF.set_default('domain_name', self.identity.admin_domain_name,
1152 group='identity')
1153 cfg.CONF.set_default('alt_domain_name',
1154 self.identity.admin_domain_name,
1155 group='identity')
1156
1157 def __init__(self, parse_conf=True, config_path=None):
1158 """Initialize a configuration from a conf directory and conf file."""
1159 super(TempestConfigPrivate, self).__init__()
1160 config_files = []
1161 failsafe_path = "/etc/tempest/" + self.DEFAULT_CONFIG_FILE
1162
1163 if config_path:
1164 path = config_path
1165 else:
1166 # Environment variables override defaults...
1167 conf_dir = os.environ.get('TEMPEST_CONFIG_DIR',
1168 self.DEFAULT_CONFIG_DIR)
1169 conf_file = os.environ.get('TEMPEST_CONFIG',
1170 self.DEFAULT_CONFIG_FILE)
1171
1172 path = os.path.join(conf_dir, conf_file)
1173
1174 if not os.path.isfile(path):
1175 path = failsafe_path
1176
1177 # only parse the config file if we expect one to exist. This is needed
1178 # to remove an issue with the config file up to date checker.
1179 if parse_conf:
1180 config_files.append(path)
Maru Newby5690a352015-03-13 18:46:40 +00001181 logging.register_options(cfg.CONF)
Maru Newbyb096d9f2015-03-09 18:54:54 +00001182 if os.path.isfile(path):
1183 cfg.CONF([], project='tempest', default_config_files=config_files)
1184 else:
1185 cfg.CONF([], project='tempest')
Ihar Hrachyshkac695f9f2015-02-26 23:26:41 +01001186 logging.setup(cfg.CONF, 'tempest')
Maru Newbyb096d9f2015-03-09 18:54:54 +00001187 LOG = logging.getLogger('tempest')
1188 LOG.info("Using tempest config file %s" % path)
1189 register_opts()
1190 self._set_attrs()
1191 if parse_conf:
Sergey Vilgelm8bf2b792015-08-10 15:46:27 +03001192 cfg.CONF.log_opt_values(LOG, logging.DEBUG)
Maru Newbyb096d9f2015-03-09 18:54:54 +00001193
1194
1195class TempestConfigProxy(object):
1196 _config = None
1197 _path = None
1198
1199 _extra_log_defaults = [
Sergey Vilgelm8bf2b792015-08-10 15:46:27 +03001200 ('keystoneclient.session', logging.INFO),
1201 ('paramiko.transport', logging.INFO),
1202 ('requests.packages.urllib3.connectionpool', logging.WARN),
Maru Newbyb096d9f2015-03-09 18:54:54 +00001203 ]
1204
1205 def _fix_log_levels(self):
1206 """Tweak the oslo log defaults."""
Maru Newby5690a352015-03-13 18:46:40 +00001207 for name, level in self._extra_log_defaults:
Sergey Vilgelm8bf2b792015-08-10 15:46:27 +03001208 logging.getLogger(name).logger.setLevel(level)
Maru Newbyb096d9f2015-03-09 18:54:54 +00001209
1210 def __getattr__(self, attr):
1211 if not self._config:
1212 self._fix_log_levels()
1213 self._config = TempestConfigPrivate(config_path=self._path)
1214
1215 return getattr(self._config, attr)
1216
1217 def set_config_path(self, path):
1218 self._path = path
1219
1220
1221CONF = TempestConfigProxy()