blob: 8f3d6c042b03b92b6071b208b59c5e71f50ec4e3 [file] [log] [blame]
Maru Newbyb096d9f2015-03-09 18:54:54 +00001# 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 Hrachyshkac695f9f2015-02-26 23:26:41 +010013from oslo_config import cfg
Assaf Mullerd22ca2e2016-01-19 11:47:14 -050014from tempest import config
15
Assaf Muller65cc2d22016-04-07 17:56:03 -040016
Assaf Mullerd22ca2e2016-01-19 11:47:14 -050017CONF = config.CONF
Maru Newbyb096d9f2015-03-09 18:54:54 +000018
19
Assaf Mullerd22ca2e2016-01-19 11:47:14 -050020NeutronPluginOptions = [
Armando Migliaccio7f84c422017-02-21 18:43:38 -080021 cfg.ListOpt('provider_vlans',
22 default=[],
23 help='List of provider networks available in the deployment.'),
Lajos Katona2f904652018-08-23 14:04:56 +020024 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 Fujioka1257b572015-06-10 17:18:12 +090028 cfg.BoolOpt('specify_floating_ip_address_available',
29 default=True,
30 help='Allow passing an IP Address of the floating ip when '
Hynek Mlnarikc5106762016-09-01 11:47:31 +020031 '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 Kumarc125fd12017-11-15 19:41:01 +053036 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 Rachmanifed6f862017-12-19 11:55:25 +020040 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 Ye91017ca2018-02-11 10:46:03 +000045 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 Rachmani94970882018-03-04 11:35:17 +020049 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 Ressie9c89bf2018-04-19 13:02:33 +020059 '"provider:segmentation_id":<VLAN_ID> - integer'),
pkomarov5ce1bc22019-03-23 22:53:26 +020060 cfg.IntOpt('max_mtu',
61 default=1500,
62 help='Max mtu value of default deployments".'),
Roman Safronov367e1182020-05-13 16:38:15 +030063 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 Le1c9f40b2018-11-07 01:14:21 +080067 cfg.StrOpt('q_agent',
68 default=None,
69 choices=['None', 'linuxbridge', 'ovs', 'sriov'],
70 help='Agent used for devstack@q-agt.service'),
Hang Yange6e0ccf2021-02-26 15:07:05 -060071 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'),
Federico Ressie9c89bf2018-04-19 13:02:33 +020076
Federico Ressia2aad942018-04-09 12:01:48 +020077 # Multicast tests settings
78 cfg.StrOpt('multicast_group_range',
Lucas Alvares Gomes1d30f612020-02-05 11:23:36 +000079 default='225.0.0.120-225.0.0.250',
Federico Ressia2aad942018-04-09 12:01:48 +020080 help='Unallocated multi-cast IPv4 range, which will be used to '
81 'test the multi-cast support.'),
82
Federico Ressie9c89bf2018-04-19 13:02:33 +020083 # Option for feature to connect via SSH to VMs using an intermediate SSH
84 # server
85 cfg.StrOpt('ssh_proxy_jump_host',
86 default=None,
87 help='Proxy jump host used to connect via SSH to VMs..'),
88 cfg.StrOpt('ssh_proxy_jump_username',
89 default='root',
90 help='User name used to connect to "ssh_proxy_jump_host".'),
91 cfg.StrOpt('ssh_proxy_jump_password',
92 default=None,
93 help='Password used to connect to "ssh_proxy_jump_host".'),
94 cfg.StrOpt('ssh_proxy_jump_keyfile',
95 default=None,
96 help='Keyfile used to connect to "ssh_proxy_jump_host".'),
97 cfg.IntOpt('ssh_proxy_jump_port',
98 default=22,
99 help='Port used to connect to "ssh_proxy_jump_host".'),
Yarboa11b68922021-01-07 13:03:35 +0200100 cfg.IntOpt('reboots_in_test',
101 default=1,
102 help='Number of reboots to apply if tests requires reboots'),
Slawek Kaplonskida17f002018-10-11 18:35:23 +0200103
104 # Options for special, "advanced" image like e.g. Ubuntu. Such image can be
105 # used in tests which require some more advanced tool than available in
106 # Cirros
Yariv Rachmanifa1081a2018-11-21 12:46:57 +0200107 cfg.BoolOpt('default_image_is_advanced',
108 default=False,
109 help='Default image is an image which supports features '
110 'that Cirros does not, like Ubuntu or CentOS supporting '
111 'advanced features. '
112 'If this is set to True, "advanced_image_ref" option '
113 'is not required to be set.'),
Slawek Kaplonskida17f002018-10-11 18:35:23 +0200114 cfg.StrOpt('advanced_image_ref',
115 default=None,
116 help='Valid advanced image uuid to be used in tests. '
117 'It is an image that supports features that Cirros '
118 'does not, like Ubuntu or CentOS supporting advanced '
119 'features.'),
120 cfg.StrOpt('advanced_image_flavor_ref',
121 default=None,
122 help='Valid flavor to use with advanced image in tests. '
123 'This is required if advanced image has to be used in '
124 'tests.'),
125 cfg.StrOpt('advanced_image_ssh_user',
126 default=None,
127 help='Name of ssh user to use with advanced image in tests. '
128 'This is required if advanced image has to be used in '
129 'tests.'),
nfridman07f0e782019-11-04 09:12:58 -0500130
131 # Option for creating QoS policies configures as "shared".
132 # The default is false in order to prevent undesired usage
133 # while testing in parallel.
134 cfg.BoolOpt('create_shared_resources',
135 default=False,
136 help='Allow creation of shared resources.'
137 'The default value is false.'),
Lucas Alvares Gomesb5114e02020-02-04 13:36:46 +0000138 cfg.BoolOpt('is_igmp_snooping_enabled',
139 default=False,
140 help='Indicates whether IGMP snooping is enabled or not. '
141 'If True, multicast test(s) will assert that multicast '
142 'traffic is not being flooded to all ports. Defaults '
143 'to False.'),
Dr. Jens Harbottcca5dc82021-10-25 14:48:57 +0200144 # Option for scheduling BGP speakers to agents explicitly
145 # The default is false with automatic scheduling on creation
146 # happening with the default scheduler
147 cfg.BoolOpt('bgp_schedule_speakers_to_agents',
148 default=False,
149 help='Schedule BGP speakers to agents explicitly.'),
Maksym Shalamov40106642020-03-18 15:31:12 +0200150 cfg.StrOpt('dns_domain',
151 default='openstackgate.local',
152 help='Name of internal dns zone to use in tests. '),
Hynek Mlnarikc5106762016-09-01 11:47:31 +0200153]
Maru Newbyb096d9f2015-03-09 18:54:54 +0000154
Assaf Mullerd22ca2e2016-01-19 11:47:14 -0500155# TODO(amuller): Redo configuration options registration as part of the planned
156# transition to the Tempest plugin architecture
157for opt in NeutronPluginOptions:
158 CONF.register_opt(opt, 'neutron_plugin_options')
Assaf Muller65cc2d22016-04-07 17:56:03 -0400159
Slawek Kaplonskia7bb1612019-07-17 15:34:46 +0200160# TODO(slaweq): This config option is added to avoid running bgpvpn tests twice
161# on stable branches till stable/stein. We need to remove this config option
162# once stable/stein is EOL. Bgpvpn tempest plugin has been merged into
163# neutron-tempest-plugin from Train. Train onwards bgpvpn tests will run from
164# neutron-tempest-plugins.
Slawek Kaplonski8dd49aa2019-04-16 14:47:07 +0200165BgpvpnGroup = [
Slawek Kaplonskia7bb1612019-07-17 15:34:46 +0200166 cfg.BoolOpt('run_bgpvpn_tests',
167 default=True,
168 help=("If it is set to False bgpvpn api and scenario tests "
169 "will be skipped")),
Slawek Kaplonski8dd49aa2019-04-16 14:47:07 +0200170 cfg.IntOpt('min_asn',
171 default=100,
172 help=("Minimum number for the range of "
173 "autonomous system number for distinguishers.")),
174 cfg.IntOpt('min_nn',
175 default=100,
176 help=("Minimum number for the range of "
177 "assigned number for distinguishers.")),
178 cfg.IntOpt('max_asn',
179 default=200,
180 help=("Maximum number for the range of "
181 "autonomous system number for distinguishers.")),
182 cfg.IntOpt('max_nn',
183 default=200,
184 help=("Maximum number for the range of "
185 "assigned number for distinguishers.")),
Michael Polenchuka1d2f912021-02-25 18:42:03 +0400186 cfg.StrOpt('l3vpn_endpoint',
187 default=None,
188 help=("IP Address/Mask, which will be used to "
189 "test the l3vpn connectivity.")),
Vasyl Saienko8b677b52021-07-21 17:08:32 +0300190 cfg.StrOpt('l3vpn_subnet_cidr',
191 default="192.168.0.254/24",
192 help=("IP Address/Mask, which will be used as private network"
193 "test the l3vpn connectivity.")),
Michael Polenchuka1d2f912021-02-25 18:42:03 +0400194 cfg.StrOpt('l2vpn_endpoint',
195 default=None,
196 help=("IP Address/Mask, which will be used to "
197 "test the l2vpn connectivity.")),
198 cfg.StrOpt('route_target',
199 default=None,
200 help=("Route-target (RT) extended community attributes "
201 "identify the VPN membership of routes.")),
Slawek Kaplonski8dd49aa2019-04-16 14:47:07 +0200202]
203
204bgpvpn_group = cfg.OptGroup(name="bgpvpn", title=("Networking-Bgpvpn Service "
205 "Options"))
206CONF.register_group(bgpvpn_group)
207CONF.register_opts(BgpvpnGroup, group="bgpvpn")
Assaf Muller65cc2d22016-04-07 17:56:03 -0400208
Slawek Kaplonskia7bb1612019-07-17 15:34:46 +0200209# TODO(slaweq): This config option is added to avoid running fwaas tests twice
210# on stable branches till stable/stein. We need to remove this config option
211# once stable/stein is EOL. Fwaas tempest plugin has been merged into
212# neutron-tempest-plugin from Train. Train onwards fwaas tests will run from
213# neutron-tempest-plugins.
214FwaasGroup = [
215 cfg.BoolOpt('run_fwaas_tests',
216 default=True,
217 help=("If it is set to False fwaas api and scenario tests "
218 "will be skipped")),
219]
220
221fwaas_group = cfg.OptGroup(
222 name="fwaas", title=("Neutron-fwaas Service Options"))
223CONF.register_group(fwaas_group)
224CONF.register_opts(FwaasGroup, group="fwaas")
225
226# TODO(slaweq): This config option is added to avoid running SFC tests twice
227# on stable branches till stable/stein. We need to remove this config option
228# once stable/stein is EOL. SFC tempest plugin has been merged into
229# neutron-tempest-plugin from Train. Train onwards SFC tests will run from
230# neutron-tempest-plugins.
231SfcGroup = [
232 cfg.BoolOpt('run_sfc_tests',
233 default=True,
234 help=("If it is set to False SFC api and scenario tests "
235 "will be skipped")),
236]
237
238sfc_group = cfg.OptGroup(name="sfc", title=("Networking-sfc Service Options"))
239CONF.register_group(sfc_group)
240CONF.register_opts(SfcGroup, group="sfc")
241
Assaf Muller65cc2d22016-04-07 17:56:03 -0400242config_opts_translator = {
243 'project_network_cidr': 'tenant_network_cidr',
244 'project_network_v6_cidr': 'tenant_network_v6_cidr',
245 'project_network_mask_bits': 'tenant_network_mask_bits',
246 'project_network_v6_mask_bits': 'tenant_network_v6_mask_bits'}
247
248
249def safe_get_config_value(group, name):
250 """Safely get Oslo config opts from Tempest, using old and new names."""
251 conf_group = getattr(CONF, group)
252
253 try:
254 return getattr(conf_group, name)
255 except cfg.NoSuchOptError:
256 return getattr(conf_group, config_opts_translator[name])