| 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', | 
| Steve Baker | 7c9115d | 2015-08-03 11:12:46 +1200 | [diff] [blame] | 30 |                default=(os.environ.get('OS_PROJECT_NAME') or | 
 | 31 |                         os.environ.get('OS_TENANT_NAME')), | 
| Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 32 |                help="Tenant name to use for API requests."), | 
 | 33 |     cfg.StrOpt('auth_url', | 
 | 34 |                default=os.environ.get('OS_AUTH_URL'), | 
 | 35 |                help="Full URI of the OpenStack Identity API (Keystone), v2"), | 
 | 36 |     cfg.StrOpt('region', | 
 | 37 |                default=os.environ.get('OS_REGION_NAME'), | 
 | 38 |                help="The region name to us"), | 
 | 39 |     cfg.StrOpt('instance_type', | 
| Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 40 |                help="Instance type for tests. Needs to be big enough for a " | 
 | 41 |                     "full OS plus the test workload"), | 
| Pavlo Shchelokovskyy | 46e5cb2 | 2015-03-23 12:01:25 +0000 | [diff] [blame] | 42 |     cfg.StrOpt('minimal_instance_type', | 
 | 43 |                help="Instance type enough for simplest cases."), | 
| Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 44 |     cfg.StrOpt('image_ref', | 
| Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 45 |                help="Name of image to use for tests which boot servers."), | 
 | 46 |     cfg.StrOpt('keypair_name', | 
 | 47 |                default=None, | 
 | 48 |                help="Name of existing keypair to launch servers with."), | 
 | 49 |     cfg.StrOpt('minimal_image_ref', | 
| Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 50 |                help="Name of minimal (e.g cirros) image to use when " | 
 | 51 |                     "launching test instances."), | 
 | 52 |     cfg.StrOpt('auth_version', | 
 | 53 |                default='v2', | 
 | 54 |                help="Identity API version to be used for authentication " | 
 | 55 |                     "for API tests."), | 
 | 56 |     cfg.BoolOpt('disable_ssl_certificate_validation', | 
 | 57 |                 default=False, | 
 | 58 |                 help="Set to True if using self-signed SSL certificates."), | 
 | 59 |     cfg.IntOpt('build_interval', | 
 | 60 |                default=4, | 
 | 61 |                help="Time in seconds between build status checks."), | 
 | 62 |     cfg.IntOpt('build_timeout', | 
 | 63 |                default=1200, | 
 | 64 |                help="Timeout in seconds to wait for a stack to build."), | 
 | 65 |     cfg.StrOpt('network_for_ssh', | 
| Rabi Mishra | ec4b03b | 2015-05-23 02:20:47 +0530 | [diff] [blame] | 66 |                default='heat-net', | 
| Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 67 |                help="Network used for SSH connections."), | 
 | 68 |     cfg.StrOpt('fixed_network_name', | 
| Rabi Mishra | ec4b03b | 2015-05-23 02:20:47 +0530 | [diff] [blame] | 69 |                default='heat-net', | 
| Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 70 |                help="Visible fixed network name "), | 
| Pavlo Shchelokovskyy | 6fa2380 | 2015-03-23 11:22:35 +0000 | [diff] [blame] | 71 |     cfg.StrOpt('floating_network_name', | 
 | 72 |                default='public', | 
 | 73 |                help="Visible floating network name "), | 
| Steve Baker | 0b679bb | 2015-03-11 13:46:42 +1300 | [diff] [blame] | 74 |     cfg.StrOpt('boot_config_env', | 
| Steve Baker | 803f150 | 2015-03-11 13:47:08 +1300 | [diff] [blame] | 75 |                default=('heat_integrationtests/scenario/templates' | 
 | 76 |                         '/boot_config_none_env.yaml'), | 
| Steve Baker | 0b679bb | 2015-03-11 13:46:42 +1300 | [diff] [blame] | 77 |                help="Path to environment file which defines the " | 
 | 78 |                     "resource type Heat::InstallConfigAgent. Needs to " | 
 | 79 |                     "be appropriate for the image_ref."), | 
| kairat_kushaev | 0ab3d7c | 2015-01-27 21:48:46 +0300 | [diff] [blame] | 80 |     cfg.StrOpt('fixed_subnet_name', | 
| Rabi Mishra | ec4b03b | 2015-05-23 02:20:47 +0530 | [diff] [blame] | 81 |                default='heat-subnet', | 
| kairat_kushaev | 0ab3d7c | 2015-01-27 21:48:46 +0300 | [diff] [blame] | 82 |                help="Visible fixed sub-network name "), | 
| Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 83 |     cfg.IntOpt('ssh_timeout', | 
 | 84 |                default=300, | 
 | 85 |                help="Timeout in seconds to wait for authentication to " | 
 | 86 |                     "succeed."), | 
 | 87 |     cfg.IntOpt('ip_version_for_ssh', | 
 | 88 |                default=4, | 
 | 89 |                help="IP version used for SSH connections."), | 
 | 90 |     cfg.IntOpt('ssh_channel_timeout', | 
 | 91 |                default=60, | 
 | 92 |                help="Timeout in seconds to wait for output from ssh " | 
 | 93 |                     "channel."), | 
 | 94 |     cfg.IntOpt('tenant_network_mask_bits', | 
 | 95 |                default=28, | 
 | 96 |                help="The mask bits for tenant ipv4 subnets"), | 
| Rabi Mishra | 477efc9 | 2015-07-31 13:01:45 +0530 | [diff] [blame] | 97 |     cfg.BoolOpt('skip_scenario_tests', | 
 | 98 |                 default=False, | 
 | 99 |                 help="Skip all scenario tests"), | 
 | 100 |     cfg.BoolOpt('skip_functional_tests', | 
 | 101 |                 default=False, | 
 | 102 |                 help="Skip all functional tests"), | 
 | 103 |     cfg.ListOpt('skip_functional_test_list', | 
 | 104 |                 help="List of functional test class names to skip " | 
 | 105 |                      "ex. AutoscalingGroupTest, CreateStackTest"), | 
 | 106 |     cfg.ListOpt('skip_scenario_test_list', | 
 | 107 |                 help="List of scenario test class names to skip " | 
 | 108 |                      "ex. NeutronLoadBalancerTest,"), | 
 | 109 |     cfg.ListOpt('skip_test_stack_action_list', | 
 | 110 |                 help="List of stack actions in tests to skip " | 
 | 111 |                      "ex. ABANDON, ADOPT, SUSPEND, RESUME"), | 
| Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 112 |     cfg.IntOpt('volume_size', | 
 | 113 |                default=1, | 
 | 114 |                help='Default size in GB for volumes created by volumes tests'), | 
| Anastasia Kuznetsova | 3e0ab4d | 2015-03-06 18:10:13 +0400 | [diff] [blame] | 115 |     cfg.IntOpt('connectivity_timeout', | 
 | 116 |                default=120, | 
 | 117 |                help="Timeout in seconds to wait for connectivity to " | 
 | 118 |                     "server."), | 
| Oleksii Chuprykov | 4be023a | 2015-07-08 07:17:08 -0400 | [diff] [blame] | 119 |     cfg.IntOpt('sighup_timeout', | 
 | 120 |                default=30, | 
 | 121 |                help="Timeout in seconds to wait for adding or removing child" | 
 | 122 |                     "process after receiving of sighup signal") | 
| Steve Baker | 450aa7f | 2014-08-25 10:37:27 +1200 | [diff] [blame] | 123 | ] | 
 | 124 |  | 
 | 125 |  | 
 | 126 | def init_conf(read_conf=True): | 
 | 127 |  | 
 | 128 |     default_config_files = None | 
 | 129 |     if read_conf: | 
 | 130 |         confpath = os.path.join( | 
 | 131 |             os.path.dirname(os.path.realpath(heat_integrationtests.__file__)), | 
 | 132 |             'heat_integrationtests.conf') | 
 | 133 |         if os.path.isfile(confpath): | 
 | 134 |             default_config_files = [confpath] | 
 | 135 |  | 
 | 136 |     conf = cfg.ConfigOpts() | 
 | 137 |     conf(args=[], project='heat_integrationtests', | 
 | 138 |          default_config_files=default_config_files) | 
 | 139 |  | 
 | 140 |     for opt in IntegrationTestGroup: | 
 | 141 |         conf.register_opt(opt) | 
 | 142 |     return conf | 
 | 143 |  | 
 | 144 |  | 
| Thomas Herve | cd3622e | 2014-12-17 10:36:51 +0100 | [diff] [blame] | 145 | def list_opts(): | 
 | 146 |     yield None, IntegrationTestGroup |