ZhiQiang Fan | 39f9722 | 2013-09-20 04:49:44 +0800 | [diff] [blame] | 1 | # Copyright 2012 OpenStack Foundation |
Jay Pipes | 3f981df | 2012-03-27 18:59:44 -0400 | [diff] [blame] | 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 | |
Dirk Mueller | e746fc2 | 2013-06-29 16:29:29 +0200 | [diff] [blame] | 16 | from __future__ import print_function |
| 17 | |
Masayuki Igawa | 9ec4cd8 | 2014-02-05 15:04:16 +0900 | [diff] [blame] | 18 | import logging as std_logging |
Jay Pipes | 7f75763 | 2011-12-02 15:53:32 -0500 | [diff] [blame] | 19 | import os |
Jay Pipes | 3f981df | 2012-03-27 18:59:44 -0400 | [diff] [blame] | 20 | |
Matthew Treinish | 90aedd1 | 2013-02-25 17:56:49 -0500 | [diff] [blame] | 21 | from oslo.config import cfg |
| 22 | |
Matthew Treinish | f4a9b0f | 2013-07-26 16:58:26 -0400 | [diff] [blame] | 23 | from tempest.openstack.common import log as logging |
Jay Pipes | 7f75763 | 2011-12-02 15:53:32 -0500 | [diff] [blame] | 24 | |
Daryl Walleck | 1465d61 | 2011-11-02 02:22:15 -0500 | [diff] [blame] | 25 | |
DennyZhang | 88a2dd8 | 2013-10-07 12:55:35 -0500 | [diff] [blame] | 26 | def register_opt_group(conf, opt_group, options): |
| 27 | conf.register_group(opt_group) |
| 28 | for opt in options: |
| 29 | conf.register_opt(opt, group=opt_group.name) |
| 30 | |
| 31 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 32 | identity_group = cfg.OptGroup(name='identity', |
| 33 | title="Keystone Configuration Options") |
Daryl Walleck | 1465d61 | 2011-11-02 02:22:15 -0500 | [diff] [blame] | 34 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 35 | IdentityGroup = [ |
| 36 | cfg.StrOpt('catalog_type', |
| 37 | default='identity', |
| 38 | help="Catalog type of the Identity service."), |
Jay Pipes | cd8eaec | 2013-01-16 21:03:48 -0500 | [diff] [blame] | 39 | cfg.BoolOpt('disable_ssl_certificate_validation', |
| 40 | default=False, |
| 41 | help="Set to True if using self-signed SSL certificates."), |
Jay Pipes | 7c88eb2 | 2013-01-16 21:32:43 -0500 | [diff] [blame] | 42 | cfg.StrOpt('uri', |
| 43 | default=None, |
Brant Knudson | c7ca334 | 2013-03-28 21:08:50 -0500 | [diff] [blame] | 44 | help="Full URI of the OpenStack Identity API (Keystone), v2"), |
| 45 | cfg.StrOpt('uri_v3', |
| 46 | help='Full URI of the OpenStack Identity API (Keystone), v3'), |
Andrea Frittoli | 8bbdb16 | 2014-01-06 11:06:13 +0000 | [diff] [blame] | 47 | cfg.StrOpt('auth_version', |
| 48 | default='v2', |
| 49 | help="Identity API version to be used for authentication " |
Andrea Frittoli | 77f9da4 | 2014-02-06 11:18:19 +0000 | [diff] [blame] | 50 | "for API tests."), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 51 | cfg.StrOpt('region', |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 52 | default='RegionOne', |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 53 | help="The identity region name to use. Also used as the other " |
| 54 | "services' region name unless they are set explicitly. " |
| 55 | "If no such region is found in the service catalog, the " |
| 56 | "first found one is used."), |
JordanP | 5d29b2c | 2013-12-18 13:56:03 +0000 | [diff] [blame] | 57 | cfg.StrOpt('endpoint_type', |
| 58 | default='publicURL', |
| 59 | choices=['public', 'admin', 'internal', |
| 60 | 'publicURL', 'adminURL', 'internalURL'], |
| 61 | help="The endpoint type to use for the identity service."), |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 62 | cfg.StrOpt('username', |
Andrea Frittoli | a946367 | 2014-03-03 14:39:02 +0000 | [diff] [blame] | 63 | default=None, |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 64 | help="Username to use for Nova API requests."), |
| 65 | cfg.StrOpt('tenant_name', |
Andrea Frittoli | a946367 | 2014-03-03 14:39:02 +0000 | [diff] [blame] | 66 | default=None, |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 67 | help="Tenant name to use for Nova API requests."), |
Russell Sim | 7f894a5 | 2013-09-13 10:35:21 +1000 | [diff] [blame] | 68 | cfg.StrOpt('admin_role', |
| 69 | default='admin', |
| 70 | help="Role required to administrate keystone."), |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 71 | cfg.StrOpt('password', |
Andrea Frittoli | a946367 | 2014-03-03 14:39:02 +0000 | [diff] [blame] | 72 | default=None, |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 73 | help="API key to use when authenticating.", |
| 74 | secret=True), |
| 75 | cfg.StrOpt('alt_username', |
| 76 | default=None, |
| 77 | help="Username of alternate user to use for Nova API " |
| 78 | "requests."), |
| 79 | cfg.StrOpt('alt_tenant_name', |
| 80 | default=None, |
| 81 | help="Alternate user's Tenant name to use for Nova API " |
| 82 | "requests."), |
| 83 | cfg.StrOpt('alt_password', |
| 84 | default=None, |
| 85 | help="API key to use when authenticating as alternate user.", |
| 86 | secret=True), |
| 87 | cfg.StrOpt('admin_username', |
Andrea Frittoli | a946367 | 2014-03-03 14:39:02 +0000 | [diff] [blame] | 88 | default=None, |
Dirk Mueller | 14bd562 | 2014-01-14 19:33:05 +0100 | [diff] [blame] | 89 | help="Administrative Username to use for " |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 90 | "Keystone API requests."), |
| 91 | cfg.StrOpt('admin_tenant_name', |
Andrea Frittoli | a946367 | 2014-03-03 14:39:02 +0000 | [diff] [blame] | 92 | default=None, |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 93 | help="Administrative Tenant name to use for Keystone API " |
| 94 | "requests."), |
| 95 | cfg.StrOpt('admin_password', |
Andrea Frittoli | a946367 | 2014-03-03 14:39:02 +0000 | [diff] [blame] | 96 | default=None, |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 97 | help="API key to use when authenticating as admin.", |
| 98 | secret=True), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 99 | ] |
Jay Pipes | 3f981df | 2012-03-27 18:59:44 -0400 | [diff] [blame] | 100 | |
Matthew Treinish | d5021a7 | 2014-01-09 18:42:51 +0000 | [diff] [blame] | 101 | identity_feature_group = cfg.OptGroup(name='identity-feature-enabled', |
| 102 | title='Enabled Identity Features') |
| 103 | |
| 104 | IdentityFeatureGroup = [ |
| 105 | cfg.BoolOpt('trust', |
| 106 | default=True, |
| 107 | help='Does the identity service have delegation and ' |
Matthew Treinish | db2c597 | 2014-01-31 22:18:59 +0000 | [diff] [blame] | 108 | 'impersonation enabled'), |
| 109 | cfg.BoolOpt('api_v2', |
| 110 | default=True, |
| 111 | help='Is the v2 identity API enabled'), |
| 112 | cfg.BoolOpt('api_v3', |
| 113 | default=True, |
| 114 | help='Is the v3 identity API enabled'), |
Matthew Treinish | d5021a7 | 2014-01-09 18:42:51 +0000 | [diff] [blame] | 115 | ] |
| 116 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 117 | compute_group = cfg.OptGroup(name='compute', |
| 118 | title='Compute Service Options') |
Rohit Karajgi | e1b050d | 2011-12-02 16:13:18 -0800 | [diff] [blame] | 119 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 120 | ComputeGroup = [ |
| 121 | cfg.BoolOpt('allow_tenant_isolation', |
| 122 | default=False, |
| 123 | help="Allows test cases to create/destroy tenants and " |
| 124 | "users. This option enables isolated test cases and " |
| 125 | "better parallel execution, but also requires that " |
| 126 | "OpenStack Identity API admin credentials are known."), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 127 | cfg.StrOpt('image_ref', |
| 128 | default="{$IMAGE_ID}", |
Jerry Cai | 9733d0e | 2014-03-19 15:50:49 +0800 | [diff] [blame] | 129 | help="Valid primary image reference to be used in tests."), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 130 | cfg.StrOpt('image_ref_alt', |
| 131 | default="{$IMAGE_ID_ALT}", |
| 132 | help="Valid secondary image reference to be used in tests."), |
Ken'ichi Ohmichi | 3577260 | 2013-11-14 15:03:27 +0900 | [diff] [blame] | 133 | cfg.StrOpt('flavor_ref', |
| 134 | default="1", |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 135 | help="Valid primary flavor to use in tests."), |
Ken'ichi Ohmichi | 3577260 | 2013-11-14 15:03:27 +0900 | [diff] [blame] | 136 | cfg.StrOpt('flavor_ref_alt', |
| 137 | default="2", |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 138 | help='Valid secondary flavor to be used in tests.'), |
Maru Newby | af292e8 | 2013-05-20 21:32:28 +0000 | [diff] [blame] | 139 | cfg.StrOpt('image_ssh_user', |
| 140 | default="root", |
| 141 | help="User name used to authenticate to an instance."), |
Ryan Hsu | cb2e125 | 2013-09-03 21:44:49 -0700 | [diff] [blame] | 142 | cfg.StrOpt('image_ssh_password', |
| 143 | default="password", |
| 144 | help="Password used to authenticate to an instance."), |
Maru Newby | af292e8 | 2013-05-20 21:32:28 +0000 | [diff] [blame] | 145 | cfg.StrOpt('image_alt_ssh_user', |
| 146 | default="root", |
| 147 | help="User name used to authenticate to an instance using " |
| 148 | "the alternate image."), |
Ryan Hsu | cb2e125 | 2013-09-03 21:44:49 -0700 | [diff] [blame] | 149 | cfg.StrOpt('image_alt_ssh_password', |
| 150 | default="password", |
| 151 | help="Password used to authenticate to an instance using " |
| 152 | "the alternate image."), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 153 | cfg.IntOpt('build_interval', |
| 154 | default=10, |
| 155 | help="Time in seconds between build status checks."), |
| 156 | cfg.IntOpt('build_timeout', |
| 157 | default=300, |
| 158 | help="Timeout in seconds to wait for an instance to build."), |
| 159 | cfg.BoolOpt('run_ssh', |
| 160 | default=False, |
Derek Higgins | 85cd514 | 2013-12-17 17:10:11 +0000 | [diff] [blame] | 161 | help="Should the tests ssh to instances?"), |
Attila Fazekas | 423834d | 2014-03-14 17:33:13 +0100 | [diff] [blame^] | 162 | cfg.StrOpt('ssh_auth_method', |
| 163 | default='keypair', |
| 164 | help="Auth method used for authenticate to the instance. " |
| 165 | "Valid choices are: keypair, configured, adminpass. " |
| 166 | "keypair: start the servers with an ssh keypair. " |
| 167 | "configured: use the configured user and password. " |
| 168 | "adminpass: use the injected adminPass. " |
| 169 | "disabled: avoid using ssh when it is an option."), |
| 170 | cfg.StrOpt('ssh_connect_method', |
| 171 | default='fixed', |
| 172 | help="How to connect to the instance? " |
| 173 | "fixed: using the first ip belongs the fixed network " |
| 174 | "floating: creating and using a floating ip"), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 175 | cfg.StrOpt('ssh_user', |
| 176 | default='root', |
| 177 | help="User name used to authenticate to an instance."), |
Nachi Ueno | 6d580be | 2013-07-24 10:58:11 -0700 | [diff] [blame] | 178 | cfg.IntOpt('ping_timeout', |
Darragh O'Reilly | 6b63667 | 2014-01-24 12:17:40 +0000 | [diff] [blame] | 179 | default=120, |
Nachi Ueno | 6d580be | 2013-07-24 10:58:11 -0700 | [diff] [blame] | 180 | help="Timeout in seconds to wait for ping to " |
| 181 | "succeed."), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 182 | cfg.IntOpt('ssh_timeout', |
| 183 | default=300, |
Chris Yeoh | 7691604 | 2013-02-27 16:25:25 +1030 | [diff] [blame] | 184 | help="Timeout in seconds to wait for authentication to " |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 185 | "succeed."), |
Attila Fazekas | 0abbc95 | 2013-07-01 19:19:42 +0200 | [diff] [blame] | 186 | cfg.IntOpt('ready_wait', |
| 187 | default=0, |
DennyZhang | 8912d01 | 2013-09-25 18:08:34 -0500 | [diff] [blame] | 188 | help="Additional wait time for clean state, when there is " |
| 189 | "no OS-EXT-STS extension available"), |
Chris Yeoh | 7691604 | 2013-02-27 16:25:25 +1030 | [diff] [blame] | 190 | cfg.IntOpt('ssh_channel_timeout', |
| 191 | default=60, |
| 192 | help="Timeout in seconds to wait for output from ssh " |
| 193 | "channel."), |
Attila Fazekas | b066165 | 2013-05-08 13:01:36 +0200 | [diff] [blame] | 194 | cfg.StrOpt('fixed_network_name', |
| 195 | default='private', |
| 196 | help="Visible fixed network name "), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 197 | cfg.StrOpt('network_for_ssh', |
| 198 | default='public', |
| 199 | help="Network used for SSH connections."), |
| 200 | cfg.IntOpt('ip_version_for_ssh', |
| 201 | default=4, |
| 202 | help="IP version used for SSH connections."), |
fujioka yuuichi | a11994e | 2013-07-09 11:19:51 +0900 | [diff] [blame] | 203 | cfg.BoolOpt('use_floatingip_for_ssh', |
| 204 | default=True, |
Tushar Kalra | 95a482d | 2014-03-25 14:24:43 -0700 | [diff] [blame] | 205 | help="Does SSH use Floating IPs?"), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 206 | cfg.StrOpt('catalog_type', |
| 207 | default='compute', |
| 208 | help="Catalog type of the Compute service."), |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 209 | cfg.StrOpt('region', |
| 210 | default='', |
| 211 | help="The compute region name to use. If empty, the value " |
| 212 | "of identity.region is used instead. If no such region " |
| 213 | "is found in the service catalog, the first found one is " |
| 214 | "used."), |
JordanP | 5d29b2c | 2013-12-18 13:56:03 +0000 | [diff] [blame] | 215 | cfg.StrOpt('endpoint_type', |
| 216 | default='publicURL', |
| 217 | choices=['public', 'admin', 'internal', |
| 218 | 'publicURL', 'adminURL', 'internalURL'], |
| 219 | help="The endpoint type to use for the compute service."), |
ivan-zhu | 8f992be | 2013-07-31 14:56:58 +0800 | [diff] [blame] | 220 | cfg.StrOpt('catalog_v3_type', |
| 221 | default='computev3', |
| 222 | help="Catalog type of the Compute v3 service."), |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 223 | cfg.StrOpt('path_to_private_key', |
| 224 | default=None, |
| 225 | help="Path to a private key file for SSH access to remote " |
| 226 | "hosts"), |
Ryan Hsu | cb2e125 | 2013-09-03 21:44:49 -0700 | [diff] [blame] | 227 | cfg.StrOpt('volume_device_name', |
| 228 | default='vdb', |
| 229 | help="Expected device name when a volume is attached to " |
Ken'ichi Ohmichi | 39437e2 | 2013-10-06 00:21:38 +0900 | [diff] [blame] | 230 | "an instance"), |
| 231 | cfg.IntOpt('shelved_offload_time', |
| 232 | default=0, |
| 233 | help='Time in seconds before a shelved instance is eligible ' |
| 234 | 'for removing from a host. -1 never offload, 0 offload ' |
| 235 | 'when shelved. This time should be the same as the time ' |
| 236 | 'of nova.conf, and some tests will run for as long as the ' |
| 237 | 'time.') |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 238 | ] |
Rohit Karajgi | e1b050d | 2011-12-02 16:13:18 -0800 | [diff] [blame] | 239 | |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 240 | compute_features_group = cfg.OptGroup(name='compute-feature-enabled', |
| 241 | title="Enabled Compute Service Features") |
| 242 | |
| 243 | ComputeFeaturesGroup = [ |
ivan-zhu | 8f992be | 2013-07-31 14:56:58 +0800 | [diff] [blame] | 244 | cfg.BoolOpt('api_v3', |
Chris Yeoh | fbc15de | 2013-11-26 10:20:08 +1030 | [diff] [blame] | 245 | default=True, |
ivan-zhu | 8f992be | 2013-07-31 14:56:58 +0800 | [diff] [blame] | 246 | help="If false, skip all nova v3 tests."), |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 247 | cfg.BoolOpt('disk_config', |
| 248 | default=True, |
| 249 | help="If false, skip disk config tests"), |
Matthew Treinish | e3d2614 | 2013-11-26 19:14:58 +0000 | [diff] [blame] | 250 | cfg.ListOpt('api_extensions', |
| 251 | default=['all'], |
Zhi Kun Liu | de25c02 | 2014-02-14 13:25:19 +0800 | [diff] [blame] | 252 | help='A list of enabled compute extensions with a special ' |
| 253 | 'entry all which indicates every extension is enabled'), |
Matthew Treinish | e3d2614 | 2013-11-26 19:14:58 +0000 | [diff] [blame] | 254 | cfg.ListOpt('api_v3_extensions', |
| 255 | default=['all'], |
| 256 | help='A list of enabled v3 extensions with a special entry all' |
| 257 | ' which indicates every extension is enabled'), |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 258 | cfg.BoolOpt('change_password', |
| 259 | default=False, |
| 260 | help="Does the test environment support changing the admin " |
| 261 | "password?"), |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 262 | cfg.BoolOpt('resize', |
| 263 | default=False, |
| 264 | help="Does the test environment support resizing?"), |
Eric Windisch | b553807 | 2014-03-09 23:47:35 -0400 | [diff] [blame] | 265 | cfg.BoolOpt('pause', |
| 266 | default=True, |
| 267 | help="Does the test environment support pausing?"), |
Eric Windisch | aeb7e84 | 2014-03-10 01:10:50 -0400 | [diff] [blame] | 268 | cfg.BoolOpt('suspend', |
| 269 | default=True, |
| 270 | help="Does the test environment support suspend/resume?"), |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 271 | cfg.BoolOpt('live_migration', |
| 272 | default=False, |
| 273 | help="Does the test environment support live migration " |
| 274 | "available?"), |
| 275 | cfg.BoolOpt('block_migration_for_live_migration', |
| 276 | default=False, |
| 277 | help="Does the test environment use block devices for live " |
| 278 | "migration"), |
| 279 | cfg.BoolOpt('block_migrate_cinder_iscsi', |
| 280 | default=False, |
| 281 | help="Does the test environment block migration support " |
Ghanshyam Mann | 41c1757 | 2014-02-27 18:52:56 +0900 | [diff] [blame] | 282 | "cinder iSCSI volumes"), |
| 283 | cfg.BoolOpt('vnc_console', |
| 284 | default=False, |
| 285 | help='Enable VNC console. This configuration value should ' |
| 286 | 'be same as [nova.vnc]->vnc_enabled in nova.conf') |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 287 | ] |
| 288 | |
| 289 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 290 | compute_admin_group = cfg.OptGroup(name='compute-admin', |
| 291 | title="Compute Admin Options") |
donald-ngo | 7fb1efa | 2011-12-13 17:17:36 -0800 | [diff] [blame] | 292 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 293 | ComputeAdminGroup = [ |
| 294 | cfg.StrOpt('username', |
Andrea Frittoli | a946367 | 2014-03-03 14:39:02 +0000 | [diff] [blame] | 295 | default=None, |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 296 | help="Administrative Username to use for Nova API requests."), |
| 297 | cfg.StrOpt('tenant_name', |
Andrea Frittoli | a946367 | 2014-03-03 14:39:02 +0000 | [diff] [blame] | 298 | default=None, |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 299 | help="Administrative Tenant name to use for Nova API " |
| 300 | "requests."), |
| 301 | cfg.StrOpt('password', |
Andrea Frittoli | a946367 | 2014-03-03 14:39:02 +0000 | [diff] [blame] | 302 | default=None, |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 303 | help="API key to use when authenticating as admin.", |
| 304 | secret=True), |
| 305 | ] |
Daryl Walleck | 587385b | 2012-03-03 13:00:26 -0600 | [diff] [blame] | 306 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 307 | image_group = cfg.OptGroup(name='image', |
| 308 | title="Image Service Options") |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 309 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 310 | ImageGroup = [ |
Matthew Treinish | 72ea442 | 2013-02-07 14:42:49 -0500 | [diff] [blame] | 311 | cfg.StrOpt('catalog_type', |
| 312 | default='image', |
Sean Dague | 8340199 | 2013-05-06 17:46:36 -0400 | [diff] [blame] | 313 | help='Catalog type of the Image service.'), |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 314 | cfg.StrOpt('region', |
| 315 | default='', |
| 316 | help="The image region name to use. If empty, the value " |
| 317 | "of identity.region is used instead. If no such region " |
| 318 | "is found in the service catalog, the first found one is " |
| 319 | "used."), |
JordanP | 5d29b2c | 2013-12-18 13:56:03 +0000 | [diff] [blame] | 320 | cfg.StrOpt('endpoint_type', |
| 321 | default='publicURL', |
| 322 | choices=['public', 'admin', 'internal', |
| 323 | 'publicURL', 'adminURL', 'internalURL'], |
| 324 | help="The endpoint type to use for the image service."), |
Sean Dague | 8340199 | 2013-05-06 17:46:36 -0400 | [diff] [blame] | 325 | cfg.StrOpt('http_image', |
| 326 | default='http://download.cirros-cloud.net/0.3.1/' |
| 327 | 'cirros-0.3.1-x86_64-uec.tar.gz', |
DennyZhang | 8912d01 | 2013-09-25 18:08:34 -0500 | [diff] [blame] | 328 | help='http accessible image') |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 329 | ] |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 330 | |
Matthew Treinish | 2b5287d | 2013-10-22 17:40:34 +0000 | [diff] [blame] | 331 | image_feature_group = cfg.OptGroup(name='image-feature-enabled', |
| 332 | title='Enabled image service features') |
| 333 | |
| 334 | ImageFeaturesGroup = [ |
| 335 | cfg.BoolOpt('api_v2', |
| 336 | default=True, |
| 337 | help="Is the v2 image API enabled"), |
| 338 | cfg.BoolOpt('api_v1', |
| 339 | default=True, |
| 340 | help="Is the v1 image API enabled"), |
| 341 | ] |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 342 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 343 | network_group = cfg.OptGroup(name='network', |
| 344 | title='Network Service Options') |
Daryl Walleck | 587385b | 2012-03-03 13:00:26 -0600 | [diff] [blame] | 345 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 346 | NetworkGroup = [ |
| 347 | cfg.StrOpt('catalog_type', |
| 348 | default='network', |
Mark McClain | f2982e8 | 2013-07-06 17:48:03 -0400 | [diff] [blame] | 349 | help='Catalog type of the Neutron service.'), |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 350 | cfg.StrOpt('region', |
| 351 | default='', |
| 352 | help="The network region name to use. If empty, the value " |
| 353 | "of identity.region is used instead. If no such region " |
| 354 | "is found in the service catalog, the first found one is " |
| 355 | "used."), |
JordanP | 5d29b2c | 2013-12-18 13:56:03 +0000 | [diff] [blame] | 356 | cfg.StrOpt('endpoint_type', |
| 357 | default='publicURL', |
| 358 | choices=['public', 'admin', 'internal', |
| 359 | 'publicURL', 'adminURL', 'internalURL'], |
| 360 | help="The endpoint type to use for the network service."), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 361 | cfg.StrOpt('tenant_network_cidr', |
| 362 | default="10.100.0.0/16", |
Henry Gessau | ffda37a | 2014-01-16 11:17:55 -0500 | [diff] [blame] | 363 | help="The cidr block to allocate tenant ipv4 subnets from"), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 364 | cfg.IntOpt('tenant_network_mask_bits', |
Attila Fazekas | 8ea181b | 2013-07-13 16:26:14 +0200 | [diff] [blame] | 365 | default=28, |
Henry Gessau | ffda37a | 2014-01-16 11:17:55 -0500 | [diff] [blame] | 366 | help="The mask bits for tenant ipv4 subnets"), |
| 367 | cfg.StrOpt('tenant_network_v6_cidr', |
| 368 | default="2003::/64", |
| 369 | help="The cidr block to allocate tenant ipv6 subnets from"), |
| 370 | cfg.IntOpt('tenant_network_v6_mask_bits', |
| 371 | default=96, |
| 372 | help="The mask bits for tenant ipv6 subnets"), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 373 | cfg.BoolOpt('tenant_networks_reachable', |
| 374 | default=False, |
| 375 | help="Whether tenant network connectivity should be " |
| 376 | "evaluated directly"), |
| 377 | cfg.StrOpt('public_network_id', |
| 378 | default="", |
| 379 | help="Id of the public network that provides external " |
| 380 | "connectivity"), |
| 381 | cfg.StrOpt('public_router_id', |
| 382 | default="", |
| 383 | help="Id of the public router that provides external " |
| 384 | "connectivity"), |
izikpenso | d9a01a6 | 2014-02-17 20:02:32 +0200 | [diff] [blame] | 385 | cfg.IntOpt('build_timeout', |
| 386 | default=300, |
| 387 | help="Timeout in seconds to wait for network operation to " |
| 388 | "complete."), |
| 389 | cfg.IntOpt('build_interval', |
| 390 | default=10, |
| 391 | help="Time in seconds between network operation status " |
| 392 | "checks."), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 393 | ] |
Jay Pipes | 3f981df | 2012-03-27 18:59:44 -0400 | [diff] [blame] | 394 | |
Matthew Treinish | e3d2614 | 2013-11-26 19:14:58 +0000 | [diff] [blame] | 395 | network_feature_group = cfg.OptGroup(name='network-feature-enabled', |
| 396 | title='Enabled network service features') |
| 397 | |
| 398 | NetworkFeaturesGroup = [ |
Matthew Treinish | e2e33cf | 2014-03-03 19:28:41 +0000 | [diff] [blame] | 399 | cfg.BoolOpt('ipv6', |
| 400 | default=True, |
| 401 | help="Allow the execution of IPv6 tests"), |
Matthew Treinish | e3d2614 | 2013-11-26 19:14:58 +0000 | [diff] [blame] | 402 | cfg.ListOpt('api_extensions', |
| 403 | default=['all'], |
Zhi Kun Liu | de25c02 | 2014-02-14 13:25:19 +0800 | [diff] [blame] | 404 | help='A list of enabled network extensions with a special ' |
| 405 | 'entry all which indicates every extension is enabled'), |
Matthew Treinish | e3d2614 | 2013-11-26 19:14:58 +0000 | [diff] [blame] | 406 | ] |
| 407 | |
Malini Kamalambal | 6e7b3b8 | 2014-02-06 06:49:04 -0500 | [diff] [blame] | 408 | queuing_group = cfg.OptGroup(name='queuing', |
| 409 | title='Queuing Service') |
| 410 | |
| 411 | QueuingGroup = [ |
| 412 | cfg.StrOpt('catalog_type', |
| 413 | default='queuing', |
| 414 | help='Catalog type of the Queuing service.'), |
| 415 | ] |
| 416 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 417 | volume_group = cfg.OptGroup(name='volume', |
| 418 | title='Block Storage Options') |
Daryl Walleck | 587385b | 2012-03-03 13:00:26 -0600 | [diff] [blame] | 419 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 420 | VolumeGroup = [ |
| 421 | cfg.IntOpt('build_interval', |
| 422 | default=10, |
| 423 | help='Time in seconds between volume availability checks.'), |
| 424 | cfg.IntOpt('build_timeout', |
| 425 | default=300, |
| 426 | help='Timeout in seconds to wait for a volume to become' |
| 427 | 'available.'), |
| 428 | cfg.StrOpt('catalog_type', |
Matthew Treinish | eb72451 | 2013-10-25 15:12:59 +0000 | [diff] [blame] | 429 | default='volume', |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 430 | help="Catalog type of the Volume Service"), |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 431 | cfg.StrOpt('region', |
| 432 | default='', |
| 433 | help="The volume region name to use. If empty, the value " |
| 434 | "of identity.region is used instead. If no such region " |
| 435 | "is found in the service catalog, the first found one is " |
| 436 | "used."), |
JordanP | 5d29b2c | 2013-12-18 13:56:03 +0000 | [diff] [blame] | 437 | cfg.StrOpt('endpoint_type', |
| 438 | default='publicURL', |
| 439 | choices=['public', 'admin', 'internal', |
| 440 | 'publicURL', 'adminURL', 'internalURL'], |
| 441 | help="The endpoint type to use for the volume service."), |
Jérôme Gallard | 86551ce | 2013-03-08 11:41:26 +0100 | [diff] [blame] | 442 | cfg.StrOpt('backend1_name', |
Giulio Fidente | f4fa894 | 2013-05-28 18:48:03 +0200 | [diff] [blame] | 443 | default='BACKEND_1', |
Jérôme Gallard | 86551ce | 2013-03-08 11:41:26 +0100 | [diff] [blame] | 444 | help="Name of the backend1 (must be declared in cinder.conf)"), |
| 445 | cfg.StrOpt('backend2_name', |
Giulio Fidente | f4fa894 | 2013-05-28 18:48:03 +0200 | [diff] [blame] | 446 | default='BACKEND_2', |
Jérôme Gallard | 86551ce | 2013-03-08 11:41:26 +0100 | [diff] [blame] | 447 | help="Name of the backend2 (must be declared in cinder.conf)"), |
Adam Gandelman | 827ad33 | 2013-06-24 17:04:09 -0700 | [diff] [blame] | 448 | cfg.StrOpt('storage_protocol', |
| 449 | default='iSCSI', |
| 450 | help='Backend protocol to target when creating volume types'), |
| 451 | cfg.StrOpt('vendor_name', |
| 452 | default='Open Source', |
| 453 | help='Backend vendor to target when creating volume types'), |
Ryan Hsu | a67f463 | 2013-08-29 16:03:06 -0700 | [diff] [blame] | 454 | cfg.StrOpt('disk_format', |
| 455 | default='raw', |
| 456 | help='Disk format to use when copying a volume to image'), |
Jerry Cai | 9733d0e | 2014-03-19 15:50:49 +0800 | [diff] [blame] | 457 | cfg.IntOpt('volume_size', |
| 458 | default=1, |
| 459 | help='Default size in GB for volumes created by volumes tests'), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 460 | ] |
K Jonathan Harker | d6ba4b4 | 2012-12-18 13:50:47 -0800 | [diff] [blame] | 461 | |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 462 | volume_feature_group = cfg.OptGroup(name='volume-feature-enabled', |
| 463 | title='Enabled Cinder Features') |
| 464 | |
| 465 | VolumeFeaturesGroup = [ |
| 466 | cfg.BoolOpt('multi_backend', |
| 467 | default=False, |
Matthew Treinish | e3d2614 | 2013-11-26 19:14:58 +0000 | [diff] [blame] | 468 | help="Runs Cinder multi-backend test (requires 2 backends)"), |
Giulio Fidente | 74b08ad | 2014-01-18 04:02:51 +0100 | [diff] [blame] | 469 | cfg.BoolOpt('backup', |
| 470 | default=True, |
| 471 | help='Runs Cinder volumes backup test'), |
JordanP | bce5553 | 2014-03-19 12:10:32 +0100 | [diff] [blame] | 472 | cfg.BoolOpt('snapshot', |
| 473 | default=True, |
| 474 | help='Runs Cinder volume snapshot test'), |
Matthew Treinish | e3d2614 | 2013-11-26 19:14:58 +0000 | [diff] [blame] | 475 | cfg.ListOpt('api_extensions', |
| 476 | default=['all'], |
Zhi Kun Liu | de25c02 | 2014-02-14 13:25:19 +0800 | [diff] [blame] | 477 | help='A list of enabled volume extensions with a special ' |
| 478 | 'entry all which indicates every extension is enabled'), |
Zhi Kun Liu | bb363a2 | 2013-11-28 18:47:39 +0800 | [diff] [blame] | 479 | cfg.BoolOpt('api_v1', |
| 480 | default=True, |
| 481 | help="Is the v1 volume API enabled"), |
Zhi Kun Liu | 8cc3c84 | 2014-01-07 10:44:34 +0800 | [diff] [blame] | 482 | cfg.BoolOpt('api_v2', |
| 483 | default=True, |
| 484 | help="Is the v2 volume API enabled"), |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 485 | ] |
| 486 | |
Daryl Walleck | 587385b | 2012-03-03 13:00:26 -0600 | [diff] [blame] | 487 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 488 | object_storage_group = cfg.OptGroup(name='object-storage', |
| 489 | title='Object Storage Service Options') |
Attila Fazekas | a23f500 | 2012-10-23 19:32:45 +0200 | [diff] [blame] | 490 | |
DennyZhang | 1e71b61 | 2013-09-26 12:35:40 -0500 | [diff] [blame] | 491 | ObjectStoreGroup = [ |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 492 | cfg.StrOpt('catalog_type', |
| 493 | default='object-store', |
| 494 | help="Catalog type of the Object-Storage service."), |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 495 | cfg.StrOpt('region', |
| 496 | default='', |
| 497 | help="The object-storage region name to use. If empty, the " |
| 498 | "value of identity.region is used instead. If no such " |
| 499 | "region is found in the service catalog, the first found " |
| 500 | "one is used."), |
JordanP | 5d29b2c | 2013-12-18 13:56:03 +0000 | [diff] [blame] | 501 | cfg.StrOpt('endpoint_type', |
| 502 | default='publicURL', |
| 503 | choices=['public', 'admin', 'internal', |
| 504 | 'publicURL', 'adminURL', 'internalURL'], |
| 505 | help="The endpoint type to use for the object-store service."), |
Matthew Treinish | f319a73 | 2013-10-24 21:39:24 +0000 | [diff] [blame] | 506 | cfg.IntOpt('container_sync_timeout', |
nayna-patel | b4989b3 | 2013-01-09 06:25:13 +0000 | [diff] [blame] | 507 | default=120, |
Fabien Boucher | 2178d31 | 2013-12-31 15:38:57 +0100 | [diff] [blame] | 508 | help="Number of seconds to time on waiting for a container " |
nayna-patel | b4989b3 | 2013-01-09 06:25:13 +0000 | [diff] [blame] | 509 | "to container synchronization complete."), |
Matthew Treinish | f319a73 | 2013-10-24 21:39:24 +0000 | [diff] [blame] | 510 | cfg.IntOpt('container_sync_interval', |
nayna-patel | b4989b3 | 2013-01-09 06:25:13 +0000 | [diff] [blame] | 511 | default=5, |
Fabien Boucher | 2178d31 | 2013-12-31 15:38:57 +0100 | [diff] [blame] | 512 | help="Number of seconds to wait while looping to check the " |
nayna-patel | b4989b3 | 2013-01-09 06:25:13 +0000 | [diff] [blame] | 513 | "status of a container to container synchronization"), |
Matthew Treinish | 3fdb80c | 2013-08-15 11:13:19 -0400 | [diff] [blame] | 514 | cfg.StrOpt('operator_role', |
| 515 | default='Member', |
| 516 | help="Role to add to users created for swift tests to " |
| 517 | "enable creating containers"), |
Matthew Treinish | 998c91d | 2014-03-01 12:39:49 -0500 | [diff] [blame] | 518 | cfg.StrOpt('reseller_admin_role', |
| 519 | default='ResellerAdmin', |
| 520 | help="User role that has reseller admin"), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 521 | ] |
Attila Fazekas | a23f500 | 2012-10-23 19:32:45 +0200 | [diff] [blame] | 522 | |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 523 | object_storage_feature_group = cfg.OptGroup( |
| 524 | name='object-storage-feature-enabled', |
| 525 | title='Enabled object-storage features') |
| 526 | |
| 527 | ObjectStoreFeaturesGroup = [ |
Matthew Treinish | 2034538 | 2013-12-13 17:04:23 +0000 | [diff] [blame] | 528 | cfg.ListOpt('discoverable_apis', |
| 529 | default=['all'], |
| 530 | help="A list of the enabled optional discoverable apis. " |
| 531 | "A single entry, all, indicates that all of these " |
| 532 | "features are expected to be enabled"), |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 533 | ] |
| 534 | |
Nikhil Manchanda | dd6886f | 2014-03-03 01:58:45 -0800 | [diff] [blame] | 535 | database_group = cfg.OptGroup(name='database', |
| 536 | title='Database Service Options') |
| 537 | |
| 538 | DatabaseGroup = [ |
| 539 | cfg.StrOpt('catalog_type', |
| 540 | default='database', |
| 541 | help="Catalog type of the Database service."), |
| 542 | cfg.StrOpt('db_flavor_ref', |
| 543 | default="1", |
| 544 | help="Valid primary flavor to use in database tests."), |
| 545 | ] |
Attila Fazekas | a23f500 | 2012-10-23 19:32:45 +0200 | [diff] [blame] | 546 | |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 547 | orchestration_group = cfg.OptGroup(name='orchestration', |
| 548 | title='Orchestration Service Options') |
| 549 | |
| 550 | OrchestrationGroup = [ |
| 551 | cfg.StrOpt('catalog_type', |
| 552 | default='orchestration', |
| 553 | help="Catalog type of the Orchestration service."), |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 554 | cfg.StrOpt('region', |
| 555 | default='', |
| 556 | help="The orchestration region name to use. If empty, the " |
| 557 | "value of identity.region is used instead. If no such " |
| 558 | "region is found in the service catalog, the first found " |
| 559 | "one is used."), |
JordanP | 5d29b2c | 2013-12-18 13:56:03 +0000 | [diff] [blame] | 560 | cfg.StrOpt('endpoint_type', |
| 561 | default='publicURL', |
| 562 | choices=['public', 'admin', 'internal', |
| 563 | 'publicURL', 'adminURL', 'internalURL'], |
| 564 | help="The endpoint type to use for the orchestration service."), |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 565 | cfg.BoolOpt('allow_tenant_isolation', |
| 566 | default=False, |
| 567 | help="Allows test cases to create/destroy tenants and " |
| 568 | "users. This option enables isolated test cases and " |
| 569 | "better parallel execution, but also requires that " |
| 570 | "OpenStack Identity API admin credentials are known."), |
| 571 | cfg.IntOpt('build_interval', |
| 572 | default=1, |
| 573 | help="Time in seconds between build status checks."), |
| 574 | cfg.IntOpt('build_timeout', |
Matthew Treinish | a2dfd49 | 2014-04-15 11:15:34 -0400 | [diff] [blame] | 575 | default=1200, |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 576 | help="Timeout in seconds to wait for a stack to build."), |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 577 | cfg.StrOpt('instance_type', |
Steve Baker | 9e86b83 | 2013-05-22 15:40:28 +1200 | [diff] [blame] | 578 | default='m1.micro', |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 579 | help="Instance type for tests. Needs to be big enough for a " |
| 580 | "full OS plus the test workload"), |
| 581 | cfg.StrOpt('image_ref', |
| 582 | default=None, |
| 583 | help="Name of heat-cfntools enabled image to use when " |
| 584 | "launching test instances."), |
| 585 | cfg.StrOpt('keypair_name', |
| 586 | default=None, |
| 587 | help="Name of existing keypair to launch servers with."), |
Clint Byrum | 71f2763 | 2013-09-09 11:41:32 -0700 | [diff] [blame] | 588 | cfg.IntOpt('max_template_size', |
Joe Gordon | 0e51b22 | 2013-10-24 14:11:10 +0100 | [diff] [blame] | 589 | default=524288, |
Clint Byrum | 71f2763 | 2013-09-09 11:41:32 -0700 | [diff] [blame] | 590 | help="Value must match heat configuration of the same name."), |
Steven Hardy | fdc6bd7 | 2014-03-21 16:56:04 +0000 | [diff] [blame] | 591 | cfg.IntOpt('max_resources_per_stack', |
| 592 | default=1000, |
| 593 | help="Value must match heat configuration of the same name."), |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 594 | ] |
| 595 | |
| 596 | |
Yassine Lamgarchal | b158d41 | 2013-12-27 19:29:42 +0100 | [diff] [blame] | 597 | telemetry_group = cfg.OptGroup(name='telemetry', |
| 598 | title='Telemetry Service Options') |
| 599 | |
| 600 | TelemetryGroup = [ |
| 601 | cfg.StrOpt('catalog_type', |
| 602 | default='metering', |
| 603 | help="Catalog type of the Telemetry service."), |
JordanP | fc62c90 | 2014-02-26 14:47:28 +0000 | [diff] [blame] | 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 telemetry service."), |
Yassine Lamgarchal | b158d41 | 2013-12-27 19:29:42 +0100 | [diff] [blame] | 609 | ] |
| 610 | |
| 611 | |
Julie Pichon | d101764 | 2013-07-24 16:37:23 +0100 | [diff] [blame] | 612 | dashboard_group = cfg.OptGroup(name="dashboard", |
| 613 | title="Dashboard options") |
| 614 | |
| 615 | DashboardGroup = [ |
| 616 | cfg.StrOpt('dashboard_url', |
| 617 | default='http://localhost/', |
| 618 | help="Where the dashboard can be found"), |
| 619 | cfg.StrOpt('login_url', |
| 620 | default='http://localhost/auth/login/', |
| 621 | help="Login page for the dashboard"), |
| 622 | ] |
| 623 | |
| 624 | |
Sergey Lukjanov | cec6c3f | 2013-12-10 12:38:21 +0400 | [diff] [blame] | 625 | data_processing_group = cfg.OptGroup(name="data_processing", |
| 626 | title="Data Processing options") |
| 627 | |
| 628 | DataProcessingGroup = [ |
| 629 | cfg.StrOpt('catalog_type', |
| 630 | default='data_processing', |
JordanP | fc62c90 | 2014-02-26 14:47:28 +0000 | [diff] [blame] | 631 | help="Catalog type of the data processing service."), |
| 632 | cfg.StrOpt('endpoint_type', |
| 633 | default='publicURL', |
| 634 | choices=['public', 'admin', 'internal', |
| 635 | 'publicURL', 'adminURL', 'internalURL'], |
| 636 | help="The endpoint type to use for the data processing " |
| 637 | "service."), |
Sergey Lukjanov | cec6c3f | 2013-12-10 12:38:21 +0400 | [diff] [blame] | 638 | ] |
| 639 | |
| 640 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 641 | boto_group = cfg.OptGroup(name='boto', |
| 642 | title='EC2/S3 options') |
DennyZhang | 1e71b61 | 2013-09-26 12:35:40 -0500 | [diff] [blame] | 643 | BotoGroup = [ |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 644 | cfg.StrOpt('ec2_url', |
| 645 | default="http://localhost:8773/services/Cloud", |
| 646 | help="EC2 URL"), |
| 647 | cfg.StrOpt('s3_url', |
| 648 | default="http://localhost:8080", |
| 649 | help="S3 URL"), |
| 650 | cfg.StrOpt('aws_secret', |
| 651 | default=None, |
| 652 | help="AWS Secret Key", |
| 653 | secret=True), |
| 654 | cfg.StrOpt('aws_access', |
| 655 | default=None, |
| 656 | help="AWS Access Key"), |
Attila Fazekas | 27dd92e | 2014-02-21 14:49:40 +0100 | [diff] [blame] | 657 | cfg.StrOpt('aws_zone', |
| 658 | default="nova", |
| 659 | help="AWS Zone for EC2 tests"), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 660 | cfg.StrOpt('s3_materials_path', |
| 661 | default="/opt/stack/devstack/files/images/" |
| 662 | "s3-materials/cirros-0.3.0", |
| 663 | help="S3 Materials Path"), |
| 664 | cfg.StrOpt('ari_manifest', |
| 665 | default="cirros-0.3.0-x86_64-initrd.manifest.xml", |
| 666 | help="ARI Ramdisk Image manifest"), |
| 667 | cfg.StrOpt('ami_manifest', |
| 668 | default="cirros-0.3.0-x86_64-blank.img.manifest.xml", |
| 669 | help="AMI Machine Image manifest"), |
| 670 | cfg.StrOpt('aki_manifest', |
| 671 | default="cirros-0.3.0-x86_64-vmlinuz.manifest.xml", |
| 672 | help="AKI Kernel Image manifest"), |
| 673 | cfg.StrOpt('instance_type', |
| 674 | default="m1.tiny", |
| 675 | help="Instance type"), |
| 676 | cfg.IntOpt('http_socket_timeout', |
| 677 | default=3, |
| 678 | help="boto Http socket timeout"), |
| 679 | cfg.IntOpt('num_retries', |
| 680 | default=1, |
| 681 | help="boto num_retries on error"), |
| 682 | cfg.IntOpt('build_timeout', |
| 683 | default=60, |
| 684 | help="Status Change Timeout"), |
| 685 | cfg.IntOpt('build_interval', |
| 686 | default=1, |
| 687 | help="Status Change Test Interval"), |
| 688 | ] |
Attila Fazekas | f7f2d93 | 2012-12-13 09:14:38 +0100 | [diff] [blame] | 689 | |
Matthew Treinish | 615ea6a | 2013-02-25 17:26:59 -0500 | [diff] [blame] | 690 | stress_group = cfg.OptGroup(name='stress', title='Stress Test Options') |
| 691 | |
| 692 | StressGroup = [ |
| 693 | cfg.StrOpt('nova_logdir', |
| 694 | default=None, |
| 695 | help='Directory containing log files on the compute nodes'), |
| 696 | cfg.IntOpt('max_instances', |
| 697 | default=16, |
| 698 | help='Maximum number of instances to create during test.'), |
| 699 | cfg.StrOpt('controller', |
| 700 | default=None, |
David Kranz | b9d9750 | 2013-05-01 15:55:04 -0400 | [diff] [blame] | 701 | help='Controller host.'), |
| 702 | # new stress options |
| 703 | cfg.StrOpt('target_controller', |
| 704 | default=None, |
| 705 | help='Controller host.'), |
| 706 | cfg.StrOpt('target_ssh_user', |
| 707 | default=None, |
| 708 | help='ssh user.'), |
| 709 | cfg.StrOpt('target_private_key_path', |
| 710 | default=None, |
| 711 | help='Path to private key.'), |
| 712 | cfg.StrOpt('target_logfiles', |
| 713 | default=None, |
| 714 | help='regexp for list of log files.'), |
Matthew Treinish | f319a73 | 2013-10-24 21:39:24 +0000 | [diff] [blame] | 715 | cfg.IntOpt('log_check_interval', |
David Kranz | b9d9750 | 2013-05-01 15:55:04 -0400 | [diff] [blame] | 716 | default=60, |
Marc Koderer | 32221b8e | 2013-08-23 13:57:50 +0200 | [diff] [blame] | 717 | help='time (in seconds) between log file error checks.'), |
Matthew Treinish | f319a73 | 2013-10-24 21:39:24 +0000 | [diff] [blame] | 718 | cfg.IntOpt('default_thread_number_per_action', |
Marc Koderer | 32221b8e | 2013-08-23 13:57:50 +0200 | [diff] [blame] | 719 | default=4, |
Julien Leloup | 04d40f7 | 2014-01-28 11:17:18 +0100 | [diff] [blame] | 720 | help='The number of threads created while stress test.'), |
| 721 | cfg.BoolOpt('leave_dirty_stack', |
| 722 | default=False, |
| 723 | help='Prevent the cleaning (tearDownClass()) between' |
| 724 | ' each stress test run if an exception occurs' |
Julien Leloup | a5ee542 | 2014-02-13 14:29:02 +0100 | [diff] [blame] | 725 | ' during this run.'), |
| 726 | cfg.BoolOpt('full_clean_stack', |
| 727 | default=False, |
| 728 | help='Allows a full cleaning process after a stress test.' |
| 729 | ' Caution : this cleanup will remove every objects of' |
| 730 | ' every tenant.') |
Matthew Treinish | 615ea6a | 2013-02-25 17:26:59 -0500 | [diff] [blame] | 731 | ] |
| 732 | |
| 733 | |
Masayuki Igawa | 73d9f3a | 2013-05-24 10:30:01 +0900 | [diff] [blame] | 734 | scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options') |
| 735 | |
| 736 | ScenarioGroup = [ |
| 737 | cfg.StrOpt('img_dir', |
| 738 | default='/opt/stack/new/devstack/files/images/' |
| 739 | 'cirros-0.3.1-x86_64-uec', |
| 740 | help='Directory containing image files'), |
Masayuki Igawa | 4f71bf0 | 2014-02-21 14:02:29 +0900 | [diff] [blame] | 741 | cfg.StrOpt('qcow2_img_file', |
| 742 | default='cirros-0.3.1-x86_64-disk.img', |
| 743 | help='QCOW2 image file name'), |
Masayuki Igawa | 73d9f3a | 2013-05-24 10:30:01 +0900 | [diff] [blame] | 744 | cfg.StrOpt('ami_img_file', |
| 745 | default='cirros-0.3.1-x86_64-blank.img', |
| 746 | help='AMI image file name'), |
| 747 | cfg.StrOpt('ari_img_file', |
| 748 | default='cirros-0.3.1-x86_64-initrd', |
| 749 | help='ARI image file name'), |
| 750 | cfg.StrOpt('aki_img_file', |
| 751 | default='cirros-0.3.1-x86_64-vmlinuz', |
| 752 | help='AKI image file name'), |
| 753 | cfg.StrOpt('ssh_user', |
| 754 | default='cirros', |
Joe Gordon | b5e10cd | 2013-07-10 15:51:12 +0000 | [diff] [blame] | 755 | help='ssh username for the image file'), |
| 756 | cfg.IntOpt( |
| 757 | 'large_ops_number', |
| 758 | default=0, |
| 759 | help="specifies how many resources to request at once. Used " |
| 760 | "for large operations testing.") |
Masayuki Igawa | 73d9f3a | 2013-05-24 10:30:01 +0900 | [diff] [blame] | 761 | ] |
| 762 | |
| 763 | |
Matthew Treinish | 4c41292 | 2013-07-16 15:27:42 -0400 | [diff] [blame] | 764 | service_available_group = cfg.OptGroup(name="service_available", |
| 765 | title="Available OpenStack Services") |
| 766 | |
| 767 | ServiceAvailableGroup = [ |
| 768 | cfg.BoolOpt('cinder', |
| 769 | default=True, |
| 770 | help="Whether or not cinder is expected to be available"), |
Matthew Treinish | faa340d | 2013-07-19 16:26:21 -0400 | [diff] [blame] | 771 | cfg.BoolOpt('neutron', |
| 772 | default=False, |
| 773 | help="Whether or not neutron is expected to be available"), |
Matthew Treinish | 853ae44 | 2013-07-19 16:36:07 -0400 | [diff] [blame] | 774 | cfg.BoolOpt('glance', |
| 775 | default=True, |
| 776 | help="Whether or not glance is expected to be available"), |
Matthew Treinish | 61e332b | 2013-07-19 16:42:31 -0400 | [diff] [blame] | 777 | cfg.BoolOpt('swift', |
| 778 | default=True, |
| 779 | help="Whether or not swift is expected to be available"), |
Matthew Treinish | 6b41e24 | 2013-07-19 16:49:28 -0400 | [diff] [blame] | 780 | cfg.BoolOpt('nova', |
| 781 | default=True, |
| 782 | help="Whether or not nova is expected to be available"), |
Matthew Treinish | a9d4388 | 2013-07-19 16:54:52 -0400 | [diff] [blame] | 783 | cfg.BoolOpt('heat', |
| 784 | default=False, |
| 785 | help="Whether or not Heat is expected to be available"), |
Mehdi Abaakouk | 8581c0b | 2013-10-04 10:45:42 +0200 | [diff] [blame] | 786 | cfg.BoolOpt('ceilometer', |
| 787 | default=True, |
| 788 | help="Whether or not Ceilometer is expected to be available"), |
Julie Pichon | d101764 | 2013-07-24 16:37:23 +0100 | [diff] [blame] | 789 | cfg.BoolOpt('horizon', |
| 790 | default=True, |
| 791 | help="Whether or not Horizon is expected to be available"), |
Sergey Lukjanov | 9c95a25 | 2014-03-13 23:59:22 +0400 | [diff] [blame] | 792 | cfg.BoolOpt('sahara', |
Sergey Lukjanov | cec6c3f | 2013-12-10 12:38:21 +0400 | [diff] [blame] | 793 | default=False, |
Sergey Lukjanov | 9c95a25 | 2014-03-13 23:59:22 +0400 | [diff] [blame] | 794 | help="Whether or not Sahara is expected to be available"), |
Roman Prykhodchenko | 62b1ed1 | 2013-10-16 21:51:47 +0300 | [diff] [blame] | 795 | cfg.BoolOpt('ironic', |
| 796 | default=False, |
| 797 | help="Whether or not Ironic is expected to be available"), |
Nikhil Manchanda | dd6886f | 2014-03-03 01:58:45 -0800 | [diff] [blame] | 798 | cfg.BoolOpt('trove', |
| 799 | default=False, |
| 800 | help="Whether or not Trove is expected to be available"), |
Malini Kamalambal | 6e7b3b8 | 2014-02-06 06:49:04 -0500 | [diff] [blame] | 801 | cfg.BoolOpt('marconi', |
| 802 | default=False, |
| 803 | help="Whether or not Marconi is expected to be available"), |
Matthew Treinish | 4c41292 | 2013-07-16 15:27:42 -0400 | [diff] [blame] | 804 | ] |
| 805 | |
Attila Fazekas | aeeeefd | 2013-08-06 17:01:56 +0200 | [diff] [blame] | 806 | debug_group = cfg.OptGroup(name="debug", |
| 807 | title="Debug System") |
| 808 | |
| 809 | DebugGroup = [ |
| 810 | cfg.BoolOpt('enable', |
| 811 | default=True, |
| 812 | help="Enable diagnostic commands"), |
Sean Dague | c522c09 | 2014-03-24 10:43:22 -0400 | [diff] [blame] | 813 | cfg.StrOpt('trace_requests', |
| 814 | default='', |
| 815 | help="""A regex to determine which requests should be traced. |
| 816 | |
| 817 | This is a regex to match the caller for rest client requests to be able to |
| 818 | selectively trace calls out of specific classes and methods. It largely |
| 819 | exists for test development, and is not expected to be used in a real deploy |
| 820 | of tempest. This will be matched against the discovered ClassName:method |
| 821 | in the test environment. |
| 822 | |
| 823 | Expected values for this field are: |
| 824 | |
| 825 | * ClassName:test_method_name - traces one test_method |
| 826 | * ClassName:setUp(Class) - traces specific setup functions |
| 827 | * ClassName:tearDown(Class) - traces specific teardown functions |
| 828 | * ClassName:_run_cleanups - traces the cleanup functions |
| 829 | |
| 830 | If nothing is specified, this feature is not enabled. To trace everything |
| 831 | specify .* as the regex. |
| 832 | """) |
Attila Fazekas | aeeeefd | 2013-08-06 17:01:56 +0200 | [diff] [blame] | 833 | ] |
| 834 | |
Andrea Frittoli | f5da28b | 2013-12-06 07:08:07 +0000 | [diff] [blame] | 835 | input_scenario_group = cfg.OptGroup(name="input-scenario", |
| 836 | title="Filters and values for" |
| 837 | " input scenarios") |
| 838 | |
| 839 | InputScenarioGroup = [ |
| 840 | cfg.StrOpt('image_regex', |
| 841 | default='^cirros-0.3.1-x86_64-uec$', |
| 842 | help="Matching images become parameters for scenario tests"), |
| 843 | cfg.StrOpt('flavor_regex', |
Andrea Frittoli | 99901c0 | 2014-01-30 18:06:49 +0000 | [diff] [blame] | 844 | default='^m1.nano$', |
Andrea Frittoli | f5da28b | 2013-12-06 07:08:07 +0000 | [diff] [blame] | 845 | help="Matching flavors become parameters for scenario tests"), |
| 846 | cfg.StrOpt('non_ssh_image_regex', |
| 847 | default='^.*[Ww]in.*$', |
| 848 | help="SSH verification in tests is skipped" |
| 849 | "for matching images"), |
| 850 | cfg.StrOpt('ssh_user_regex', |
| 851 | default="[[\"^.*[Cc]irros.*$\", \"root\"]]", |
| 852 | help="List of user mapped to regex " |
| 853 | "to matching image names."), |
| 854 | ] |
| 855 | |
Attila Fazekas | aeeeefd | 2013-08-06 17:01:56 +0200 | [diff] [blame] | 856 | |
Roman Prykhodchenko | 62b1ed1 | 2013-10-16 21:51:47 +0300 | [diff] [blame] | 857 | baremetal_group = cfg.OptGroup(name='baremetal', |
| 858 | title='Baremetal provisioning service options') |
| 859 | |
| 860 | BaremetalGroup = [ |
| 861 | cfg.StrOpt('catalog_type', |
| 862 | default='baremetal', |
Adam Gandelman | 4a48a60 | 2014-03-20 18:23:18 -0700 | [diff] [blame] | 863 | help="Catalog type of the baremetal provisioning service"), |
| 864 | cfg.BoolOpt('driver_enabled', |
| 865 | default=False, |
| 866 | help="Whether the Ironic nova-compute driver is enabled"), |
JordanP | fc62c90 | 2014-02-26 14:47:28 +0000 | [diff] [blame] | 867 | cfg.StrOpt('endpoint_type', |
| 868 | default='publicURL', |
| 869 | choices=['public', 'admin', 'internal', |
| 870 | 'publicURL', 'adminURL', 'internalURL'], |
| 871 | help="The endpoint type to use for the baremetal provisioning " |
Adam Gandelman | 4a48a60 | 2014-03-20 18:23:18 -0700 | [diff] [blame] | 872 | "service"), |
| 873 | cfg.IntOpt('active_timeout', |
| 874 | default=300, |
| 875 | help="Timeout for Ironic node to completely provision"), |
| 876 | cfg.IntOpt('association_timeout', |
| 877 | default=10, |
| 878 | help="Timeout for association of Nova instance and Ironic " |
| 879 | "node"), |
| 880 | cfg.IntOpt('power_timeout', |
| 881 | default=20, |
| 882 | help="Timeout for Ironic power transitions."), |
| 883 | cfg.IntOpt('unprovision_timeout', |
| 884 | default=20, |
| 885 | help="Timeout for unprovisioning an Ironic node.") |
Roman Prykhodchenko | 62b1ed1 | 2013-10-16 21:51:47 +0300 | [diff] [blame] | 886 | ] |
| 887 | |
Matthew Treinish | e2b56b5 | 2014-01-29 19:25:50 +0000 | [diff] [blame] | 888 | cli_group = cfg.OptGroup(name='cli', title="cli Configuration Options") |
| 889 | |
| 890 | CLIGroup = [ |
| 891 | cfg.BoolOpt('enabled', |
| 892 | default=True, |
| 893 | help="enable cli tests"), |
| 894 | cfg.StrOpt('cli_dir', |
| 895 | default='/usr/local/bin', |
| 896 | help="directory where python client binaries are located"), |
Sean Dague | 44b2468 | 2014-02-20 19:08:24 -0500 | [diff] [blame] | 897 | cfg.BoolOpt('has_manage', |
| 898 | default=True, |
| 899 | help=("Whether the tempest run location has access to the " |
| 900 | "*-manage commands. In a pure blackbox environment " |
| 901 | "it will not.")), |
Matthew Treinish | e2b56b5 | 2014-01-29 19:25:50 +0000 | [diff] [blame] | 902 | cfg.IntOpt('timeout', |
| 903 | default=15, |
| 904 | help="Number of seconds to wait on a CLI timeout"), |
| 905 | ] |
| 906 | |
Marc Koderer | 6ee82dc | 2014-02-17 10:26:29 +0100 | [diff] [blame] | 907 | negative_group = cfg.OptGroup(name='negative', title="Negative Test Options") |
| 908 | |
| 909 | NegativeGroup = [ |
| 910 | cfg.StrOpt('test_generator', |
| 911 | default='tempest.common.' + |
| 912 | 'generator.negative_generator.NegativeTestGenerator', |
| 913 | help="Test generator class for all negative tests"), |
| 914 | ] |
| 915 | |
Roman Prykhodchenko | 62b1ed1 | 2013-10-16 21:51:47 +0300 | [diff] [blame] | 916 | |
Matthew Treinish | 43b296a | 2014-02-28 15:23:00 -0500 | [diff] [blame] | 917 | def register_opts(): |
| 918 | register_opt_group(cfg.CONF, compute_group, ComputeGroup) |
| 919 | register_opt_group(cfg.CONF, compute_features_group, |
| 920 | ComputeFeaturesGroup) |
| 921 | register_opt_group(cfg.CONF, identity_group, IdentityGroup) |
| 922 | register_opt_group(cfg.CONF, identity_feature_group, |
| 923 | IdentityFeatureGroup) |
| 924 | register_opt_group(cfg.CONF, image_group, ImageGroup) |
| 925 | register_opt_group(cfg.CONF, image_feature_group, ImageFeaturesGroup) |
| 926 | register_opt_group(cfg.CONF, network_group, NetworkGroup) |
| 927 | register_opt_group(cfg.CONF, network_feature_group, |
| 928 | NetworkFeaturesGroup) |
Malini Kamalambal | 6e7b3b8 | 2014-02-06 06:49:04 -0500 | [diff] [blame] | 929 | register_opt_group(cfg.CONF, queuing_group, QueuingGroup) |
Matthew Treinish | 43b296a | 2014-02-28 15:23:00 -0500 | [diff] [blame] | 930 | register_opt_group(cfg.CONF, volume_group, VolumeGroup) |
| 931 | register_opt_group(cfg.CONF, volume_feature_group, |
| 932 | VolumeFeaturesGroup) |
| 933 | register_opt_group(cfg.CONF, object_storage_group, ObjectStoreGroup) |
| 934 | register_opt_group(cfg.CONF, object_storage_feature_group, |
| 935 | ObjectStoreFeaturesGroup) |
Nikhil Manchanda | dd6886f | 2014-03-03 01:58:45 -0800 | [diff] [blame] | 936 | register_opt_group(cfg.CONF, database_group, DatabaseGroup) |
Matthew Treinish | 43b296a | 2014-02-28 15:23:00 -0500 | [diff] [blame] | 937 | register_opt_group(cfg.CONF, orchestration_group, OrchestrationGroup) |
| 938 | register_opt_group(cfg.CONF, telemetry_group, TelemetryGroup) |
| 939 | register_opt_group(cfg.CONF, dashboard_group, DashboardGroup) |
| 940 | register_opt_group(cfg.CONF, data_processing_group, |
| 941 | DataProcessingGroup) |
| 942 | register_opt_group(cfg.CONF, boto_group, BotoGroup) |
| 943 | register_opt_group(cfg.CONF, compute_admin_group, ComputeAdminGroup) |
| 944 | register_opt_group(cfg.CONF, stress_group, StressGroup) |
| 945 | register_opt_group(cfg.CONF, scenario_group, ScenarioGroup) |
| 946 | register_opt_group(cfg.CONF, service_available_group, |
| 947 | ServiceAvailableGroup) |
| 948 | register_opt_group(cfg.CONF, debug_group, DebugGroup) |
| 949 | register_opt_group(cfg.CONF, baremetal_group, BaremetalGroup) |
| 950 | register_opt_group(cfg.CONF, input_scenario_group, InputScenarioGroup) |
| 951 | register_opt_group(cfg.CONF, cli_group, CLIGroup) |
Marc Koderer | 6ee82dc | 2014-02-17 10:26:29 +0100 | [diff] [blame] | 952 | register_opt_group(cfg.CONF, negative_group, NegativeGroup) |
Matthew Treinish | 43b296a | 2014-02-28 15:23:00 -0500 | [diff] [blame] | 953 | |
| 954 | |
Sean Dague | 3b9b1f3 | 2013-12-20 17:04:54 -0500 | [diff] [blame] | 955 | # this should never be called outside of this class |
| 956 | class TempestConfigPrivate(object): |
Daryl Walleck | 1465d61 | 2011-11-02 02:22:15 -0500 | [diff] [blame] | 957 | """Provides OpenStack configuration information.""" |
| 958 | |
Brian Waldon | 738cd63 | 2011-12-12 18:45:09 -0500 | [diff] [blame] | 959 | DEFAULT_CONFIG_DIR = os.path.join( |
Zhongyue Luo | a1343de | 2013-01-04 16:21:35 +0800 | [diff] [blame] | 960 | os.path.abspath(os.path.dirname(os.path.dirname(__file__))), |
Brian Waldon | 738cd63 | 2011-12-12 18:45:09 -0500 | [diff] [blame] | 961 | "etc") |
Daryl Walleck | 1465d61 | 2011-11-02 02:22:15 -0500 | [diff] [blame] | 962 | |
Brian Waldon | 738cd63 | 2011-12-12 18:45:09 -0500 | [diff] [blame] | 963 | DEFAULT_CONFIG_FILE = "tempest.conf" |
| 964 | |
Matthew Treinish | 43b296a | 2014-02-28 15:23:00 -0500 | [diff] [blame] | 965 | def _set_attrs(self): |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 966 | self.compute = cfg.CONF.compute |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 967 | self.compute_feature_enabled = cfg.CONF['compute-feature-enabled'] |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 968 | self.identity = cfg.CONF.identity |
Matthew Treinish | d5021a7 | 2014-01-09 18:42:51 +0000 | [diff] [blame] | 969 | self.identity_feature_enabled = cfg.CONF['identity-feature-enabled'] |
Matt Riedemann | d3efe90 | 2014-02-10 06:46:38 -0800 | [diff] [blame] | 970 | self.image = cfg.CONF.image |
Matthew Treinish | 2b5287d | 2013-10-22 17:40:34 +0000 | [diff] [blame] | 971 | self.image_feature_enabled = cfg.CONF['image-feature-enabled'] |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 972 | self.network = cfg.CONF.network |
Matthew Treinish | e3d2614 | 2013-11-26 19:14:58 +0000 | [diff] [blame] | 973 | self.network_feature_enabled = cfg.CONF['network-feature-enabled'] |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 974 | self.volume = cfg.CONF.volume |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 975 | self.volume_feature_enabled = cfg.CONF['volume-feature-enabled'] |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 976 | self.object_storage = cfg.CONF['object-storage'] |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 977 | self.object_storage_feature_enabled = cfg.CONF[ |
| 978 | 'object-storage-feature-enabled'] |
Nikhil Manchanda | dd6886f | 2014-03-03 01:58:45 -0800 | [diff] [blame] | 979 | self.database = cfg.CONF.database |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 980 | self.orchestration = cfg.CONF.orchestration |
Malini Kamalambal | 6e7b3b8 | 2014-02-06 06:49:04 -0500 | [diff] [blame] | 981 | self.queuing = cfg.CONF.queuing |
Yassine Lamgarchal | b158d41 | 2013-12-27 19:29:42 +0100 | [diff] [blame] | 982 | self.telemetry = cfg.CONF.telemetry |
Julie Pichon | d101764 | 2013-07-24 16:37:23 +0100 | [diff] [blame] | 983 | self.dashboard = cfg.CONF.dashboard |
Sergey Lukjanov | cec6c3f | 2013-12-10 12:38:21 +0400 | [diff] [blame] | 984 | self.data_processing = cfg.CONF.data_processing |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 985 | self.boto = cfg.CONF.boto |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 986 | self.compute_admin = cfg.CONF['compute-admin'] |
Matthew Treinish | 615ea6a | 2013-02-25 17:26:59 -0500 | [diff] [blame] | 987 | self.stress = cfg.CONF.stress |
Masayuki Igawa | 73d9f3a | 2013-05-24 10:30:01 +0900 | [diff] [blame] | 988 | self.scenario = cfg.CONF.scenario |
Matthew Treinish | 4c41292 | 2013-07-16 15:27:42 -0400 | [diff] [blame] | 989 | self.service_available = cfg.CONF.service_available |
Attila Fazekas | 5fae7a3 | 2013-09-25 16:52:44 +0200 | [diff] [blame] | 990 | self.debug = cfg.CONF.debug |
Roman Prykhodchenko | 62b1ed1 | 2013-10-16 21:51:47 +0300 | [diff] [blame] | 991 | self.baremetal = cfg.CONF.baremetal |
Andrea Frittoli | f5da28b | 2013-12-06 07:08:07 +0000 | [diff] [blame] | 992 | self.input_scenario = cfg.CONF['input-scenario'] |
Matthew Treinish | e2b56b5 | 2014-01-29 19:25:50 +0000 | [diff] [blame] | 993 | self.cli = cfg.CONF.cli |
Marc Koderer | 6ee82dc | 2014-02-17 10:26:29 +0100 | [diff] [blame] | 994 | self.negative = cfg.CONF.negative |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 995 | if not self.compute_admin.username: |
| 996 | self.compute_admin.username = self.identity.admin_username |
| 997 | self.compute_admin.password = self.identity.admin_password |
| 998 | self.compute_admin.tenant_name = self.identity.admin_tenant_name |
Sean Dague | 86bd842 | 2013-12-20 09:56:44 -0500 | [diff] [blame] | 999 | |
Matthew Treinish | 43b296a | 2014-02-28 15:23:00 -0500 | [diff] [blame] | 1000 | def __init__(self, parse_conf=True): |
| 1001 | """Initialize a configuration from a conf directory and conf file.""" |
| 1002 | super(TempestConfigPrivate, self).__init__() |
| 1003 | config_files = [] |
| 1004 | failsafe_path = "/etc/tempest/" + self.DEFAULT_CONFIG_FILE |
| 1005 | |
| 1006 | # Environment variables override defaults... |
| 1007 | conf_dir = os.environ.get('TEMPEST_CONFIG_DIR', |
| 1008 | self.DEFAULT_CONFIG_DIR) |
| 1009 | conf_file = os.environ.get('TEMPEST_CONFIG', self.DEFAULT_CONFIG_FILE) |
| 1010 | |
| 1011 | path = os.path.join(conf_dir, conf_file) |
| 1012 | |
| 1013 | if not os.path.isfile(path): |
| 1014 | path = failsafe_path |
| 1015 | |
| 1016 | # only parse the config file if we expect one to exist. This is needed |
| 1017 | # to remove an issue with the config file up to date checker. |
| 1018 | if parse_conf: |
| 1019 | config_files.append(path) |
| 1020 | |
| 1021 | cfg.CONF([], project='tempest', default_config_files=config_files) |
| 1022 | logging.setup('tempest') |
| 1023 | LOG = logging.getLogger('tempest') |
| 1024 | LOG.info("Using tempest config file %s" % path) |
| 1025 | register_opts() |
| 1026 | self._set_attrs() |
Masayuki Igawa | 9ec4cd8 | 2014-02-05 15:04:16 +0900 | [diff] [blame] | 1027 | if parse_conf: |
| 1028 | cfg.CONF.log_opt_values(LOG, std_logging.DEBUG) |
| 1029 | |
Sean Dague | 86bd842 | 2013-12-20 09:56:44 -0500 | [diff] [blame] | 1030 | |
| 1031 | class TempestConfigProxy(object): |
| 1032 | _config = None |
| 1033 | |
| 1034 | def __getattr__(self, attr): |
| 1035 | if not self._config: |
Sean Dague | 3b9b1f3 | 2013-12-20 17:04:54 -0500 | [diff] [blame] | 1036 | self._config = TempestConfigPrivate() |
Sean Dague | 86bd842 | 2013-12-20 09:56:44 -0500 | [diff] [blame] | 1037 | |
| 1038 | return getattr(self._config, attr) |
| 1039 | |
| 1040 | |
| 1041 | CONF = TempestConfigProxy() |