Maru Newby | b096d9f | 2015-03-09 18:54:54 +0000 | [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 | |
Ihar Hrachyshka | c695f9f | 2015-02-26 23:26:41 +0100 | [diff] [blame] | 13 | from oslo_config import cfg |
Assaf Muller | d22ca2e | 2016-01-19 11:47:14 -0500 | [diff] [blame] | 14 | from tempest import config |
| 15 | |
Assaf Muller | 65cc2d2 | 2016-04-07 17:56:03 -0400 | [diff] [blame] | 16 | |
Assaf Muller | d22ca2e | 2016-01-19 11:47:14 -0500 | [diff] [blame] | 17 | CONF = config.CONF |
Maru Newby | b096d9f | 2015-03-09 18:54:54 +0000 | [diff] [blame] | 18 | |
| 19 | |
Assaf Muller | d22ca2e | 2016-01-19 11:47:14 -0500 | [diff] [blame] | 20 | NeutronPluginOptions = [ |
Armando Migliaccio | 7f84c42 | 2017-02-21 18:43:38 -0800 | [diff] [blame] | 21 | cfg.ListOpt('provider_vlans', |
| 22 | default=[], |
| 23 | help='List of provider networks available in the deployment.'), |
Lajos Katona | 2f90465 | 2018-08-23 14:04:56 +0200 | [diff] [blame] | 24 | cfg.IntOpt('provider_net_base_segm_id', |
| 25 | default=3000, |
| 26 | help='Base segmentation ID to create provider networks. ' |
| 27 | 'This value will be increased in case of conflict.'), |
Yuuichi Fujioka | 1257b57 | 2015-06-10 17:18:12 +0900 | [diff] [blame] | 28 | cfg.BoolOpt('specify_floating_ip_address_available', |
| 29 | default=True, |
| 30 | help='Allow passing an IP Address of the floating ip when ' |
Hynek Mlnarik | c510676 | 2016-09-01 11:47:31 +0200 | [diff] [blame] | 31 | 'creating the floating ip'), |
| 32 | cfg.ListOpt('available_type_drivers', |
| 33 | default=[], |
| 34 | help='List of network types available to neutron, ' |
| 35 | 'e.g. vxlan,vlan,gre.'), |
Chandan Kumar | c125fd1 | 2017-11-15 19:41:01 +0530 | [diff] [blame] | 36 | cfg.StrOpt('agent_availability_zone', |
| 37 | help='The availability zone for all agents in the deployment. ' |
| 38 | 'Configure this only when the single value is used by ' |
| 39 | 'all agents in the deployment.'), |
Yariv Rachmani | fed6f86 | 2017-12-19 11:55:25 +0200 | [diff] [blame] | 40 | cfg.IntOpt('max_networks_per_project', |
| 41 | default=4, |
| 42 | help='Max number of networks per project. ' |
| 43 | 'Configure this only when project is limited with real ' |
| 44 | 'vlans in deployment.'), |
Dongcan Ye | 91017ca | 2018-02-11 10:46:03 +0000 | [diff] [blame] | 45 | cfg.StrOpt('l3_agent_mode', |
| 46 | help='The agent mode for L3 agents in the deployment. ' |
| 47 | 'Configure this only when the single value is used by ' |
| 48 | 'all agents in the deployment.'), |
Yariv Rachmani | 9497088 | 2018-03-04 11:35:17 +0200 | [diff] [blame] | 49 | cfg.StrOpt('test_mtu_networks', |
| 50 | default='[{"provider:network_type":"vxlan",' |
| 51 | '"mtu":1200, "cidr":"10.100.0.0/16"}' |
| 52 | ',' |
| 53 | '{"provider:network_type":"vxlan",' |
| 54 | '"mtu":1300, "cidr":"10.200.0.0/16"}]', |
| 55 | help='Configuration for test networks. The format is JSON. ' |
| 56 | '"provider:network_type":<TYPE> - string ' |
| 57 | '"mtu":<MTU> - integer ' |
| 58 | '"cidr"<SUBNET/MASK> - string ' |
Federico Ressi | e9c89bf | 2018-04-19 13:02:33 +0200 | [diff] [blame] | 59 | '"provider:segmentation_id":<VLAN_ID> - integer'), |
pkomarov | 5ce1bc2 | 2019-03-23 22:53:26 +0200 | [diff] [blame] | 60 | cfg.IntOpt('max_mtu', |
| 61 | default=1500, |
| 62 | help='Max mtu value of default deployments".'), |
Roman Safronov | 367e118 | 2020-05-13 16:38:15 +0300 | [diff] [blame] | 63 | cfg.StrOpt('global_ip_address', |
| 64 | default='', |
| 65 | help='An IP address in the Internet that can be used in ' |
| 66 | 'a connectivity test'), |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 67 | cfg.StrOpt('q_agent', |
| 68 | default=None, |
| 69 | choices=['None', 'linuxbridge', 'ovs', 'sriov'], |
| 70 | help='Agent used for devstack@q-agt.service'), |
Hang Yang | e6e0ccf | 2021-02-26 15:07:05 -0600 | [diff] [blame] | 71 | cfg.StrOpt('firewall_driver', |
| 72 | default=None, |
| 73 | choices=['None', 'openvswitch', 'ovn', |
| 74 | 'iptables_hybrid', 'iptables'], |
| 75 | help='Driver for security groups firewall in the L2 agent'), |
Eduardo Olivares | 58c5d47 | 2023-01-12 10:04:02 +0100 | [diff] [blame] | 76 | cfg.StrOpt('dns_domain', |
| 77 | default='openstackgate.local', |
| 78 | help='dns_domain value configured at neutron.conf, which will ' |
| 79 | 'be used for the DNS configuration of the instances'), |
Federico Ressi | e9c89bf | 2018-04-19 13:02:33 +0200 | [diff] [blame] | 80 | |
Federico Ressi | a2aad94 | 2018-04-09 12:01:48 +0200 | [diff] [blame] | 81 | # Multicast tests settings |
| 82 | cfg.StrOpt('multicast_group_range', |
Lucas Alvares Gomes | 1d30f61 | 2020-02-05 11:23:36 +0000 | [diff] [blame] | 83 | default='225.0.0.120-225.0.0.250', |
Federico Ressi | a2aad94 | 2018-04-09 12:01:48 +0200 | [diff] [blame] | 84 | help='Unallocated multi-cast IPv4 range, which will be used to ' |
| 85 | 'test the multi-cast support.'), |
| 86 | |
Federico Ressi | e9c89bf | 2018-04-19 13:02:33 +0200 | [diff] [blame] | 87 | # Option for feature to connect via SSH to VMs using an intermediate SSH |
| 88 | # server |
| 89 | cfg.StrOpt('ssh_proxy_jump_host', |
| 90 | default=None, |
| 91 | help='Proxy jump host used to connect via SSH to VMs..'), |
| 92 | cfg.StrOpt('ssh_proxy_jump_username', |
| 93 | default='root', |
| 94 | help='User name used to connect to "ssh_proxy_jump_host".'), |
| 95 | cfg.StrOpt('ssh_proxy_jump_password', |
| 96 | default=None, |
| 97 | help='Password used to connect to "ssh_proxy_jump_host".'), |
| 98 | cfg.StrOpt('ssh_proxy_jump_keyfile', |
| 99 | default=None, |
| 100 | help='Keyfile used to connect to "ssh_proxy_jump_host".'), |
| 101 | cfg.IntOpt('ssh_proxy_jump_port', |
| 102 | default=22, |
| 103 | help='Port used to connect to "ssh_proxy_jump_host".'), |
Yarboa | 11b6892 | 2021-01-07 13:03:35 +0200 | [diff] [blame] | 104 | cfg.IntOpt('reboots_in_test', |
| 105 | default=1, |
| 106 | help='Number of reboots to apply if tests requires reboots'), |
Slawek Kaplonski | da17f00 | 2018-10-11 18:35:23 +0200 | [diff] [blame] | 107 | |
| 108 | # Options for special, "advanced" image like e.g. Ubuntu. Such image can be |
| 109 | # used in tests which require some more advanced tool than available in |
| 110 | # Cirros |
Yariv Rachmani | fa1081a | 2018-11-21 12:46:57 +0200 | [diff] [blame] | 111 | cfg.BoolOpt('default_image_is_advanced', |
| 112 | default=False, |
| 113 | help='Default image is an image which supports features ' |
| 114 | 'that Cirros does not, like Ubuntu or CentOS supporting ' |
| 115 | 'advanced features. ' |
| 116 | 'If this is set to True, "advanced_image_ref" option ' |
| 117 | 'is not required to be set.'), |
Slawek Kaplonski | da17f00 | 2018-10-11 18:35:23 +0200 | [diff] [blame] | 118 | cfg.StrOpt('advanced_image_ref', |
| 119 | default=None, |
| 120 | help='Valid advanced image uuid to be used in tests. ' |
| 121 | 'It is an image that supports features that Cirros ' |
| 122 | 'does not, like Ubuntu or CentOS supporting advanced ' |
| 123 | 'features.'), |
| 124 | cfg.StrOpt('advanced_image_flavor_ref', |
| 125 | default=None, |
| 126 | help='Valid flavor to use with advanced image in tests. ' |
| 127 | 'This is required if advanced image has to be used in ' |
| 128 | 'tests.'), |
| 129 | cfg.StrOpt('advanced_image_ssh_user', |
| 130 | default=None, |
| 131 | help='Name of ssh user to use with advanced image in tests. ' |
| 132 | 'This is required if advanced image has to be used in ' |
| 133 | 'tests.'), |
nfridman | 07f0e78 | 2019-11-04 09:12:58 -0500 | [diff] [blame] | 134 | |
| 135 | # Option for creating QoS policies configures as "shared". |
| 136 | # The default is false in order to prevent undesired usage |
| 137 | # while testing in parallel. |
| 138 | cfg.BoolOpt('create_shared_resources', |
| 139 | default=False, |
| 140 | help='Allow creation of shared resources.' |
| 141 | 'The default value is false.'), |
Lucas Alvares Gomes | b5114e0 | 2020-02-04 13:36:46 +0000 | [diff] [blame] | 142 | cfg.BoolOpt('is_igmp_snooping_enabled', |
| 143 | default=False, |
| 144 | help='Indicates whether IGMP snooping is enabled or not. ' |
| 145 | 'If True, multicast test(s) will assert that multicast ' |
| 146 | 'traffic is not being flooded to all ports. Defaults ' |
| 147 | 'to False.'), |
Dr. Jens Harbott | cca5dc8 | 2021-10-25 14:48:57 +0200 | [diff] [blame] | 148 | # Option for scheduling BGP speakers to agents explicitly |
| 149 | # The default is false with automatic scheduling on creation |
| 150 | # happening with the default scheduler |
| 151 | cfg.BoolOpt('bgp_schedule_speakers_to_agents', |
| 152 | default=False, |
| 153 | help='Schedule BGP speakers to agents explicitly.'), |
Hynek Mlnarik | c510676 | 2016-09-01 11:47:31 +0200 | [diff] [blame] | 154 | ] |
Maru Newby | b096d9f | 2015-03-09 18:54:54 +0000 | [diff] [blame] | 155 | |
Assaf Muller | d22ca2e | 2016-01-19 11:47:14 -0500 | [diff] [blame] | 156 | # TODO(amuller): Redo configuration options registration as part of the planned |
| 157 | # transition to the Tempest plugin architecture |
| 158 | for opt in NeutronPluginOptions: |
| 159 | CONF.register_opt(opt, 'neutron_plugin_options') |
Assaf Muller | 65cc2d2 | 2016-04-07 17:56:03 -0400 | [diff] [blame] | 160 | |
Slawek Kaplonski | a7bb161 | 2019-07-17 15:34:46 +0200 | [diff] [blame] | 161 | # TODO(slaweq): This config option is added to avoid running bgpvpn tests twice |
| 162 | # on stable branches till stable/stein. We need to remove this config option |
| 163 | # once stable/stein is EOL. Bgpvpn tempest plugin has been merged into |
| 164 | # neutron-tempest-plugin from Train. Train onwards bgpvpn tests will run from |
| 165 | # neutron-tempest-plugins. |
Slawek Kaplonski | 8dd49aa | 2019-04-16 14:47:07 +0200 | [diff] [blame] | 166 | BgpvpnGroup = [ |
Slawek Kaplonski | a7bb161 | 2019-07-17 15:34:46 +0200 | [diff] [blame] | 167 | cfg.BoolOpt('run_bgpvpn_tests', |
| 168 | default=True, |
| 169 | help=("If it is set to False bgpvpn api and scenario tests " |
| 170 | "will be skipped")), |
Slawek Kaplonski | 8dd49aa | 2019-04-16 14:47:07 +0200 | [diff] [blame] | 171 | cfg.IntOpt('min_asn', |
| 172 | default=100, |
| 173 | help=("Minimum number for the range of " |
| 174 | "autonomous system number for distinguishers.")), |
| 175 | cfg.IntOpt('min_nn', |
| 176 | default=100, |
| 177 | help=("Minimum number for the range of " |
| 178 | "assigned number for distinguishers.")), |
| 179 | cfg.IntOpt('max_asn', |
| 180 | default=200, |
| 181 | help=("Maximum number for the range of " |
| 182 | "autonomous system number for distinguishers.")), |
| 183 | cfg.IntOpt('max_nn', |
| 184 | default=200, |
| 185 | help=("Maximum number for the range of " |
| 186 | "assigned number for distinguishers.")), |
Michael Polenchuk | 28d5c8e | 2021-02-25 18:42:03 +0400 | [diff] [blame] | 187 | cfg.StrOpt('l3vpn_endpoint', |
| 188 | default=None, |
| 189 | help=("IP Address/Mask, which will be used to " |
| 190 | "test the l3vpn connectivity.")), |
| 191 | cfg.StrOpt('l3vpn_subnet_cidr', |
| 192 | default="192.168.0.254/24", |
| 193 | help=("IP Address/Mask, which will be used as private network" |
| 194 | "test the l3vpn connectivity.")), |
| 195 | cfg.StrOpt('l2vpn_endpoint', |
| 196 | default=None, |
| 197 | help=("IP Address/Mask, which will be used to " |
| 198 | "test the l2vpn connectivity.")), |
| 199 | cfg.StrOpt('route_target', |
| 200 | default=None, |
| 201 | help=("Route-target (RT) extended community attributes " |
| 202 | "identify the VPN membership of routes.")), |
Slawek Kaplonski | 8dd49aa | 2019-04-16 14:47:07 +0200 | [diff] [blame] | 203 | ] |
| 204 | |
| 205 | bgpvpn_group = cfg.OptGroup(name="bgpvpn", title=("Networking-Bgpvpn Service " |
| 206 | "Options")) |
| 207 | CONF.register_group(bgpvpn_group) |
| 208 | CONF.register_opts(BgpvpnGroup, group="bgpvpn") |
Assaf Muller | 65cc2d2 | 2016-04-07 17:56:03 -0400 | [diff] [blame] | 209 | |
Vasyl Saienko | 9ae406b | 2023-04-07 15:28:19 +0000 | [diff] [blame] | 210 | |
| 211 | DynamicRoutingGroup = [ |
| 212 | cfg.StrOpt('frr_docker_image', |
| 213 | default='quay.io/frrouting/frr:8.5.0', |
| 214 | help=("Docker image with frr.")), |
| 215 | cfg.ListOpt('frr_provider_ipv4_ips', |
| 216 | default=["10.11.12.71/24", "10.11.12.72/24", "10.11.12.73/24", |
| 217 | "10.11.12.74/24", "10.11.12.75/24", "10.11.12.76/24"], |
| 218 | help=('List of ip addresses to bind frr containers. Require ' |
| 219 | 'at least 3 items per class to run tests simulteniously. ' |
| 220 | 'The addresses should be assigned on interface with ' |
| 221 | 'tempest node.')), |
| 222 | cfg.ListOpt('frr_provider_ipv6_ips', |
| 223 | default=["2001:db8:a000::7001/64", "2001:db8:a000::7002/64", |
| 224 | "2001:db8:a000::7003/64", "2001:db8:a000::7004/64", |
| 225 | "2001:db8:a000::7005/64", "2001:db8:a000::7006/64"], |
| 226 | help=('List of ip addresses to bind frr containers. Require ' |
| 227 | 'at least 3 items per class to run tests simulteniously. ' |
| 228 | 'The addresses should be assigned on interface with ' |
| 229 | 'tempest node.')), |
| 230 | cfg.BoolOpt('frr_bgp_ipv6_enabled', |
| 231 | default=False, |
| 232 | help=("Run dynamic routing ipv6 tests.")), |
| 233 | cfg.IntOpt('frr_bgp_timeout', |
| 234 | default=600, |
| 235 | help=('Timeout for bgp operation like setup neighborship ' |
| 236 | 'or route update.')), |
| 237 | cfg.StrOpt('frr_bgp_ipv4_control_cidr', |
| 238 | default='10.0.0.0/8', |
| 239 | help=("CIDR for bgp control network on gateway nodes. Is " |
| 240 | "used as allowed range for dynamic neighbors.")), |
| 241 | cfg.StrOpt('frr_bgp_ipv6_control_cidr', |
| 242 | default='2001:db8::/32', |
| 243 | help=("CIDR for bgp control network on gateway nodes. Is " |
| 244 | "used as allowed range for dynamic neighbors.")), |
| 245 | ] |
| 246 | dynamic_routing_group = cfg.OptGroup(name="dynamic_routing", |
| 247 | title=("Networking-DNR Service Options")) |
| 248 | CONF.register_group(dynamic_routing_group) |
| 249 | CONF.register_opts(DynamicRoutingGroup, group="dynamic_routing") |
| 250 | |
Slawek Kaplonski | a7bb161 | 2019-07-17 15:34:46 +0200 | [diff] [blame] | 251 | # TODO(slaweq): This config option is added to avoid running fwaas tests twice |
| 252 | # on stable branches till stable/stein. We need to remove this config option |
| 253 | # once stable/stein is EOL. Fwaas tempest plugin has been merged into |
| 254 | # neutron-tempest-plugin from Train. Train onwards fwaas tests will run from |
| 255 | # neutron-tempest-plugins. |
| 256 | FwaasGroup = [ |
| 257 | cfg.BoolOpt('run_fwaas_tests', |
| 258 | default=True, |
| 259 | help=("If it is set to False fwaas api and scenario tests " |
| 260 | "will be skipped")), |
| 261 | ] |
| 262 | |
| 263 | fwaas_group = cfg.OptGroup( |
| 264 | name="fwaas", title=("Neutron-fwaas Service Options")) |
| 265 | CONF.register_group(fwaas_group) |
| 266 | CONF.register_opts(FwaasGroup, group="fwaas") |
| 267 | |
| 268 | # TODO(slaweq): This config option is added to avoid running SFC tests twice |
| 269 | # on stable branches till stable/stein. We need to remove this config option |
| 270 | # once stable/stein is EOL. SFC tempest plugin has been merged into |
| 271 | # neutron-tempest-plugin from Train. Train onwards SFC tests will run from |
| 272 | # neutron-tempest-plugins. |
| 273 | SfcGroup = [ |
| 274 | cfg.BoolOpt('run_sfc_tests', |
| 275 | default=True, |
| 276 | help=("If it is set to False SFC api and scenario tests " |
| 277 | "will be skipped")), |
| 278 | ] |
| 279 | |
| 280 | sfc_group = cfg.OptGroup(name="sfc", title=("Networking-sfc Service Options")) |
| 281 | CONF.register_group(sfc_group) |
| 282 | CONF.register_opts(SfcGroup, group="sfc") |
| 283 | |
elajkat | 1f275e4 | 2021-10-15 12:47:55 +0200 | [diff] [blame] | 284 | |
| 285 | TaasGroup = [ |
| 286 | cfg.StrOpt('provider_physical_network', |
| 287 | default='', |
| 288 | help='Physical network to be used for creating SRIOV network.'), |
| 289 | cfg.StrOpt('provider_segmentation_id', |
| 290 | default='', |
| 291 | help='Segmentation-id to be used for creating SRIOV network.'), |
| 292 | cfg.StrOpt('vlan_filter', |
| 293 | default='', |
| 294 | help='Comma separated list of VLANs to be mirrored ' |
| 295 | 'for a Tap-Flow.'), |
| 296 | ] |
| 297 | taas_group = cfg.OptGroup(name='taas', |
| 298 | title='TaaS Tempest Options') |
| 299 | CONF.register_group(taas_group) |
| 300 | CONF.register_opts(TaasGroup, group="taas") |
| 301 | |
Arkady Shtempler | 8fdbc7b | 2023-11-01 13:05:07 +0200 | [diff] [blame^] | 302 | # DNS Integration with an External Service |
| 303 | DnsFeatureGroup = [ |
| 304 | cfg.IntOpt( |
| 305 | 'segmentation_id', default=12345, |
| 306 | help="For network types VLAN, GRE, VXLAN or GENEVE, the segmentation" |
| 307 | " ID must be outside the ranges assigned to project networks."), |
| 308 | ] |
| 309 | dns_feature_group = cfg.OptGroup( |
| 310 | name='designate_feature_enabled', title='Enabled Designate Features') |
| 311 | CONF.register_group(dns_feature_group) |
| 312 | CONF.register_opts(DnsFeatureGroup, group="designate_feature_enabled") |
elajkat | 1f275e4 | 2021-10-15 12:47:55 +0200 | [diff] [blame] | 313 | |
Assaf Muller | 65cc2d2 | 2016-04-07 17:56:03 -0400 | [diff] [blame] | 314 | config_opts_translator = { |
| 315 | 'project_network_cidr': 'tenant_network_cidr', |
| 316 | 'project_network_v6_cidr': 'tenant_network_v6_cidr', |
| 317 | 'project_network_mask_bits': 'tenant_network_mask_bits', |
| 318 | 'project_network_v6_mask_bits': 'tenant_network_v6_mask_bits'} |
| 319 | |
| 320 | |
| 321 | def safe_get_config_value(group, name): |
| 322 | """Safely get Oslo config opts from Tempest, using old and new names.""" |
| 323 | conf_group = getattr(CONF, group) |
| 324 | |
| 325 | try: |
| 326 | return getattr(conf_group, name) |
| 327 | except cfg.NoSuchOptError: |
| 328 | return getattr(conf_group, config_opts_translator[name]) |