blob: 28d6b7675331ad40766d6a50d36ffd3aeca6a4c4 [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".'),
Huifeng Le1c9f40b2018-11-07 01:14:21 +080063 cfg.StrOpt('q_agent',
64 default=None,
65 choices=['None', 'linuxbridge', 'ovs', 'sriov'],
66 help='Agent used for devstack@q-agt.service'),
Federico Ressie9c89bf2018-04-19 13:02:33 +020067
Federico Ressia2aad942018-04-09 12:01:48 +020068 # Multicast tests settings
69 cfg.StrOpt('multicast_group_range',
Lucas Alvares Gomes1d30f612020-02-05 11:23:36 +000070 default='225.0.0.120-225.0.0.250',
Federico Ressia2aad942018-04-09 12:01:48 +020071 help='Unallocated multi-cast IPv4 range, which will be used to '
72 'test the multi-cast support.'),
73
Federico Ressie9c89bf2018-04-19 13:02:33 +020074 # Option for feature to connect via SSH to VMs using an intermediate SSH
75 # server
76 cfg.StrOpt('ssh_proxy_jump_host',
77 default=None,
78 help='Proxy jump host used to connect via SSH to VMs..'),
79 cfg.StrOpt('ssh_proxy_jump_username',
80 default='root',
81 help='User name used to connect to "ssh_proxy_jump_host".'),
82 cfg.StrOpt('ssh_proxy_jump_password',
83 default=None,
84 help='Password used to connect to "ssh_proxy_jump_host".'),
85 cfg.StrOpt('ssh_proxy_jump_keyfile',
86 default=None,
87 help='Keyfile used to connect to "ssh_proxy_jump_host".'),
88 cfg.IntOpt('ssh_proxy_jump_port',
89 default=22,
90 help='Port used to connect to "ssh_proxy_jump_host".'),
Slawek Kaplonskida17f002018-10-11 18:35:23 +020091
92 # Options for special, "advanced" image like e.g. Ubuntu. Such image can be
93 # used in tests which require some more advanced tool than available in
94 # Cirros
Yariv Rachmanifa1081a2018-11-21 12:46:57 +020095 cfg.BoolOpt('default_image_is_advanced',
96 default=False,
97 help='Default image is an image which supports features '
98 'that Cirros does not, like Ubuntu or CentOS supporting '
99 'advanced features. '
100 'If this is set to True, "advanced_image_ref" option '
101 'is not required to be set.'),
Slawek Kaplonskida17f002018-10-11 18:35:23 +0200102 cfg.StrOpt('advanced_image_ref',
103 default=None,
104 help='Valid advanced image uuid to be used in tests. '
105 'It is an image that supports features that Cirros '
106 'does not, like Ubuntu or CentOS supporting advanced '
107 'features.'),
108 cfg.StrOpt('advanced_image_flavor_ref',
109 default=None,
110 help='Valid flavor to use with advanced image in tests. '
111 'This is required if advanced image has to be used in '
112 'tests.'),
113 cfg.StrOpt('advanced_image_ssh_user',
114 default=None,
115 help='Name of ssh user to use with advanced image in tests. '
116 'This is required if advanced image has to be used in '
117 'tests.'),
nfridman07f0e782019-11-04 09:12:58 -0500118
119 # Option for creating QoS policies configures as "shared".
120 # The default is false in order to prevent undesired usage
121 # while testing in parallel.
122 cfg.BoolOpt('create_shared_resources',
123 default=False,
124 help='Allow creation of shared resources.'
125 'The default value is false.'),
Lucas Alvares Gomesb5114e02020-02-04 13:36:46 +0000126 cfg.BoolOpt('is_igmp_snooping_enabled',
127 default=False,
128 help='Indicates whether IGMP snooping is enabled or not. '
129 'If True, multicast test(s) will assert that multicast '
130 'traffic is not being flooded to all ports. Defaults '
131 'to False.'),
Hynek Mlnarikc5106762016-09-01 11:47:31 +0200132]
Maru Newbyb096d9f2015-03-09 18:54:54 +0000133
Assaf Mullerd22ca2e2016-01-19 11:47:14 -0500134# TODO(amuller): Redo configuration options registration as part of the planned
135# transition to the Tempest plugin architecture
136for opt in NeutronPluginOptions:
137 CONF.register_opt(opt, 'neutron_plugin_options')
Assaf Muller65cc2d22016-04-07 17:56:03 -0400138
Slawek Kaplonskia7bb1612019-07-17 15:34:46 +0200139# TODO(slaweq): This config option is added to avoid running bgpvpn tests twice
140# on stable branches till stable/stein. We need to remove this config option
141# once stable/stein is EOL. Bgpvpn tempest plugin has been merged into
142# neutron-tempest-plugin from Train. Train onwards bgpvpn tests will run from
143# neutron-tempest-plugins.
Slawek Kaplonski8dd49aa2019-04-16 14:47:07 +0200144BgpvpnGroup = [
Slawek Kaplonskia7bb1612019-07-17 15:34:46 +0200145 cfg.BoolOpt('run_bgpvpn_tests',
146 default=True,
147 help=("If it is set to False bgpvpn api and scenario tests "
148 "will be skipped")),
Slawek Kaplonski8dd49aa2019-04-16 14:47:07 +0200149 cfg.IntOpt('min_asn',
150 default=100,
151 help=("Minimum number for the range of "
152 "autonomous system number for distinguishers.")),
153 cfg.IntOpt('min_nn',
154 default=100,
155 help=("Minimum number for the range of "
156 "assigned number for distinguishers.")),
157 cfg.IntOpt('max_asn',
158 default=200,
159 help=("Maximum number for the range of "
160 "autonomous system number for distinguishers.")),
161 cfg.IntOpt('max_nn',
162 default=200,
163 help=("Maximum number for the range of "
164 "assigned number for distinguishers.")),
165]
166
167bgpvpn_group = cfg.OptGroup(name="bgpvpn", title=("Networking-Bgpvpn Service "
168 "Options"))
169CONF.register_group(bgpvpn_group)
170CONF.register_opts(BgpvpnGroup, group="bgpvpn")
Assaf Muller65cc2d22016-04-07 17:56:03 -0400171
Slawek Kaplonskia7bb1612019-07-17 15:34:46 +0200172# TODO(slaweq): This config option is added to avoid running fwaas tests twice
173# on stable branches till stable/stein. We need to remove this config option
174# once stable/stein is EOL. Fwaas tempest plugin has been merged into
175# neutron-tempest-plugin from Train. Train onwards fwaas tests will run from
176# neutron-tempest-plugins.
177FwaasGroup = [
178 cfg.BoolOpt('run_fwaas_tests',
179 default=True,
180 help=("If it is set to False fwaas api and scenario tests "
181 "will be skipped")),
182]
183
184fwaas_group = cfg.OptGroup(
185 name="fwaas", title=("Neutron-fwaas Service Options"))
186CONF.register_group(fwaas_group)
187CONF.register_opts(FwaasGroup, group="fwaas")
188
189# TODO(slaweq): This config option is added to avoid running SFC tests twice
190# on stable branches till stable/stein. We need to remove this config option
191# once stable/stein is EOL. SFC tempest plugin has been merged into
192# neutron-tempest-plugin from Train. Train onwards SFC tests will run from
193# neutron-tempest-plugins.
194SfcGroup = [
195 cfg.BoolOpt('run_sfc_tests',
196 default=True,
197 help=("If it is set to False SFC api and scenario tests "
198 "will be skipped")),
199]
200
201sfc_group = cfg.OptGroup(name="sfc", title=("Networking-sfc Service Options"))
202CONF.register_group(sfc_group)
203CONF.register_opts(SfcGroup, group="sfc")
204
Assaf Muller65cc2d22016-04-07 17:56:03 -0400205config_opts_translator = {
206 'project_network_cidr': 'tenant_network_cidr',
207 'project_network_v6_cidr': 'tenant_network_v6_cidr',
208 'project_network_mask_bits': 'tenant_network_mask_bits',
209 'project_network_v6_mask_bits': 'tenant_network_v6_mask_bits'}
210
211
212def safe_get_config_value(group, name):
213 """Safely get Oslo config opts from Tempest, using old and new names."""
214 conf_group = getattr(CONF, group)
215
216 try:
217 return getattr(conf_group, name)
218 except cfg.NoSuchOptError:
219 return getattr(conf_group, config_opts_translator[name])