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