Jay Pipes | 3f981df | 2012-03-27 18:59:44 -0400 | [diff] [blame] | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4 |
| 2 | |
ZhiQiang Fan | 39f9722 | 2013-09-20 04:49:44 +0800 | [diff] [blame] | 3 | # Copyright 2012 OpenStack Foundation |
Jay Pipes | 3f981df | 2012-03-27 18:59:44 -0400 | [diff] [blame] | 4 | # All Rights Reserved. |
| 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 7 | # not use this file except in compliance with the License. You may obtain |
| 8 | # a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 15 | # License for the specific language governing permissions and limitations |
| 16 | # under the License. |
| 17 | |
Dirk Mueller | e746fc2 | 2013-06-29 16:29:29 +0200 | [diff] [blame] | 18 | from __future__ import print_function |
| 19 | |
Jay Pipes | 7f75763 | 2011-12-02 15:53:32 -0500 | [diff] [blame] | 20 | import os |
Jay Pipes | 3f981df | 2012-03-27 18:59:44 -0400 | [diff] [blame] | 21 | |
Matthew Treinish | 90aedd1 | 2013-02-25 17:56:49 -0500 | [diff] [blame] | 22 | from oslo.config import cfg |
| 23 | |
Matthew Treinish | f4a9b0f | 2013-07-26 16:58:26 -0400 | [diff] [blame] | 24 | from tempest.openstack.common import log as logging |
Jay Pipes | 7f75763 | 2011-12-02 15:53:32 -0500 | [diff] [blame] | 25 | |
Daryl Walleck | 1465d61 | 2011-11-02 02:22:15 -0500 | [diff] [blame] | 26 | |
DennyZhang | 88a2dd8 | 2013-10-07 12:55:35 -0500 | [diff] [blame] | 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 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 33 | identity_group = cfg.OptGroup(name='identity', |
| 34 | title="Keystone Configuration Options") |
Daryl Walleck | 1465d61 | 2011-11-02 02:22:15 -0500 | [diff] [blame] | 35 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 36 | IdentityGroup = [ |
| 37 | cfg.StrOpt('catalog_type', |
| 38 | default='identity', |
| 39 | help="Catalog type of the Identity service."), |
Jay Pipes | cd8eaec | 2013-01-16 21:03:48 -0500 | [diff] [blame] | 40 | cfg.BoolOpt('disable_ssl_certificate_validation', |
| 41 | default=False, |
| 42 | help="Set to True if using self-signed SSL certificates."), |
Jay Pipes | 7c88eb2 | 2013-01-16 21:32:43 -0500 | [diff] [blame] | 43 | cfg.StrOpt('uri', |
| 44 | default=None, |
Brant Knudson | c7ca334 | 2013-03-28 21:08:50 -0500 | [diff] [blame] | 45 | help="Full URI of the OpenStack Identity API (Keystone), v2"), |
| 46 | cfg.StrOpt('uri_v3', |
| 47 | help='Full URI of the OpenStack Identity API (Keystone), v3'), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 48 | cfg.StrOpt('region', |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 49 | default='RegionOne', |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 50 | help="The identity region name to use. Also used as the other " |
| 51 | "services' region name unless they are set explicitly. " |
| 52 | "If no such region is found in the service catalog, the " |
| 53 | "first found one is used."), |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 54 | cfg.StrOpt('username', |
| 55 | default='demo', |
| 56 | help="Username to use for Nova API requests."), |
| 57 | cfg.StrOpt('tenant_name', |
| 58 | default='demo', |
| 59 | help="Tenant name to use for Nova API requests."), |
Russell Sim | 7f894a5 | 2013-09-13 10:35:21 +1000 | [diff] [blame] | 60 | cfg.StrOpt('admin_role', |
| 61 | default='admin', |
| 62 | help="Role required to administrate keystone."), |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 63 | cfg.StrOpt('password', |
| 64 | default='pass', |
| 65 | help="API key to use when authenticating.", |
| 66 | secret=True), |
| 67 | cfg.StrOpt('alt_username', |
| 68 | default=None, |
| 69 | help="Username of alternate user to use for Nova API " |
| 70 | "requests."), |
| 71 | cfg.StrOpt('alt_tenant_name', |
| 72 | default=None, |
| 73 | help="Alternate user's Tenant name to use for Nova API " |
| 74 | "requests."), |
| 75 | cfg.StrOpt('alt_password', |
| 76 | default=None, |
| 77 | help="API key to use when authenticating as alternate user.", |
| 78 | secret=True), |
| 79 | cfg.StrOpt('admin_username', |
| 80 | default='admin', |
| 81 | help="Administrative Username to use for" |
| 82 | "Keystone API requests."), |
| 83 | cfg.StrOpt('admin_tenant_name', |
| 84 | default='admin', |
| 85 | help="Administrative Tenant name to use for Keystone API " |
| 86 | "requests."), |
| 87 | cfg.StrOpt('admin_password', |
| 88 | default='pass', |
| 89 | help="API key to use when authenticating as admin.", |
| 90 | secret=True), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 91 | ] |
Jay Pipes | 3f981df | 2012-03-27 18:59:44 -0400 | [diff] [blame] | 92 | |
Matthew Treinish | d5021a7 | 2014-01-09 18:42:51 +0000 | [diff] [blame^] | 93 | identity_feature_group = cfg.OptGroup(name='identity-feature-enabled', |
| 94 | title='Enabled Identity Features') |
| 95 | |
| 96 | IdentityFeatureGroup = [ |
| 97 | cfg.BoolOpt('trust', |
| 98 | default=True, |
| 99 | help='Does the identity service have delegation and ' |
| 100 | 'impersonation enabled') |
| 101 | ] |
| 102 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 103 | compute_group = cfg.OptGroup(name='compute', |
| 104 | title='Compute Service Options') |
Rohit Karajgi | e1b050d | 2011-12-02 16:13:18 -0800 | [diff] [blame] | 105 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 106 | ComputeGroup = [ |
| 107 | cfg.BoolOpt('allow_tenant_isolation', |
| 108 | default=False, |
| 109 | help="Allows test cases to create/destroy tenants and " |
| 110 | "users. This option enables isolated test cases and " |
| 111 | "better parallel execution, but also requires that " |
| 112 | "OpenStack Identity API admin credentials are known."), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 113 | cfg.StrOpt('image_ref', |
| 114 | default="{$IMAGE_ID}", |
| 115 | help="Valid secondary image reference to be used in tests."), |
| 116 | cfg.StrOpt('image_ref_alt', |
| 117 | default="{$IMAGE_ID_ALT}", |
| 118 | help="Valid secondary image reference to be used in tests."), |
Ken'ichi Ohmichi | 3577260 | 2013-11-14 15:03:27 +0900 | [diff] [blame] | 119 | cfg.StrOpt('flavor_ref', |
| 120 | default="1", |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 121 | help="Valid primary flavor to use in tests."), |
Ken'ichi Ohmichi | 3577260 | 2013-11-14 15:03:27 +0900 | [diff] [blame] | 122 | cfg.StrOpt('flavor_ref_alt', |
| 123 | default="2", |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 124 | help='Valid secondary flavor to be used in tests.'), |
Maru Newby | af292e8 | 2013-05-20 21:32:28 +0000 | [diff] [blame] | 125 | cfg.StrOpt('image_ssh_user', |
| 126 | default="root", |
| 127 | help="User name used to authenticate to an instance."), |
Ryan Hsu | cb2e125 | 2013-09-03 21:44:49 -0700 | [diff] [blame] | 128 | cfg.StrOpt('image_ssh_password', |
| 129 | default="password", |
| 130 | help="Password used to authenticate to an instance."), |
Maru Newby | af292e8 | 2013-05-20 21:32:28 +0000 | [diff] [blame] | 131 | cfg.StrOpt('image_alt_ssh_user', |
| 132 | default="root", |
| 133 | help="User name used to authenticate to an instance using " |
| 134 | "the alternate image."), |
Ryan Hsu | cb2e125 | 2013-09-03 21:44:49 -0700 | [diff] [blame] | 135 | cfg.StrOpt('image_alt_ssh_password', |
| 136 | default="password", |
| 137 | help="Password used to authenticate to an instance using " |
| 138 | "the alternate image."), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 139 | cfg.IntOpt('build_interval', |
| 140 | default=10, |
| 141 | help="Time in seconds between build status checks."), |
| 142 | cfg.IntOpt('build_timeout', |
| 143 | default=300, |
| 144 | help="Timeout in seconds to wait for an instance to build."), |
| 145 | cfg.BoolOpt('run_ssh', |
| 146 | default=False, |
Derek Higgins | 85cd514 | 2013-12-17 17:10:11 +0000 | [diff] [blame] | 147 | help="Should the tests ssh to instances?"), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 148 | cfg.StrOpt('ssh_user', |
| 149 | default='root', |
| 150 | help="User name used to authenticate to an instance."), |
Nachi Ueno | 6d580be | 2013-07-24 10:58:11 -0700 | [diff] [blame] | 151 | cfg.IntOpt('ping_timeout', |
| 152 | default=60, |
| 153 | help="Timeout in seconds to wait for ping to " |
| 154 | "succeed."), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 155 | cfg.IntOpt('ssh_timeout', |
| 156 | default=300, |
Chris Yeoh | 7691604 | 2013-02-27 16:25:25 +1030 | [diff] [blame] | 157 | help="Timeout in seconds to wait for authentication to " |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 158 | "succeed."), |
Attila Fazekas | 0abbc95 | 2013-07-01 19:19:42 +0200 | [diff] [blame] | 159 | cfg.IntOpt('ready_wait', |
| 160 | default=0, |
DennyZhang | 8912d01 | 2013-09-25 18:08:34 -0500 | [diff] [blame] | 161 | help="Additional wait time for clean state, when there is " |
| 162 | "no OS-EXT-STS extension available"), |
Chris Yeoh | 7691604 | 2013-02-27 16:25:25 +1030 | [diff] [blame] | 163 | cfg.IntOpt('ssh_channel_timeout', |
| 164 | default=60, |
| 165 | help="Timeout in seconds to wait for output from ssh " |
| 166 | "channel."), |
Attila Fazekas | b066165 | 2013-05-08 13:01:36 +0200 | [diff] [blame] | 167 | cfg.StrOpt('fixed_network_name', |
| 168 | default='private', |
| 169 | help="Visible fixed network name "), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 170 | cfg.StrOpt('network_for_ssh', |
| 171 | default='public', |
| 172 | help="Network used for SSH connections."), |
| 173 | cfg.IntOpt('ip_version_for_ssh', |
| 174 | default=4, |
| 175 | help="IP version used for SSH connections."), |
fujioka yuuichi | a11994e | 2013-07-09 11:19:51 +0900 | [diff] [blame] | 176 | cfg.BoolOpt('use_floatingip_for_ssh', |
| 177 | default=True, |
| 178 | help="Dose the SSH uses Floating IP?"), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 179 | cfg.StrOpt('catalog_type', |
| 180 | default='compute', |
| 181 | help="Catalog type of the Compute service."), |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 182 | cfg.StrOpt('region', |
| 183 | default='', |
| 184 | help="The compute region name to use. If empty, the value " |
| 185 | "of identity.region is used instead. If no such region " |
| 186 | "is found in the service catalog, the first found one is " |
| 187 | "used."), |
ivan-zhu | 8f992be | 2013-07-31 14:56:58 +0800 | [diff] [blame] | 188 | cfg.StrOpt('catalog_v3_type', |
| 189 | default='computev3', |
| 190 | help="Catalog type of the Compute v3 service."), |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 191 | cfg.StrOpt('path_to_private_key', |
| 192 | default=None, |
| 193 | help="Path to a private key file for SSH access to remote " |
| 194 | "hosts"), |
Ryan Hsu | cb2e125 | 2013-09-03 21:44:49 -0700 | [diff] [blame] | 195 | cfg.StrOpt('volume_device_name', |
| 196 | default='vdb', |
| 197 | help="Expected device name when a volume is attached to " |
Ken'ichi Ohmichi | 39437e2 | 2013-10-06 00:21:38 +0900 | [diff] [blame] | 198 | "an instance"), |
| 199 | cfg.IntOpt('shelved_offload_time', |
| 200 | default=0, |
| 201 | help='Time in seconds before a shelved instance is eligible ' |
| 202 | 'for removing from a host. -1 never offload, 0 offload ' |
| 203 | 'when shelved. This time should be the same as the time ' |
| 204 | 'of nova.conf, and some tests will run for as long as the ' |
| 205 | 'time.') |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 206 | ] |
Rohit Karajgi | e1b050d | 2011-12-02 16:13:18 -0800 | [diff] [blame] | 207 | |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 208 | compute_features_group = cfg.OptGroup(name='compute-feature-enabled', |
| 209 | title="Enabled Compute Service Features") |
| 210 | |
| 211 | ComputeFeaturesGroup = [ |
ivan-zhu | 8f992be | 2013-07-31 14:56:58 +0800 | [diff] [blame] | 212 | cfg.BoolOpt('api_v3', |
Chris Yeoh | fbc15de | 2013-11-26 10:20:08 +1030 | [diff] [blame] | 213 | default=True, |
ivan-zhu | 8f992be | 2013-07-31 14:56:58 +0800 | [diff] [blame] | 214 | help="If false, skip all nova v3 tests."), |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 215 | cfg.BoolOpt('disk_config', |
| 216 | default=True, |
| 217 | help="If false, skip disk config tests"), |
Matthew Treinish | e3d2614 | 2013-11-26 19:14:58 +0000 | [diff] [blame] | 218 | cfg.ListOpt('api_extensions', |
| 219 | default=['all'], |
| 220 | help='A list of enabled extensions with a special entry all ' |
| 221 | 'which indicates every extension is enabled'), |
| 222 | cfg.ListOpt('api_v3_extensions', |
| 223 | default=['all'], |
| 224 | help='A list of enabled v3 extensions with a special entry all' |
| 225 | ' which indicates every extension is enabled'), |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 226 | cfg.BoolOpt('change_password', |
| 227 | default=False, |
| 228 | help="Does the test environment support changing the admin " |
| 229 | "password?"), |
| 230 | cfg.BoolOpt('create_image', |
| 231 | default=False, |
| 232 | help="Does the test environment support snapshots?"), |
| 233 | cfg.BoolOpt('resize', |
| 234 | default=False, |
| 235 | help="Does the test environment support resizing?"), |
| 236 | cfg.BoolOpt('live_migration', |
| 237 | default=False, |
| 238 | help="Does the test environment support live migration " |
| 239 | "available?"), |
| 240 | cfg.BoolOpt('block_migration_for_live_migration', |
| 241 | default=False, |
| 242 | help="Does the test environment use block devices for live " |
| 243 | "migration"), |
| 244 | cfg.BoolOpt('block_migrate_cinder_iscsi', |
| 245 | default=False, |
| 246 | help="Does the test environment block migration support " |
| 247 | "cinder iSCSI volumes") |
| 248 | ] |
| 249 | |
| 250 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 251 | compute_admin_group = cfg.OptGroup(name='compute-admin', |
| 252 | title="Compute Admin Options") |
donald-ngo | 7fb1efa | 2011-12-13 17:17:36 -0800 | [diff] [blame] | 253 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 254 | ComputeAdminGroup = [ |
| 255 | cfg.StrOpt('username', |
| 256 | default='admin', |
| 257 | help="Administrative Username to use for Nova API requests."), |
| 258 | cfg.StrOpt('tenant_name', |
| 259 | default='admin', |
| 260 | help="Administrative Tenant name to use for Nova API " |
| 261 | "requests."), |
| 262 | cfg.StrOpt('password', |
| 263 | default='pass', |
| 264 | help="API key to use when authenticating as admin.", |
| 265 | secret=True), |
| 266 | ] |
Daryl Walleck | 587385b | 2012-03-03 13:00:26 -0600 | [diff] [blame] | 267 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 268 | image_group = cfg.OptGroup(name='image', |
| 269 | title="Image Service Options") |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 270 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 271 | ImageGroup = [ |
Matthew Treinish | 72ea442 | 2013-02-07 14:42:49 -0500 | [diff] [blame] | 272 | cfg.StrOpt('catalog_type', |
| 273 | default='image', |
Sean Dague | 8340199 | 2013-05-06 17:46:36 -0400 | [diff] [blame] | 274 | help='Catalog type of the Image service.'), |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 275 | cfg.StrOpt('region', |
| 276 | default='', |
| 277 | help="The image region name to use. If empty, the value " |
| 278 | "of identity.region is used instead. If no such region " |
| 279 | "is found in the service catalog, the first found one is " |
| 280 | "used."), |
Sean Dague | 8340199 | 2013-05-06 17:46:36 -0400 | [diff] [blame] | 281 | cfg.StrOpt('http_image', |
| 282 | default='http://download.cirros-cloud.net/0.3.1/' |
| 283 | 'cirros-0.3.1-x86_64-uec.tar.gz', |
DennyZhang | 8912d01 | 2013-09-25 18:08:34 -0500 | [diff] [blame] | 284 | help='http accessible image') |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 285 | ] |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 286 | |
Matthew Treinish | 2b5287d | 2013-10-22 17:40:34 +0000 | [diff] [blame] | 287 | image_feature_group = cfg.OptGroup(name='image-feature-enabled', |
| 288 | title='Enabled image service features') |
| 289 | |
| 290 | ImageFeaturesGroup = [ |
| 291 | cfg.BoolOpt('api_v2', |
| 292 | default=True, |
| 293 | help="Is the v2 image API enabled"), |
| 294 | cfg.BoolOpt('api_v1', |
| 295 | default=True, |
| 296 | help="Is the v1 image API enabled"), |
| 297 | ] |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 298 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 299 | network_group = cfg.OptGroup(name='network', |
| 300 | title='Network Service Options') |
Daryl Walleck | 587385b | 2012-03-03 13:00:26 -0600 | [diff] [blame] | 301 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 302 | NetworkGroup = [ |
| 303 | cfg.StrOpt('catalog_type', |
| 304 | default='network', |
Mark McClain | f2982e8 | 2013-07-06 17:48:03 -0400 | [diff] [blame] | 305 | help='Catalog type of the Neutron service.'), |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 306 | cfg.StrOpt('region', |
| 307 | default='', |
| 308 | help="The network region name to use. If empty, the value " |
| 309 | "of identity.region is used instead. If no such region " |
| 310 | "is found in the service catalog, the first found one is " |
| 311 | "used."), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 312 | cfg.StrOpt('tenant_network_cidr', |
| 313 | default="10.100.0.0/16", |
| 314 | help="The cidr block to allocate tenant networks from"), |
| 315 | cfg.IntOpt('tenant_network_mask_bits', |
Attila Fazekas | 8ea181b | 2013-07-13 16:26:14 +0200 | [diff] [blame] | 316 | default=28, |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 317 | help="The mask bits for tenant networks"), |
| 318 | cfg.BoolOpt('tenant_networks_reachable', |
| 319 | default=False, |
| 320 | help="Whether tenant network connectivity should be " |
| 321 | "evaluated directly"), |
| 322 | cfg.StrOpt('public_network_id', |
| 323 | default="", |
| 324 | help="Id of the public network that provides external " |
| 325 | "connectivity"), |
| 326 | cfg.StrOpt('public_router_id', |
| 327 | default="", |
| 328 | help="Id of the public router that provides external " |
| 329 | "connectivity"), |
| 330 | ] |
Jay Pipes | 3f981df | 2012-03-27 18:59:44 -0400 | [diff] [blame] | 331 | |
Matthew Treinish | e3d2614 | 2013-11-26 19:14:58 +0000 | [diff] [blame] | 332 | network_feature_group = cfg.OptGroup(name='network-feature-enabled', |
| 333 | title='Enabled network service features') |
| 334 | |
| 335 | NetworkFeaturesGroup = [ |
| 336 | cfg.ListOpt('api_extensions', |
| 337 | default=['all'], |
| 338 | help='A list of enabled extensions with a special entry all ' |
| 339 | 'which indicates every extension is enabled'), |
| 340 | ] |
| 341 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 342 | volume_group = cfg.OptGroup(name='volume', |
| 343 | title='Block Storage Options') |
Daryl Walleck | 587385b | 2012-03-03 13:00:26 -0600 | [diff] [blame] | 344 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 345 | VolumeGroup = [ |
| 346 | cfg.IntOpt('build_interval', |
| 347 | default=10, |
| 348 | help='Time in seconds between volume availability checks.'), |
| 349 | cfg.IntOpt('build_timeout', |
| 350 | default=300, |
| 351 | help='Timeout in seconds to wait for a volume to become' |
| 352 | 'available.'), |
| 353 | cfg.StrOpt('catalog_type', |
Matthew Treinish | eb72451 | 2013-10-25 15:12:59 +0000 | [diff] [blame] | 354 | default='volume', |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 355 | help="Catalog type of the Volume Service"), |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 356 | cfg.StrOpt('region', |
| 357 | default='', |
| 358 | help="The volume region name to use. If empty, the value " |
| 359 | "of identity.region is used instead. If no such region " |
| 360 | "is found in the service catalog, the first found one is " |
| 361 | "used."), |
Jérôme Gallard | 86551ce | 2013-03-08 11:41:26 +0100 | [diff] [blame] | 362 | cfg.StrOpt('backend1_name', |
Giulio Fidente | f4fa894 | 2013-05-28 18:48:03 +0200 | [diff] [blame] | 363 | default='BACKEND_1', |
Jérôme Gallard | 86551ce | 2013-03-08 11:41:26 +0100 | [diff] [blame] | 364 | help="Name of the backend1 (must be declared in cinder.conf)"), |
| 365 | cfg.StrOpt('backend2_name', |
Giulio Fidente | f4fa894 | 2013-05-28 18:48:03 +0200 | [diff] [blame] | 366 | default='BACKEND_2', |
Jérôme Gallard | 86551ce | 2013-03-08 11:41:26 +0100 | [diff] [blame] | 367 | help="Name of the backend2 (must be declared in cinder.conf)"), |
Adam Gandelman | 827ad33 | 2013-06-24 17:04:09 -0700 | [diff] [blame] | 368 | cfg.StrOpt('storage_protocol', |
| 369 | default='iSCSI', |
| 370 | help='Backend protocol to target when creating volume types'), |
| 371 | cfg.StrOpt('vendor_name', |
| 372 | default='Open Source', |
| 373 | help='Backend vendor to target when creating volume types'), |
Ryan Hsu | a67f463 | 2013-08-29 16:03:06 -0700 | [diff] [blame] | 374 | cfg.StrOpt('disk_format', |
| 375 | default='raw', |
| 376 | help='Disk format to use when copying a volume to image'), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 377 | ] |
K Jonathan Harker | d6ba4b4 | 2012-12-18 13:50:47 -0800 | [diff] [blame] | 378 | |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 379 | volume_feature_group = cfg.OptGroup(name='volume-feature-enabled', |
| 380 | title='Enabled Cinder Features') |
| 381 | |
| 382 | VolumeFeaturesGroup = [ |
| 383 | cfg.BoolOpt('multi_backend', |
| 384 | default=False, |
Matthew Treinish | e3d2614 | 2013-11-26 19:14:58 +0000 | [diff] [blame] | 385 | help="Runs Cinder multi-backend test (requires 2 backends)"), |
| 386 | cfg.ListOpt('api_extensions', |
| 387 | default=['all'], |
| 388 | help='A list of enabled extensions with a special entry all ' |
| 389 | 'which indicates every extension is enabled'), |
Zhi Kun Liu | bb363a2 | 2013-11-28 18:47:39 +0800 | [diff] [blame] | 390 | cfg.BoolOpt('api_v1', |
| 391 | default=True, |
| 392 | help="Is the v1 volume API enabled"), |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 393 | ] |
| 394 | |
Daryl Walleck | 587385b | 2012-03-03 13:00:26 -0600 | [diff] [blame] | 395 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 396 | object_storage_group = cfg.OptGroup(name='object-storage', |
| 397 | title='Object Storage Service Options') |
Attila Fazekas | a23f500 | 2012-10-23 19:32:45 +0200 | [diff] [blame] | 398 | |
DennyZhang | 1e71b61 | 2013-09-26 12:35:40 -0500 | [diff] [blame] | 399 | ObjectStoreGroup = [ |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 400 | cfg.StrOpt('catalog_type', |
| 401 | default='object-store', |
| 402 | help="Catalog type of the Object-Storage service."), |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 403 | cfg.StrOpt('region', |
| 404 | default='', |
| 405 | help="The object-storage region name to use. If empty, the " |
| 406 | "value of identity.region is used instead. If no such " |
| 407 | "region is found in the service catalog, the first found " |
| 408 | "one is used."), |
Matthew Treinish | f319a73 | 2013-10-24 21:39:24 +0000 | [diff] [blame] | 409 | cfg.IntOpt('container_sync_timeout', |
nayna-patel | b4989b3 | 2013-01-09 06:25:13 +0000 | [diff] [blame] | 410 | default=120, |
| 411 | help="Number of seconds to time on waiting for a container" |
| 412 | "to container synchronization complete."), |
Matthew Treinish | f319a73 | 2013-10-24 21:39:24 +0000 | [diff] [blame] | 413 | cfg.IntOpt('container_sync_interval', |
nayna-patel | b4989b3 | 2013-01-09 06:25:13 +0000 | [diff] [blame] | 414 | default=5, |
| 415 | help="Number of seconds to wait while looping to check the" |
| 416 | "status of a container to container synchronization"), |
Matthew Treinish | 3fdb80c | 2013-08-15 11:13:19 -0400 | [diff] [blame] | 417 | cfg.StrOpt('operator_role', |
| 418 | default='Member', |
| 419 | help="Role to add to users created for swift tests to " |
| 420 | "enable creating containers"), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 421 | ] |
Attila Fazekas | a23f500 | 2012-10-23 19:32:45 +0200 | [diff] [blame] | 422 | |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 423 | object_storage_feature_group = cfg.OptGroup( |
| 424 | name='object-storage-feature-enabled', |
| 425 | title='Enabled object-storage features') |
| 426 | |
| 427 | ObjectStoreFeaturesGroup = [ |
Matthew Treinish | 2034538 | 2013-12-13 17:04:23 +0000 | [diff] [blame] | 428 | cfg.ListOpt('discoverable_apis', |
| 429 | default=['all'], |
| 430 | help="A list of the enabled optional discoverable apis. " |
| 431 | "A single entry, all, indicates that all of these " |
| 432 | "features are expected to be enabled"), |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 433 | ] |
| 434 | |
Attila Fazekas | a23f500 | 2012-10-23 19:32:45 +0200 | [diff] [blame] | 435 | |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 436 | orchestration_group = cfg.OptGroup(name='orchestration', |
| 437 | title='Orchestration Service Options') |
| 438 | |
| 439 | OrchestrationGroup = [ |
| 440 | cfg.StrOpt('catalog_type', |
| 441 | default='orchestration', |
| 442 | help="Catalog type of the Orchestration service."), |
Arata Notsu | 8f44039 | 2013-09-13 16:14:20 +0900 | [diff] [blame] | 443 | cfg.StrOpt('region', |
| 444 | default='', |
| 445 | help="The orchestration region name to use. If empty, the " |
| 446 | "value of identity.region is used instead. If no such " |
| 447 | "region is found in the service catalog, the first found " |
| 448 | "one is used."), |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 449 | cfg.BoolOpt('allow_tenant_isolation', |
| 450 | default=False, |
| 451 | help="Allows test cases to create/destroy tenants and " |
| 452 | "users. This option enables isolated test cases and " |
| 453 | "better parallel execution, but also requires that " |
| 454 | "OpenStack Identity API admin credentials are known."), |
| 455 | cfg.IntOpt('build_interval', |
| 456 | default=1, |
| 457 | help="Time in seconds between build status checks."), |
| 458 | cfg.IntOpt('build_timeout', |
| 459 | default=300, |
| 460 | help="Timeout in seconds to wait for a stack to build."), |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 461 | cfg.StrOpt('instance_type', |
Steve Baker | 9e86b83 | 2013-05-22 15:40:28 +1200 | [diff] [blame] | 462 | default='m1.micro', |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 463 | help="Instance type for tests. Needs to be big enough for a " |
| 464 | "full OS plus the test workload"), |
| 465 | cfg.StrOpt('image_ref', |
| 466 | default=None, |
| 467 | help="Name of heat-cfntools enabled image to use when " |
| 468 | "launching test instances."), |
| 469 | cfg.StrOpt('keypair_name', |
| 470 | default=None, |
| 471 | help="Name of existing keypair to launch servers with."), |
Clint Byrum | 71f2763 | 2013-09-09 11:41:32 -0700 | [diff] [blame] | 472 | cfg.IntOpt('max_template_size', |
Joe Gordon | 0e51b22 | 2013-10-24 14:11:10 +0100 | [diff] [blame] | 473 | default=524288, |
Clint Byrum | 71f2763 | 2013-09-09 11:41:32 -0700 | [diff] [blame] | 474 | help="Value must match heat configuration of the same name."), |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 475 | ] |
| 476 | |
| 477 | |
Yassine Lamgarchal | b158d41 | 2013-12-27 19:29:42 +0100 | [diff] [blame] | 478 | telemetry_group = cfg.OptGroup(name='telemetry', |
| 479 | title='Telemetry Service Options') |
| 480 | |
| 481 | TelemetryGroup = [ |
| 482 | cfg.StrOpt('catalog_type', |
| 483 | default='metering', |
| 484 | help="Catalog type of the Telemetry service."), |
| 485 | ] |
| 486 | |
| 487 | |
Julie Pichon | d101764 | 2013-07-24 16:37:23 +0100 | [diff] [blame] | 488 | dashboard_group = cfg.OptGroup(name="dashboard", |
| 489 | title="Dashboard options") |
| 490 | |
| 491 | DashboardGroup = [ |
| 492 | cfg.StrOpt('dashboard_url', |
| 493 | default='http://localhost/', |
| 494 | help="Where the dashboard can be found"), |
| 495 | cfg.StrOpt('login_url', |
| 496 | default='http://localhost/auth/login/', |
| 497 | help="Login page for the dashboard"), |
| 498 | ] |
| 499 | |
| 500 | |
Sergey Lukjanov | cec6c3f | 2013-12-10 12:38:21 +0400 | [diff] [blame] | 501 | data_processing_group = cfg.OptGroup(name="data_processing", |
| 502 | title="Data Processing options") |
| 503 | |
| 504 | DataProcessingGroup = [ |
| 505 | cfg.StrOpt('catalog_type', |
| 506 | default='data_processing', |
| 507 | help="Catalog type of the data processing service.") |
| 508 | ] |
| 509 | |
| 510 | |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 511 | boto_group = cfg.OptGroup(name='boto', |
| 512 | title='EC2/S3 options') |
DennyZhang | 1e71b61 | 2013-09-26 12:35:40 -0500 | [diff] [blame] | 513 | BotoGroup = [ |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 514 | cfg.StrOpt('ec2_url', |
| 515 | default="http://localhost:8773/services/Cloud", |
| 516 | help="EC2 URL"), |
| 517 | cfg.StrOpt('s3_url', |
| 518 | default="http://localhost:8080", |
| 519 | help="S3 URL"), |
| 520 | cfg.StrOpt('aws_secret', |
| 521 | default=None, |
| 522 | help="AWS Secret Key", |
| 523 | secret=True), |
| 524 | cfg.StrOpt('aws_access', |
| 525 | default=None, |
| 526 | help="AWS Access Key"), |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 527 | cfg.StrOpt('s3_materials_path', |
| 528 | default="/opt/stack/devstack/files/images/" |
| 529 | "s3-materials/cirros-0.3.0", |
| 530 | help="S3 Materials Path"), |
| 531 | cfg.StrOpt('ari_manifest', |
| 532 | default="cirros-0.3.0-x86_64-initrd.manifest.xml", |
| 533 | help="ARI Ramdisk Image manifest"), |
| 534 | cfg.StrOpt('ami_manifest', |
| 535 | default="cirros-0.3.0-x86_64-blank.img.manifest.xml", |
| 536 | help="AMI Machine Image manifest"), |
| 537 | cfg.StrOpt('aki_manifest', |
| 538 | default="cirros-0.3.0-x86_64-vmlinuz.manifest.xml", |
| 539 | help="AKI Kernel Image manifest"), |
| 540 | cfg.StrOpt('instance_type', |
| 541 | default="m1.tiny", |
| 542 | help="Instance type"), |
| 543 | cfg.IntOpt('http_socket_timeout', |
| 544 | default=3, |
| 545 | help="boto Http socket timeout"), |
| 546 | cfg.IntOpt('num_retries', |
| 547 | default=1, |
| 548 | help="boto num_retries on error"), |
| 549 | cfg.IntOpt('build_timeout', |
| 550 | default=60, |
| 551 | help="Status Change Timeout"), |
| 552 | cfg.IntOpt('build_interval', |
| 553 | default=1, |
| 554 | help="Status Change Test Interval"), |
| 555 | ] |
Attila Fazekas | f7f2d93 | 2012-12-13 09:14:38 +0100 | [diff] [blame] | 556 | |
Matthew Treinish | 615ea6a | 2013-02-25 17:26:59 -0500 | [diff] [blame] | 557 | stress_group = cfg.OptGroup(name='stress', title='Stress Test Options') |
| 558 | |
| 559 | StressGroup = [ |
| 560 | cfg.StrOpt('nova_logdir', |
| 561 | default=None, |
| 562 | help='Directory containing log files on the compute nodes'), |
| 563 | cfg.IntOpt('max_instances', |
| 564 | default=16, |
| 565 | help='Maximum number of instances to create during test.'), |
| 566 | cfg.StrOpt('controller', |
| 567 | default=None, |
David Kranz | b9d9750 | 2013-05-01 15:55:04 -0400 | [diff] [blame] | 568 | help='Controller host.'), |
| 569 | # new stress options |
| 570 | cfg.StrOpt('target_controller', |
| 571 | default=None, |
| 572 | help='Controller host.'), |
| 573 | cfg.StrOpt('target_ssh_user', |
| 574 | default=None, |
| 575 | help='ssh user.'), |
| 576 | cfg.StrOpt('target_private_key_path', |
| 577 | default=None, |
| 578 | help='Path to private key.'), |
| 579 | cfg.StrOpt('target_logfiles', |
| 580 | default=None, |
| 581 | help='regexp for list of log files.'), |
Matthew Treinish | f319a73 | 2013-10-24 21:39:24 +0000 | [diff] [blame] | 582 | cfg.IntOpt('log_check_interval', |
David Kranz | b9d9750 | 2013-05-01 15:55:04 -0400 | [diff] [blame] | 583 | default=60, |
Marc Koderer | 32221b8e | 2013-08-23 13:57:50 +0200 | [diff] [blame] | 584 | help='time (in seconds) between log file error checks.'), |
Matthew Treinish | f319a73 | 2013-10-24 21:39:24 +0000 | [diff] [blame] | 585 | cfg.IntOpt('default_thread_number_per_action', |
Marc Koderer | 32221b8e | 2013-08-23 13:57:50 +0200 | [diff] [blame] | 586 | default=4, |
| 587 | help='The number of threads created while stress test.') |
Matthew Treinish | 615ea6a | 2013-02-25 17:26:59 -0500 | [diff] [blame] | 588 | ] |
| 589 | |
| 590 | |
Masayuki Igawa | 73d9f3a | 2013-05-24 10:30:01 +0900 | [diff] [blame] | 591 | scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options') |
| 592 | |
| 593 | ScenarioGroup = [ |
| 594 | cfg.StrOpt('img_dir', |
| 595 | default='/opt/stack/new/devstack/files/images/' |
| 596 | 'cirros-0.3.1-x86_64-uec', |
| 597 | help='Directory containing image files'), |
| 598 | cfg.StrOpt('ami_img_file', |
| 599 | default='cirros-0.3.1-x86_64-blank.img', |
| 600 | help='AMI image file name'), |
| 601 | cfg.StrOpt('ari_img_file', |
| 602 | default='cirros-0.3.1-x86_64-initrd', |
| 603 | help='ARI image file name'), |
| 604 | cfg.StrOpt('aki_img_file', |
| 605 | default='cirros-0.3.1-x86_64-vmlinuz', |
| 606 | help='AKI image file name'), |
| 607 | cfg.StrOpt('ssh_user', |
| 608 | default='cirros', |
Joe Gordon | b5e10cd | 2013-07-10 15:51:12 +0000 | [diff] [blame] | 609 | help='ssh username for the image file'), |
| 610 | cfg.IntOpt( |
| 611 | 'large_ops_number', |
| 612 | default=0, |
| 613 | help="specifies how many resources to request at once. Used " |
| 614 | "for large operations testing.") |
Masayuki Igawa | 73d9f3a | 2013-05-24 10:30:01 +0900 | [diff] [blame] | 615 | ] |
| 616 | |
| 617 | |
Matthew Treinish | 4c41292 | 2013-07-16 15:27:42 -0400 | [diff] [blame] | 618 | service_available_group = cfg.OptGroup(name="service_available", |
| 619 | title="Available OpenStack Services") |
| 620 | |
| 621 | ServiceAvailableGroup = [ |
| 622 | cfg.BoolOpt('cinder', |
| 623 | default=True, |
| 624 | help="Whether or not cinder is expected to be available"), |
Matthew Treinish | faa340d | 2013-07-19 16:26:21 -0400 | [diff] [blame] | 625 | cfg.BoolOpt('neutron', |
| 626 | default=False, |
| 627 | help="Whether or not neutron is expected to be available"), |
Matthew Treinish | 853ae44 | 2013-07-19 16:36:07 -0400 | [diff] [blame] | 628 | cfg.BoolOpt('glance', |
| 629 | default=True, |
| 630 | help="Whether or not glance is expected to be available"), |
Matthew Treinish | 61e332b | 2013-07-19 16:42:31 -0400 | [diff] [blame] | 631 | cfg.BoolOpt('swift', |
| 632 | default=True, |
| 633 | help="Whether or not swift is expected to be available"), |
Matthew Treinish | 6b41e24 | 2013-07-19 16:49:28 -0400 | [diff] [blame] | 634 | cfg.BoolOpt('nova', |
| 635 | default=True, |
| 636 | help="Whether or not nova is expected to be available"), |
Matthew Treinish | a9d4388 | 2013-07-19 16:54:52 -0400 | [diff] [blame] | 637 | cfg.BoolOpt('heat', |
| 638 | default=False, |
| 639 | help="Whether or not Heat is expected to be available"), |
Mehdi Abaakouk | 8581c0b | 2013-10-04 10:45:42 +0200 | [diff] [blame] | 640 | cfg.BoolOpt('ceilometer', |
| 641 | default=True, |
| 642 | help="Whether or not Ceilometer is expected to be available"), |
Julie Pichon | d101764 | 2013-07-24 16:37:23 +0100 | [diff] [blame] | 643 | cfg.BoolOpt('horizon', |
| 644 | default=True, |
| 645 | help="Whether or not Horizon is expected to be available"), |
Sergey Lukjanov | cec6c3f | 2013-12-10 12:38:21 +0400 | [diff] [blame] | 646 | cfg.BoolOpt('savanna', |
| 647 | default=False, |
| 648 | help="Whether or not Savanna is expected to be available"), |
Matthew Treinish | 4c41292 | 2013-07-16 15:27:42 -0400 | [diff] [blame] | 649 | ] |
| 650 | |
Attila Fazekas | aeeeefd | 2013-08-06 17:01:56 +0200 | [diff] [blame] | 651 | debug_group = cfg.OptGroup(name="debug", |
| 652 | title="Debug System") |
| 653 | |
| 654 | DebugGroup = [ |
| 655 | cfg.BoolOpt('enable', |
| 656 | default=True, |
| 657 | help="Enable diagnostic commands"), |
| 658 | ] |
| 659 | |
| 660 | |
Sean Dague | 3b9b1f3 | 2013-12-20 17:04:54 -0500 | [diff] [blame] | 661 | # this should never be called outside of this class |
| 662 | class TempestConfigPrivate(object): |
Daryl Walleck | 1465d61 | 2011-11-02 02:22:15 -0500 | [diff] [blame] | 663 | """Provides OpenStack configuration information.""" |
| 664 | |
Brian Waldon | 738cd63 | 2011-12-12 18:45:09 -0500 | [diff] [blame] | 665 | DEFAULT_CONFIG_DIR = os.path.join( |
Zhongyue Luo | a1343de | 2013-01-04 16:21:35 +0800 | [diff] [blame] | 666 | os.path.abspath(os.path.dirname(os.path.dirname(__file__))), |
Brian Waldon | 738cd63 | 2011-12-12 18:45:09 -0500 | [diff] [blame] | 667 | "etc") |
Daryl Walleck | 1465d61 | 2011-11-02 02:22:15 -0500 | [diff] [blame] | 668 | |
Brian Waldon | 738cd63 | 2011-12-12 18:45:09 -0500 | [diff] [blame] | 669 | DEFAULT_CONFIG_FILE = "tempest.conf" |
| 670 | |
Sean Dague | 2ec4c2c | 2013-12-22 11:30:06 -0500 | [diff] [blame] | 671 | def __init__(self, parse_conf=True): |
Brian Waldon | 738cd63 | 2011-12-12 18:45:09 -0500 | [diff] [blame] | 672 | """Initialize a configuration from a conf directory and conf file.""" |
Sean Dague | 3b9b1f3 | 2013-12-20 17:04:54 -0500 | [diff] [blame] | 673 | super(TempestConfigPrivate, self).__init__() |
Sean Dague | 2416cf3 | 2013-04-10 08:29:07 -0400 | [diff] [blame] | 674 | config_files = [] |
Sean Dague | 2416cf3 | 2013-04-10 08:29:07 -0400 | [diff] [blame] | 675 | failsafe_path = "/etc/tempest/" + self.DEFAULT_CONFIG_FILE |
Brian Waldon | 738cd63 | 2011-12-12 18:45:09 -0500 | [diff] [blame] | 676 | |
| 677 | # Environment variables override defaults... |
| 678 | conf_dir = os.environ.get('TEMPEST_CONFIG_DIR', |
Zhongyue Luo | 79d8d36 | 2012-09-25 13:49:27 +0800 | [diff] [blame] | 679 | self.DEFAULT_CONFIG_DIR) |
| 680 | conf_file = os.environ.get('TEMPEST_CONFIG', self.DEFAULT_CONFIG_FILE) |
Brian Waldon | 738cd63 | 2011-12-12 18:45:09 -0500 | [diff] [blame] | 681 | |
Jay Pipes | 7f75763 | 2011-12-02 15:53:32 -0500 | [diff] [blame] | 682 | path = os.path.join(conf_dir, conf_file) |
| 683 | |
Zhongyue Luo | afd43eb | 2013-02-04 11:32:57 +0800 | [diff] [blame] | 684 | if not (os.path.isfile(path) or |
| 685 | 'TEMPEST_CONFIG_DIR' in os.environ or |
| 686 | 'TEMPEST_CONFIG' in os.environ): |
Sean Dague | 2416cf3 | 2013-04-10 08:29:07 -0400 | [diff] [blame] | 687 | path = failsafe_path |
Attila Fazekas | 5abb253 | 2012-12-04 11:30:49 +0100 | [diff] [blame] | 688 | |
Sean Dague | 2ec4c2c | 2013-12-22 11:30:06 -0500 | [diff] [blame] | 689 | # only parse the config file if we expect one to exist. This is needed |
| 690 | # to remove an issue with the config file up to date checker. |
| 691 | if parse_conf: |
Sean Dague | 2416cf3 | 2013-04-10 08:29:07 -0400 | [diff] [blame] | 692 | config_files.append(path) |
Jay Pipes | 7f75763 | 2011-12-02 15:53:32 -0500 | [diff] [blame] | 693 | |
Sean Dague | 2416cf3 | 2013-04-10 08:29:07 -0400 | [diff] [blame] | 694 | cfg.CONF([], project='tempest', default_config_files=config_files) |
Matthew Treinish | f4a9b0f | 2013-07-26 16:58:26 -0400 | [diff] [blame] | 695 | logging.setup('tempest') |
| 696 | LOG = logging.getLogger('tempest') |
| 697 | LOG.info("Using tempest config file %s" % path) |
Daryl Walleck | 1465d61 | 2011-11-02 02:22:15 -0500 | [diff] [blame] | 698 | |
DennyZhang | 88a2dd8 | 2013-10-07 12:55:35 -0500 | [diff] [blame] | 699 | register_opt_group(cfg.CONF, compute_group, ComputeGroup) |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 700 | register_opt_group(cfg.CONF, compute_features_group, |
| 701 | ComputeFeaturesGroup) |
DennyZhang | 88a2dd8 | 2013-10-07 12:55:35 -0500 | [diff] [blame] | 702 | register_opt_group(cfg.CONF, identity_group, IdentityGroup) |
Matthew Treinish | d5021a7 | 2014-01-09 18:42:51 +0000 | [diff] [blame^] | 703 | register_opt_group(cfg.CONF, identity_feature_group, |
| 704 | IdentityFeatureGroup) |
DennyZhang | 88a2dd8 | 2013-10-07 12:55:35 -0500 | [diff] [blame] | 705 | register_opt_group(cfg.CONF, image_group, ImageGroup) |
Matthew Treinish | 2b5287d | 2013-10-22 17:40:34 +0000 | [diff] [blame] | 706 | register_opt_group(cfg.CONF, image_feature_group, ImageFeaturesGroup) |
DennyZhang | 88a2dd8 | 2013-10-07 12:55:35 -0500 | [diff] [blame] | 707 | register_opt_group(cfg.CONF, network_group, NetworkGroup) |
Matthew Treinish | e3d2614 | 2013-11-26 19:14:58 +0000 | [diff] [blame] | 708 | register_opt_group(cfg.CONF, network_feature_group, |
| 709 | NetworkFeaturesGroup) |
DennyZhang | 88a2dd8 | 2013-10-07 12:55:35 -0500 | [diff] [blame] | 710 | register_opt_group(cfg.CONF, volume_group, VolumeGroup) |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 711 | register_opt_group(cfg.CONF, volume_feature_group, |
| 712 | VolumeFeaturesGroup) |
DennyZhang | 88a2dd8 | 2013-10-07 12:55:35 -0500 | [diff] [blame] | 713 | register_opt_group(cfg.CONF, object_storage_group, ObjectStoreGroup) |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 714 | register_opt_group(cfg.CONF, object_storage_feature_group, |
| 715 | ObjectStoreFeaturesGroup) |
DennyZhang | 88a2dd8 | 2013-10-07 12:55:35 -0500 | [diff] [blame] | 716 | register_opt_group(cfg.CONF, orchestration_group, OrchestrationGroup) |
Yassine Lamgarchal | b158d41 | 2013-12-27 19:29:42 +0100 | [diff] [blame] | 717 | register_opt_group(cfg.CONF, telemetry_group, TelemetryGroup) |
DennyZhang | 88a2dd8 | 2013-10-07 12:55:35 -0500 | [diff] [blame] | 718 | register_opt_group(cfg.CONF, dashboard_group, DashboardGroup) |
Sergey Lukjanov | cec6c3f | 2013-12-10 12:38:21 +0400 | [diff] [blame] | 719 | register_opt_group(cfg.CONF, data_processing_group, |
| 720 | DataProcessingGroup) |
DennyZhang | 88a2dd8 | 2013-10-07 12:55:35 -0500 | [diff] [blame] | 721 | register_opt_group(cfg.CONF, boto_group, BotoGroup) |
| 722 | register_opt_group(cfg.CONF, compute_admin_group, ComputeAdminGroup) |
| 723 | register_opt_group(cfg.CONF, stress_group, StressGroup) |
| 724 | register_opt_group(cfg.CONF, scenario_group, ScenarioGroup) |
| 725 | register_opt_group(cfg.CONF, service_available_group, |
| 726 | ServiceAvailableGroup) |
| 727 | register_opt_group(cfg.CONF, debug_group, DebugGroup) |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 728 | self.compute = cfg.CONF.compute |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 729 | self.compute_feature_enabled = cfg.CONF['compute-feature-enabled'] |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 730 | self.identity = cfg.CONF.identity |
Matthew Treinish | d5021a7 | 2014-01-09 18:42:51 +0000 | [diff] [blame^] | 731 | self.identity_feature_enabled = cfg.CONF['identity-feature-enabled'] |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 732 | self.images = cfg.CONF.image |
Matthew Treinish | 2b5287d | 2013-10-22 17:40:34 +0000 | [diff] [blame] | 733 | self.image_feature_enabled = cfg.CONF['image-feature-enabled'] |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 734 | self.network = cfg.CONF.network |
Matthew Treinish | e3d2614 | 2013-11-26 19:14:58 +0000 | [diff] [blame] | 735 | self.network_feature_enabled = cfg.CONF['network-feature-enabled'] |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 736 | self.volume = cfg.CONF.volume |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 737 | self.volume_feature_enabled = cfg.CONF['volume-feature-enabled'] |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 738 | self.object_storage = cfg.CONF['object-storage'] |
Matthew Treinish | d5c9602 | 2013-10-17 21:51:23 +0000 | [diff] [blame] | 739 | self.object_storage_feature_enabled = cfg.CONF[ |
| 740 | 'object-storage-feature-enabled'] |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 741 | self.orchestration = cfg.CONF.orchestration |
Yassine Lamgarchal | b158d41 | 2013-12-27 19:29:42 +0100 | [diff] [blame] | 742 | self.telemetry = cfg.CONF.telemetry |
Julie Pichon | d101764 | 2013-07-24 16:37:23 +0100 | [diff] [blame] | 743 | self.dashboard = cfg.CONF.dashboard |
Sergey Lukjanov | cec6c3f | 2013-12-10 12:38:21 +0400 | [diff] [blame] | 744 | self.data_processing = cfg.CONF.data_processing |
Matthew Treinish | 39e48ef | 2012-12-21 13:36:15 -0500 | [diff] [blame] | 745 | self.boto = cfg.CONF.boto |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 746 | self.compute_admin = cfg.CONF['compute-admin'] |
Matthew Treinish | 615ea6a | 2013-02-25 17:26:59 -0500 | [diff] [blame] | 747 | self.stress = cfg.CONF.stress |
Masayuki Igawa | 73d9f3a | 2013-05-24 10:30:01 +0900 | [diff] [blame] | 748 | self.scenario = cfg.CONF.scenario |
Matthew Treinish | 4c41292 | 2013-07-16 15:27:42 -0400 | [diff] [blame] | 749 | self.service_available = cfg.CONF.service_available |
Attila Fazekas | 5fae7a3 | 2013-09-25 16:52:44 +0200 | [diff] [blame] | 750 | self.debug = cfg.CONF.debug |
Attila Fazekas | cadcb1f | 2013-01-21 23:10:53 +0100 | [diff] [blame] | 751 | if not self.compute_admin.username: |
| 752 | self.compute_admin.username = self.identity.admin_username |
| 753 | self.compute_admin.password = self.identity.admin_password |
| 754 | self.compute_admin.tenant_name = self.identity.admin_tenant_name |
Sean Dague | 86bd842 | 2013-12-20 09:56:44 -0500 | [diff] [blame] | 755 | |
| 756 | |
| 757 | class TempestConfigProxy(object): |
| 758 | _config = None |
| 759 | |
| 760 | def __getattr__(self, attr): |
| 761 | if not self._config: |
Sean Dague | 3b9b1f3 | 2013-12-20 17:04:54 -0500 | [diff] [blame] | 762 | self._config = TempestConfigPrivate() |
Sean Dague | 86bd842 | 2013-12-20 09:56:44 -0500 | [diff] [blame] | 763 | |
| 764 | return getattr(self._config, attr) |
| 765 | |
| 766 | |
| 767 | CONF = TempestConfigProxy() |