Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 1 | # Copyright 2016 Rackspace Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
| 15 | |
| 16 | from oslo_config import cfg |
Michael Johnson | 0a0f9b3 | 2019-01-02 16:58:21 -0800 | [diff] [blame] | 17 | from oslo_log import log as logging |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 18 | |
| 19 | from octavia_tempest_plugin.common import constants as const |
| 20 | |
Michael Johnson | 0a0f9b3 | 2019-01-02 16:58:21 -0800 | [diff] [blame] | 21 | |
| 22 | LOG = logging.getLogger(__name__) |
| 23 | |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 24 | service_available_group = cfg.OptGroup(name='service_available', |
| 25 | title='Available OpenStack Services') |
| 26 | |
| 27 | ServiceAvailableGroup = [ |
| 28 | cfg.BoolOpt('load_balancer', |
| 29 | default=True, |
| 30 | help="Whether or not the load-balancer service is expected " |
| 31 | "to be available."), |
| 32 | ] |
| 33 | |
| 34 | octavia_group = cfg.OptGroup(name='load_balancer', |
| 35 | title='load-balancer service options') |
| 36 | |
| 37 | OctaviaGroup = [ |
| 38 | # Tempest plugin common options |
| 39 | cfg.StrOpt("region", |
| 40 | default="", |
| 41 | help="The region name to use. If empty, the value " |
| 42 | "of identity.region is used instead. If no such region " |
| 43 | "is found in the service catalog, the first found one is " |
| 44 | "used."), |
| 45 | cfg.StrOpt('catalog_type', |
| 46 | default='load-balancer', |
| 47 | help='Catalog type of the Octavia service.'), |
| 48 | cfg.StrOpt('endpoint_type', |
| 49 | default='publicURL', |
| 50 | choices=['public', 'admin', 'internal', |
| 51 | 'publicURL', 'adminURL', 'internalURL'], |
| 52 | help="The endpoint type to use for the load-balancer service"), |
| 53 | cfg.IntOpt('build_interval', |
| 54 | default=5, |
| 55 | help='Time in seconds between build status checks for ' |
| 56 | 'non-load-balancer resources to build'), |
| 57 | cfg.IntOpt('build_timeout', |
Jacky Hu | 2b95f2f | 2018-09-30 09:12:25 +0800 | [diff] [blame] | 58 | default=300, |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 59 | help='Timeout in seconds to wait for non-load-balancer ' |
| 60 | 'resources to build'), |
Michael Johnson | 0a0f9b3 | 2019-01-02 16:58:21 -0800 | [diff] [blame] | 61 | cfg.StrOpt('octavia_svc_username', default='admin', |
| 62 | help='The service_auth username the Octavia services are using' |
| 63 | 'to access other OpenStack services.'), |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 64 | # load-balancer specific options |
| 65 | cfg.IntOpt('check_interval', |
| 66 | default=5, |
| 67 | help='Interval to check for status changes.'), |
| 68 | cfg.IntOpt('check_timeout', |
Michael Johnson | 6d99fc6 | 2018-07-22 16:04:48 -0700 | [diff] [blame] | 69 | default=120, |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 70 | help='Timeout, in seconds, to wait for a status change.'), |
| 71 | cfg.BoolOpt('test_with_noop', |
| 72 | default=False, |
| 73 | help='Runs the tests assuming no-op drivers are being used. ' |
| 74 | 'Tests will assume no actual amphora are created.'), |
| 75 | cfg.IntOpt('lb_build_interval', |
| 76 | default=10, |
| 77 | help='Time in seconds between build status checks for a ' |
| 78 | 'load balancer.'), |
| 79 | cfg.IntOpt('lb_build_timeout', |
| 80 | default=900, |
| 81 | help='Timeout in seconds to wait for a ' |
| 82 | 'load balancer to build.'), |
| 83 | cfg.StrOpt('member_role', |
| 84 | default='load-balancer_member', |
| 85 | help='The load balancing member RBAC role.'), |
| 86 | cfg.StrOpt('admin_role', |
| 87 | default='load-balancer_admin', |
| 88 | help='The load balancing admin RBAC role.'), |
| 89 | cfg.IntOpt('scp_connection_timeout', |
| 90 | default=5, |
| 91 | help='Timeout in seconds to wait for a ' |
| 92 | 'scp connection to complete.'), |
| 93 | cfg.IntOpt('scp_connection_attempts', |
| 94 | default=20, |
| 95 | help='Retries for scp to attempt to connect.'), |
| 96 | cfg.StrOpt('provider', |
| 97 | default='octavia', |
| 98 | help='The provider driver to use for the tests.'), |
| 99 | cfg.StrOpt('RBAC_test_type', default=const.ADVANCED, |
| 100 | choices=[const.ADVANCED, const.OWNERADMIN, const.NONE], |
| 101 | help='Type of RBAC tests to run. "advanced" runs the octavia ' |
| 102 | 'default RBAC tests. "owner_or_admin" runs the legacy ' |
| 103 | 'owner or admin tests. "none" disables the RBAC tests.'), |
Michael Johnson | fc223fe | 2019-01-15 16:40:05 -0800 | [diff] [blame] | 104 | cfg.DictOpt('enabled_provider_drivers', |
Carlos Goncalves | decfc35 | 2019-07-25 19:31:52 +0200 | [diff] [blame] | 105 | help=('A comma separated list of dictionaries of the ' |
| 106 | 'enabled provider driver names and descriptions. ' |
| 107 | 'Must match the driver name in the ' |
Michael Johnson | fc223fe | 2019-01-15 16:40:05 -0800 | [diff] [blame] | 108 | 'octavia.api.drivers entrypoint. Example: ' |
Carlos Goncalves | decfc35 | 2019-07-25 19:31:52 +0200 | [diff] [blame] | 109 | 'amphora:The Octavia Amphora driver.,' |
| 110 | 'octavia:Deprecated alias of the Octavia ' |
Ann Taraday | 7d0b582 | 2019-10-17 15:28:30 +0400 | [diff] [blame] | 111 | 'Amphora driver.,' |
| 112 | 'amphorav2:The Octavia Amphora driver that uses ' |
| 113 | 'taskflow jobboard persistence.'), |
Michael Johnson | fc223fe | 2019-01-15 16:40:05 -0800 | [diff] [blame] | 114 | default={'amphora': 'The Octavia Amphora driver.', |
Ann Taraday | 7d0b582 | 2019-10-17 15:28:30 +0400 | [diff] [blame] | 115 | 'amphorav2': 'The Octavia Amphora driver that uses ' |
| 116 | 'taskflow jobboard persistence.', |
Michael Johnson | fc223fe | 2019-01-15 16:40:05 -0800 | [diff] [blame] | 117 | 'octavia': 'Deprecated alias of the Octavia Amphora ' |
| 118 | 'driver.'}), |
Carlos Goncalves | ee09a1b | 2019-07-22 11:45:04 +0200 | [diff] [blame] | 119 | cfg.StrOpt('loadbalancer_topology', |
| 120 | default=const.SINGLE, |
| 121 | choices=const.SUPPORTED_LB_TOPOLOGIES, |
| 122 | help='Load balancer topology configuration.'), |
Michael Johnson | 77df032 | 2019-01-15 18:27:58 -0800 | [diff] [blame] | 123 | cfg.DictOpt('expected_flavor_capability', |
| 124 | help=('Defines a provider flavor capability that is expected ' |
| 125 | 'to be present in the selected provider under test. ' |
| 126 | 'It is specified in a "name": "description" dict. ' |
| 127 | 'Example: {"loadbalancer_topology": "The load balancer ' |
| 128 | 'topology. One of: SINGLE - One amphora per load ' |
| 129 | 'balancer. ACTIVE_STANDBY - Two amphora per load ' |
| 130 | 'balancer."}'), |
| 131 | default={'loadbalancer_topology': 'The load balancer ' |
| 132 | 'topology. One of: SINGLE - One amphora per load ' |
| 133 | 'balancer. ACTIVE_STANDBY - Two amphora per load ' |
| 134 | 'balancer.'}), |
Adam Harwell | c2aa20c | 2019-11-20 11:15:07 -0800 | [diff] [blame] | 135 | cfg.DictOpt('expected_availability_zone_capability', |
| 136 | help=('Defines a provider availability zone capability that ' |
| 137 | 'is expected to be present in the selected provider ' |
| 138 | 'under test. It is specified in a "name": "description" ' |
| 139 | 'dict. Example: {"compute_zone": "The compute ' |
| 140 | 'availability zone."}'), |
| 141 | default={'compute_zone': 'The compute availability zone.'}), |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 142 | # Networking |
| 143 | cfg.BoolOpt('test_with_ipv6', |
| 144 | default=True, |
| 145 | help='When true the IPv6 tests will be run.'), |
| 146 | cfg.BoolOpt('disable_boot_network', default=False, |
| 147 | help='True if your cloud does not allow creating networks or ' |
| 148 | 'specifying the boot network for instances.'), |
| 149 | cfg.BoolOpt('enable_security_groups', default=False, |
| 150 | help='When true, security groups will be created for the test ' |
| 151 | 'servers. When false, port security will be disabled on ' |
| 152 | 'the created networks.'), |
| 153 | cfg.StrOpt('test_network_override', |
| 154 | help='Overrides network creation and uses this network ID for ' |
| 155 | 'all tests (VIP, members, etc.). Required if ' |
| 156 | 'test_subnet_override is set.'), |
| 157 | cfg.StrOpt('test_subnet_override', |
| 158 | help='Overrides subnet creation and uses this subnet ID for ' |
| 159 | 'all IPv4 tests (VIP, members, etc.). Optional'), |
| 160 | cfg.StrOpt('test_ipv6_subnet_override', |
| 161 | help='Overrides subnet creation and uses this subnet ID for ' |
| 162 | 'all IPv6 tests (VIP, members, etc.). Optional and only ' |
| 163 | 'valid if test_network_override is set.'), |
| 164 | cfg.StrOpt('vip_subnet_cidr', |
| 165 | default='10.1.1.0/24', |
| 166 | help='CIDR format subnet to use for the vip subnet.'), |
| 167 | cfg.StrOpt('vip_ipv6_subnet_cidr', |
| 168 | default='fdde:1a92:7523:70a0::/64', |
| 169 | help='CIDR format subnet to use for the IPv6 vip subnet.'), |
| 170 | cfg.StrOpt('member_1_ipv4_subnet_cidr', |
| 171 | default='10.2.1.0/24', |
| 172 | help='CIDR format subnet to use for the member 1 subnet.'), |
| 173 | cfg.StrOpt('member_1_ipv6_subnet_cidr', |
| 174 | default='fd7b:f9f7:0fff:4eca::/64', |
| 175 | help='CIDR format subnet to use for the member 1 ipv6 subnet.'), |
| 176 | cfg.StrOpt('member_2_ipv4_subnet_cidr', |
| 177 | default='10.2.2.0/24', |
| 178 | help='CIDR format subnet to use for the member 2 subnet.'), |
| 179 | cfg.StrOpt('member_2_ipv6_subnet_cidr', |
| 180 | default='fd77:1457:4cf0:26a8::/64', |
| 181 | help='CIDR format subnet to use for the member 1 ipv6 subnet.'), |
Carlos Goncalves | c2e1216 | 2019-02-14 23:57:44 +0100 | [diff] [blame] | 182 | # Amphora specific options |
| 183 | cfg.StrOpt('amphora_ssh_user', |
| 184 | default='ubuntu', |
| 185 | help='The amphora SSH user.'), |
| 186 | cfg.StrOpt('amphora_ssh_key', |
Carlos Goncalves | 9891de0 | 2019-07-28 13:37:33 +0200 | [diff] [blame] | 187 | default='/etc/octavia/.ssh/octavia_ssh_key', |
Carlos Goncalves | c2e1216 | 2019-02-14 23:57:44 +0100 | [diff] [blame] | 188 | help='The amphora SSH key file.'), |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 189 | # Environment specific options |
Carlos Goncalves | c2e1216 | 2019-02-14 23:57:44 +0100 | [diff] [blame] | 190 | # These are used to accomodate clouds with specific limitations |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 191 | cfg.IntOpt('random_server_name_length', |
| 192 | default=0, |
| 193 | help='If non-zero, generate a random name of the length ' |
| 194 | 'provided for each server, in the format "m[A-Z0-9]*". '), |
| 195 | cfg.StrOpt('availability_zone', |
| 196 | default=None, |
| 197 | help='Availability zone to use for creating servers.'), |
Michael Johnson | a1862ff | 2020-06-21 12:15:27 -0700 | [diff] [blame] | 198 | cfg.StrOpt('availability_zone2', |
| 199 | default=None, |
| 200 | help='A second availability zone to use for creating servers.'), |
| 201 | cfg.StrOpt('availability_zone3', |
| 202 | default=None, |
| 203 | help='A third availability zone to use for creating servers.'), |
Maciej Józefczyk | 6a508ce | 2019-07-26 13:10:50 +0000 | [diff] [blame] | 204 | cfg.BoolOpt('test_reuse_connection', default=True, |
| 205 | help='Reuse TCP connections while testing LB with ' |
| 206 | 'HTTP members (keep-alive).'), |
Michael Johnson | b1ba3b3 | 2019-07-30 20:23:51 -0700 | [diff] [blame] | 207 | # Log offloading specific options |
| 208 | cfg.StrOpt('tenant_flow_log_file', |
| 209 | default='/var/log/octavia-tenant-traffic.log', |
| 210 | help='File path, on the tempest system, to the tenant flow ' |
| 211 | 'log file.'), |
Michael Johnson | 7bd2f97 | 2019-07-30 21:32:04 -0700 | [diff] [blame^] | 212 | cfg.StrOpt('amphora_admin_log_file', |
| 213 | default='/var/log/octavia-amphora.log', |
| 214 | help='File path, on the tempest system, to the amphora admin ' |
| 215 | 'log file.'), |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 216 | ] |
Reedip | f88cffc | 2018-09-03 13:20:08 +0000 | [diff] [blame] | 217 | |
| 218 | lb_feature_enabled_group = cfg.OptGroup(name='loadbalancer-feature-enabled', |
| 219 | title='Enabled/Disabled LB features') |
| 220 | LBFeatureEnabledGroup = [ |
Michael Johnson | 6fbfed0 | 2020-03-19 15:37:31 -0700 | [diff] [blame] | 221 | cfg.BoolOpt('not_implemented_is_error', |
| 222 | default=True, |
| 223 | help="When True, not-implemented responses from the API are " |
| 224 | "considered an error and test failure. This should be " |
| 225 | "used when a driver should support all of the Octavia " |
| 226 | "API features, such as the reference driver."), |
Reedip | f88cffc | 2018-09-03 13:20:08 +0000 | [diff] [blame] | 227 | cfg.BoolOpt('health_monitor_enabled', |
| 228 | default=True, |
Carlos Goncalves | cc7dbcd | 2019-03-14 18:48:12 +0100 | [diff] [blame] | 229 | help="Whether Health Monitor is available with provider " |
| 230 | "driver or not."), |
Michael Johnson | 0a0f9b3 | 2019-01-02 16:58:21 -0800 | [diff] [blame] | 231 | cfg.BoolOpt('terminated_tls_enabled', |
| 232 | default=True, |
| 233 | help="Whether TLS termination is available with provider " |
| 234 | "driver or not."), |
Reedip | 6626f25 | 2018-12-03 07:31:34 +0000 | [diff] [blame] | 235 | cfg.BoolOpt('l7_protocol_enabled', |
| 236 | default=True, |
Carlos Goncalves | cc7dbcd | 2019-03-14 18:48:12 +0100 | [diff] [blame] | 237 | help="Whether L7 Protocols are available with the provider " |
| 238 | "driver or not."), |
| 239 | cfg.BoolOpt('pool_algorithms_enabled', |
| 240 | default=True, |
| 241 | help="Whether pool algorithms are available with provider" |
| 242 | "driver or not."), |
Reedip | 6626f25 | 2018-12-03 07:31:34 +0000 | [diff] [blame] | 243 | cfg.StrOpt('l4_protocol', |
| 244 | default="TCP", |
Carlos Goncalves | cc7dbcd | 2019-03-14 18:48:12 +0100 | [diff] [blame] | 245 | help="The type of L4 Protocol which is supported with the " |
| 246 | "provider driver."), |
Gregory Thiemonge | e037eb8 | 2019-09-19 16:22:19 +0200 | [diff] [blame] | 247 | cfg.BoolOpt('spare_pool_enabled', |
| 248 | default=False, |
| 249 | help="Wether spare pool is available with amphora provider " |
| 250 | "driver or not."), |
Reedip Banerjee | 2bb585d | 2019-03-22 08:06:12 +0000 | [diff] [blame] | 251 | cfg.BoolOpt('session_persistence_enabled', |
| 252 | default=True, |
| 253 | help="Whether session persistence is supported with the " |
| 254 | "provider driver."), |
Michael Johnson | b1ba3b3 | 2019-07-30 20:23:51 -0700 | [diff] [blame] | 255 | cfg.BoolOpt('log_offload_enabled', default=False, |
| 256 | help="Whether the log offload tests will run. These require " |
| 257 | "the tempest instance have access to the log files " |
| 258 | "specified in the tempest configuration."), |
Reedip | f88cffc | 2018-09-03 13:20:08 +0000 | [diff] [blame] | 259 | ] |