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