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