blob: fb4cb36cd211c6086a6b8ff3504f887a70d3226c [file] [log] [blame]
Jude Cross986e3f52017-07-24 14:57:20 -07001# 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
16from oslo_config import cfg
Michael Johnson0a0f9b32019-01-02 16:58:21 -080017from oslo_log import log as logging
Jude Cross986e3f52017-07-24 14:57:20 -070018
19from octavia_tempest_plugin.common import constants as const
20
Michael Johnson0a0f9b32019-01-02 16:58:21 -080021
22LOG = logging.getLogger(__name__)
23
Jude Cross986e3f52017-07-24 14:57:20 -070024service_available_group = cfg.OptGroup(name='service_available',
25 title='Available OpenStack Services')
26
27ServiceAvailableGroup = [
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
34octavia_group = cfg.OptGroup(name='load_balancer',
35 title='load-balancer service options')
36
37OctaviaGroup = [
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"),
Michael Johnson6a9236a2020-08-04 23:54:54 +000053 cfg.FloatOpt('build_interval',
54 default=5,
55 help='Time in seconds between build status checks for '
56 'non-load-balancer resources to build'),
Jude Cross986e3f52017-07-24 14:57:20 -070057 cfg.IntOpt('build_timeout',
Jacky Hu2b95f2f2018-09-30 09:12:25 +080058 default=300,
Jude Cross986e3f52017-07-24 14:57:20 -070059 help='Timeout in seconds to wait for non-load-balancer '
60 'resources to build'),
Michael Johnson0a0f9b32019-01-02 16:58:21 -080061 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 Cross986e3f52017-07-24 14:57:20 -070064 # load-balancer specific options
Michael Johnson6a9236a2020-08-04 23:54:54 +000065 cfg.FloatOpt('check_interval',
66 default=5,
67 help='Interval to check for status changes.'),
Jude Cross986e3f52017-07-24 14:57:20 -070068 cfg.IntOpt('check_timeout',
Michael Johnson6d99fc62018-07-22 16:04:48 -070069 default=120,
Jude Cross986e3f52017-07-24 14:57:20 -070070 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.'),
Michael Johnson6a9236a2020-08-04 23:54:54 +000075 cfg.FloatOpt('lb_build_interval',
76 default=10,
77 help='Time in seconds between build status checks for a '
78 'load balancer.'),
Jude Cross986e3f52017-07-24 14:57:20 -070079 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.'),
Michael Johnson6006de72021-02-21 01:42:39 +000089 cfg.StrOpt('observer_role',
90 default='load-balancer_observer',
91 help='The load balancing observer RBAC role.'),
92 cfg.StrOpt('global_observer_role',
93 default='load-balancer_global_observer',
94 help='The load balancing global observer RBAC role.'),
Jude Cross986e3f52017-07-24 14:57:20 -070095 cfg.IntOpt('scp_connection_timeout',
96 default=5,
97 help='Timeout in seconds to wait for a '
98 'scp connection to complete.'),
99 cfg.IntOpt('scp_connection_attempts',
100 default=20,
101 help='Retries for scp to attempt to connect.'),
102 cfg.StrOpt('provider',
103 default='octavia',
104 help='The provider driver to use for the tests.'),
105 cfg.StrOpt('RBAC_test_type', default=const.ADVANCED,
Michael Johnson6006de72021-02-21 01:42:39 +0000106 choices=[const.ADVANCED, const.KEYSTONE_DEFAULT_ROLES,
107 const.OWNERADMIN, const.NONE],
Jude Cross986e3f52017-07-24 14:57:20 -0700108 help='Type of RBAC tests to run. "advanced" runs the octavia '
109 'default RBAC tests. "owner_or_admin" runs the legacy '
Michael Johnson6006de72021-02-21 01:42:39 +0000110 'owner or admin tests. "keystone_default_roles" runs the '
111 'tests using only the keystone default roles. "none" '
112 'disables the RBAC tests.'),
Michael Johnsonfc223fe2019-01-15 16:40:05 -0800113 cfg.DictOpt('enabled_provider_drivers',
Carlos Goncalvesdecfc352019-07-25 19:31:52 +0200114 help=('A comma separated list of dictionaries of the '
115 'enabled provider driver names and descriptions. '
116 'Must match the driver name in the '
Michael Johnsonfc223fe2019-01-15 16:40:05 -0800117 'octavia.api.drivers entrypoint. Example: '
Carlos Goncalvesdecfc352019-07-25 19:31:52 +0200118 'amphora:The Octavia Amphora driver.,'
119 'octavia:Deprecated alias of the Octavia '
Ann Taraday7d0b5822019-10-17 15:28:30 +0400120 'Amphora driver.,'
121 'amphorav2:The Octavia Amphora driver that uses '
122 'taskflow jobboard persistence.'),
Michael Johnsonfc223fe2019-01-15 16:40:05 -0800123 default={'amphora': 'The Octavia Amphora driver.',
Ann Taraday7d0b5822019-10-17 15:28:30 +0400124 'amphorav2': 'The Octavia Amphora driver that uses '
125 'taskflow jobboard persistence.',
Michael Johnsonfc223fe2019-01-15 16:40:05 -0800126 'octavia': 'Deprecated alias of the Octavia Amphora '
127 'driver.'}),
Carlos Goncalvesee09a1b2019-07-22 11:45:04 +0200128 cfg.StrOpt('loadbalancer_topology',
129 default=const.SINGLE,
130 choices=const.SUPPORTED_LB_TOPOLOGIES,
131 help='Load balancer topology configuration.'),
Michael Johnson77df0322019-01-15 18:27:58 -0800132 cfg.DictOpt('expected_flavor_capability',
133 help=('Defines a provider flavor capability that is expected '
134 'to be present in the selected provider under test. '
135 'It is specified in a "name": "description" dict. '
136 'Example: {"loadbalancer_topology": "The load balancer '
137 'topology. One of: SINGLE - One amphora per load '
138 'balancer. ACTIVE_STANDBY - Two amphora per load '
139 'balancer."}'),
140 default={'loadbalancer_topology': 'The load balancer '
141 'topology. One of: SINGLE - One amphora per load '
142 'balancer. ACTIVE_STANDBY - Two amphora per load '
143 'balancer.'}),
Adam Harwellc2aa20c2019-11-20 11:15:07 -0800144 cfg.DictOpt('expected_availability_zone_capability',
145 help=('Defines a provider availability zone capability that '
146 'is expected to be present in the selected provider '
147 'under test. It is specified in a "name": "description" '
148 'dict. Example: {"compute_zone": "The compute '
149 'availability zone."}'),
150 default={'compute_zone': 'The compute availability zone.'}),
Jude Cross986e3f52017-07-24 14:57:20 -0700151 # Networking
152 cfg.BoolOpt('test_with_ipv6',
153 default=True,
154 help='When true the IPv6 tests will be run.'),
155 cfg.BoolOpt('disable_boot_network', default=False,
156 help='True if your cloud does not allow creating networks or '
157 'specifying the boot network for instances.'),
158 cfg.BoolOpt('enable_security_groups', default=False,
159 help='When true, security groups will be created for the test '
160 'servers. When false, port security will be disabled on '
161 'the created networks.'),
162 cfg.StrOpt('test_network_override',
163 help='Overrides network creation and uses this network ID for '
164 'all tests (VIP, members, etc.). Required if '
165 'test_subnet_override is set.'),
166 cfg.StrOpt('test_subnet_override',
167 help='Overrides subnet creation and uses this subnet ID for '
168 'all IPv4 tests (VIP, members, etc.). Optional'),
169 cfg.StrOpt('test_ipv6_subnet_override',
170 help='Overrides subnet creation and uses this subnet ID for '
171 'all IPv6 tests (VIP, members, etc.). Optional and only '
172 'valid if test_network_override is set.'),
173 cfg.StrOpt('vip_subnet_cidr',
174 default='10.1.1.0/24',
175 help='CIDR format subnet to use for the vip subnet.'),
176 cfg.StrOpt('vip_ipv6_subnet_cidr',
177 default='fdde:1a92:7523:70a0::/64',
178 help='CIDR format subnet to use for the IPv6 vip subnet.'),
179 cfg.StrOpt('member_1_ipv4_subnet_cidr',
180 default='10.2.1.0/24',
181 help='CIDR format subnet to use for the member 1 subnet.'),
182 cfg.StrOpt('member_1_ipv6_subnet_cidr',
183 default='fd7b:f9f7:0fff:4eca::/64',
184 help='CIDR format subnet to use for the member 1 ipv6 subnet.'),
185 cfg.StrOpt('member_2_ipv4_subnet_cidr',
186 default='10.2.2.0/24',
187 help='CIDR format subnet to use for the member 2 subnet.'),
188 cfg.StrOpt('member_2_ipv6_subnet_cidr',
189 default='fd77:1457:4cf0:26a8::/64',
190 help='CIDR format subnet to use for the member 1 ipv6 subnet.'),
Carlos Goncalvesc2e12162019-02-14 23:57:44 +0100191 # Amphora specific options
192 cfg.StrOpt('amphora_ssh_user',
193 default='ubuntu',
194 help='The amphora SSH user.'),
195 cfg.StrOpt('amphora_ssh_key',
Carlos Goncalves9891de02019-07-28 13:37:33 +0200196 default='/etc/octavia/.ssh/octavia_ssh_key',
Carlos Goncalvesc2e12162019-02-14 23:57:44 +0100197 help='The amphora SSH key file.'),
Jude Cross986e3f52017-07-24 14:57:20 -0700198 # Environment specific options
Carlos Goncalvesc2e12162019-02-14 23:57:44 +0100199 # These are used to accomodate clouds with specific limitations
Jude Cross986e3f52017-07-24 14:57:20 -0700200 cfg.IntOpt('random_server_name_length',
201 default=0,
202 help='If non-zero, generate a random name of the length '
203 'provided for each server, in the format "m[A-Z0-9]*". '),
204 cfg.StrOpt('availability_zone',
205 default=None,
206 help='Availability zone to use for creating servers.'),
Michael Johnsona1862ff2020-06-21 12:15:27 -0700207 cfg.StrOpt('availability_zone2',
208 default=None,
209 help='A second availability zone to use for creating servers.'),
210 cfg.StrOpt('availability_zone3',
211 default=None,
212 help='A third availability zone to use for creating servers.'),
Maciej Józefczyk6a508ce2019-07-26 13:10:50 +0000213 cfg.BoolOpt('test_reuse_connection', default=True,
214 help='Reuse TCP connections while testing LB with '
215 'HTTP members (keep-alive).'),
Michael Johnsonb1ba3b32019-07-30 20:23:51 -0700216 # Log offloading specific options
217 cfg.StrOpt('tenant_flow_log_file',
218 default='/var/log/octavia-tenant-traffic.log',
219 help='File path, on the tempest system, to the tenant flow '
220 'log file.'),
Michael Johnson7bd2f972019-07-30 21:32:04 -0700221 cfg.StrOpt('amphora_admin_log_file',
222 default='/var/log/octavia-amphora.log',
223 help='File path, on the tempest system, to the amphora admin '
224 'log file.'),
Michael Johnson27357352020-11-13 13:55:09 -0800225 cfg.StrOpt('test_server_path',
226 default='/opt/octavia-tempest-plugin/test_server.bin',
227 help='Filesystem path to the test web server that will be '
228 'installed in the web server VMs.'),
Michael Johnson6006de72021-02-21 01:42:39 +0000229 # RBAC related options
230 # Note: Also see the enforce_scope section (from tempest) for Octavia API
231 # scope checking setting.
232 cfg.BoolOpt('enforce_new_defaults',
233 default=False,
234 help='Does the load-balancer service API policies enforce '
235 'the new keystone default roles? This configuration '
236 'value should be same as octavia.conf: '
237 '[oslo_policy].enforce_new_defaults option.'),
Jude Cross986e3f52017-07-24 14:57:20 -0700238]
Reedipf88cffc2018-09-03 13:20:08 +0000239
240lb_feature_enabled_group = cfg.OptGroup(name='loadbalancer-feature-enabled',
241 title='Enabled/Disabled LB features')
242LBFeatureEnabledGroup = [
Michael Johnson6fbfed02020-03-19 15:37:31 -0700243 cfg.BoolOpt('not_implemented_is_error',
244 default=True,
245 help="When True, not-implemented responses from the API are "
246 "considered an error and test failure. This should be "
247 "used when a driver should support all of the Octavia "
248 "API features, such as the reference driver."),
Reedipf88cffc2018-09-03 13:20:08 +0000249 cfg.BoolOpt('health_monitor_enabled',
250 default=True,
Carlos Goncalvescc7dbcd2019-03-14 18:48:12 +0100251 help="Whether Health Monitor is available with provider "
252 "driver or not."),
Michael Johnson0a0f9b32019-01-02 16:58:21 -0800253 cfg.BoolOpt('terminated_tls_enabled',
254 default=True,
255 help="Whether TLS termination is available with provider "
256 "driver or not."),
Reedip6626f252018-12-03 07:31:34 +0000257 cfg.BoolOpt('l7_protocol_enabled',
258 default=True,
Carlos Goncalvescc7dbcd2019-03-14 18:48:12 +0100259 help="Whether L7 Protocols are available with the provider "
260 "driver or not."),
261 cfg.BoolOpt('pool_algorithms_enabled',
262 default=True,
263 help="Whether pool algorithms are available with provider"
264 "driver or not."),
Reedip6626f252018-12-03 07:31:34 +0000265 cfg.StrOpt('l4_protocol',
266 default="TCP",
Carlos Goncalvescc7dbcd2019-03-14 18:48:12 +0100267 help="The type of L4 Protocol which is supported with the "
268 "provider driver."),
Gregory Thiemongee037eb82019-09-19 16:22:19 +0200269 cfg.BoolOpt('spare_pool_enabled',
270 default=False,
271 help="Wether spare pool is available with amphora provider "
272 "driver or not."),
Reedip Banerjee2bb585d2019-03-22 08:06:12 +0000273 cfg.BoolOpt('session_persistence_enabled',
274 default=True,
275 help="Whether session persistence is supported with the "
276 "provider driver."),
Michael Johnsonb1ba3b32019-07-30 20:23:51 -0700277 cfg.BoolOpt('log_offload_enabled', default=False,
278 help="Whether the log offload tests will run. These require "
279 "the tempest instance have access to the log files "
280 "specified in the tempest configuration."),
Reedipf88cffc2018-09-03 13:20:08 +0000281]
Michael Johnson6006de72021-02-21 01:42:39 +0000282
283# Extending this enforce_scope group defined in tempest
284enforce_scope_group = cfg.OptGroup(name="enforce_scope",
285 title="OpenStack Services with "
286 "enforce scope")
287EnforceScopeGroup = [
288 cfg.BoolOpt('octavia',
289 default=False,
290 help='Does the load-balancer service API policies enforce '
291 'scope? This configuration value should be same as '
292 'octavia.conf: [oslo_policy].enforce_scope option.'),
293]