Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 2 | # not use this file except in compliance with the License. You may obtain |
| 3 | # a copy of the License at |
| 4 | # |
| 5 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | # |
| 7 | # Unless required by applicable law or agreed to in writing, software |
| 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 10 | # License for the specific language governing permissions and limitations |
| 11 | # under the License. |
| 12 | |
| 13 | import os |
Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 14 | |
Jens Rosenboom | 4f069fb | 2015-02-18 14:19:07 +0100 | [diff] [blame] | 15 | from oslo_config import cfg |
Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 16 | |
| 17 | import heat_integrationtests |
| 18 | |
| 19 | |
| 20 | IntegrationTestGroup = [ |
| 21 | |
| 22 | cfg.StrOpt('username', |
| 23 | default=os.environ.get('OS_USERNAME'), |
| 24 | help="Username to use for API requests."), |
| 25 | cfg.StrOpt('password', |
| 26 | default=os.environ.get('OS_PASSWORD'), |
| 27 | help="API key to use when authenticating.", |
| 28 | secret=True), |
| 29 | cfg.StrOpt('tenant_name', |
| 30 | default=os.environ.get('OS_TENANT_NAME'), |
| 31 | help="Tenant name to use for API requests."), |
| 32 | cfg.StrOpt('auth_url', |
| 33 | default=os.environ.get('OS_AUTH_URL'), |
| 34 | help="Full URI of the OpenStack Identity API (Keystone), v2"), |
| 35 | cfg.StrOpt('region', |
| 36 | default=os.environ.get('OS_REGION_NAME'), |
| 37 | help="The region name to us"), |
| 38 | cfg.StrOpt('instance_type', |
Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 39 | help="Instance type for tests. Needs to be big enough for a " |
| 40 | "full OS plus the test workload"), |
| 41 | cfg.StrOpt('image_ref', |
Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 42 | help="Name of image to use for tests which boot servers."), |
| 43 | cfg.StrOpt('keypair_name', |
| 44 | default=None, |
| 45 | help="Name of existing keypair to launch servers with."), |
| 46 | cfg.StrOpt('minimal_image_ref', |
Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 47 | help="Name of minimal (e.g cirros) image to use when " |
| 48 | "launching test instances."), |
| 49 | cfg.StrOpt('auth_version', |
| 50 | default='v2', |
| 51 | help="Identity API version to be used for authentication " |
| 52 | "for API tests."), |
| 53 | cfg.BoolOpt('disable_ssl_certificate_validation', |
| 54 | default=False, |
| 55 | help="Set to True if using self-signed SSL certificates."), |
| 56 | cfg.IntOpt('build_interval', |
| 57 | default=4, |
| 58 | help="Time in seconds between build status checks."), |
| 59 | cfg.IntOpt('build_timeout', |
| 60 | default=1200, |
| 61 | help="Timeout in seconds to wait for a stack to build."), |
| 62 | cfg.StrOpt('network_for_ssh', |
| 63 | default='private', |
| 64 | help="Network used for SSH connections."), |
| 65 | cfg.StrOpt('fixed_network_name', |
| 66 | default='private', |
| 67 | help="Visible fixed network name "), |
Steve Baker | 0b679bb | 2015-03-11 13:46:42 +1300 | [diff] [blame] | 68 | cfg.StrOpt('boot_config_env', |
| 69 | default='heat_integrationtests/scenario/templates' |
| 70 | '/boot_config_none_env.yaml', |
| 71 | help="Path to environment file which defines the " |
| 72 | "resource type Heat::InstallConfigAgent. Needs to " |
| 73 | "be appropriate for the image_ref."), |
kairat_kushaev | 0ab3d7c | 2015-01-27 21:48:46 +0300 | [diff] [blame] | 74 | cfg.StrOpt('fixed_subnet_name', |
| 75 | default='private-subnet', |
| 76 | help="Visible fixed sub-network name "), |
Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 77 | cfg.IntOpt('ssh_timeout', |
| 78 | default=300, |
| 79 | help="Timeout in seconds to wait for authentication to " |
| 80 | "succeed."), |
| 81 | cfg.IntOpt('ip_version_for_ssh', |
| 82 | default=4, |
| 83 | help="IP version used for SSH connections."), |
| 84 | cfg.IntOpt('ssh_channel_timeout', |
| 85 | default=60, |
| 86 | help="Timeout in seconds to wait for output from ssh " |
| 87 | "channel."), |
| 88 | cfg.IntOpt('tenant_network_mask_bits', |
| 89 | default=28, |
| 90 | help="The mask bits for tenant ipv4 subnets"), |
Steve Baker | f6c8f12 | 2015-02-10 13:54:46 +1300 | [diff] [blame] | 91 | cfg.BoolOpt('skip_software_config_tests', |
| 92 | default=True, |
| 93 | help="Skip software config deployment tests"), |
Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 94 | cfg.IntOpt('volume_size', |
| 95 | default=1, |
| 96 | help='Default size in GB for volumes created by volumes tests'), |
Sirushti Murugesan | 04ee802 | 2015-02-02 23:00:23 +0530 | [diff] [blame] | 97 | cfg.BoolOpt('skip_stack_adopt_tests', |
| 98 | default=False, |
| 99 | help="Skip Stack Adopt Integration tests"), |
| 100 | cfg.BoolOpt('skip_stack_abandon_tests', |
| 101 | default=False, |
| 102 | help="Skip Stack Abandon Integration tests"), |
Anastasia Kuznetsova | 3e0ab4d | 2015-03-06 18:10:13 +0400 | [diff] [blame] | 103 | cfg.IntOpt('connectivity_timeout', |
| 104 | default=120, |
| 105 | help="Timeout in seconds to wait for connectivity to " |
| 106 | "server."), |
Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 107 | ] |
| 108 | |
| 109 | |
| 110 | def init_conf(read_conf=True): |
| 111 | |
| 112 | default_config_files = None |
| 113 | if read_conf: |
| 114 | confpath = os.path.join( |
| 115 | os.path.dirname(os.path.realpath(heat_integrationtests.__file__)), |
| 116 | 'heat_integrationtests.conf') |
| 117 | if os.path.isfile(confpath): |
| 118 | default_config_files = [confpath] |
| 119 | |
| 120 | conf = cfg.ConfigOpts() |
| 121 | conf(args=[], project='heat_integrationtests', |
| 122 | default_config_files=default_config_files) |
| 123 | |
| 124 | for opt in IntegrationTestGroup: |
| 125 | conf.register_opt(opt) |
| 126 | return conf |
| 127 | |
| 128 | |
Thomas Herve | cd3622e | 2014-12-17 10:36:51 +0100 | [diff] [blame] | 129 | def list_opts(): |
| 130 | yield None, IntegrationTestGroup |