blob: 51fbafce77b7bdeab2f5bec9b89073ed5265e509 [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',
70 default='224.0.0.120-224.0.0.250',
71 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.'),
Hynek Mlnarikc5106762016-09-01 11:47:31 +0200126]
Maru Newbyb096d9f2015-03-09 18:54:54 +0000127
Assaf Mullerd22ca2e2016-01-19 11:47:14 -0500128# TODO(amuller): Redo configuration options registration as part of the planned
129# transition to the Tempest plugin architecture
130for opt in NeutronPluginOptions:
131 CONF.register_opt(opt, 'neutron_plugin_options')
Assaf Muller65cc2d22016-04-07 17:56:03 -0400132
Slawek Kaplonskia7bb1612019-07-17 15:34:46 +0200133# TODO(slaweq): This config option is added to avoid running bgpvpn tests twice
134# on stable branches till stable/stein. We need to remove this config option
135# once stable/stein is EOL. Bgpvpn tempest plugin has been merged into
136# neutron-tempest-plugin from Train. Train onwards bgpvpn tests will run from
137# neutron-tempest-plugins.
Slawek Kaplonski8dd49aa2019-04-16 14:47:07 +0200138BgpvpnGroup = [
Slawek Kaplonskia7bb1612019-07-17 15:34:46 +0200139 cfg.BoolOpt('run_bgpvpn_tests',
140 default=True,
141 help=("If it is set to False bgpvpn api and scenario tests "
142 "will be skipped")),
Slawek Kaplonski8dd49aa2019-04-16 14:47:07 +0200143 cfg.IntOpt('min_asn',
144 default=100,
145 help=("Minimum number for the range of "
146 "autonomous system number for distinguishers.")),
147 cfg.IntOpt('min_nn',
148 default=100,
149 help=("Minimum number for the range of "
150 "assigned number for distinguishers.")),
151 cfg.IntOpt('max_asn',
152 default=200,
153 help=("Maximum number for the range of "
154 "autonomous system number for distinguishers.")),
155 cfg.IntOpt('max_nn',
156 default=200,
157 help=("Maximum number for the range of "
158 "assigned number for distinguishers.")),
159]
160
161bgpvpn_group = cfg.OptGroup(name="bgpvpn", title=("Networking-Bgpvpn Service "
162 "Options"))
163CONF.register_group(bgpvpn_group)
164CONF.register_opts(BgpvpnGroup, group="bgpvpn")
Assaf Muller65cc2d22016-04-07 17:56:03 -0400165
Slawek Kaplonskia7bb1612019-07-17 15:34:46 +0200166# TODO(slaweq): This config option is added to avoid running fwaas tests twice
167# on stable branches till stable/stein. We need to remove this config option
168# once stable/stein is EOL. Fwaas tempest plugin has been merged into
169# neutron-tempest-plugin from Train. Train onwards fwaas tests will run from
170# neutron-tempest-plugins.
171FwaasGroup = [
172 cfg.BoolOpt('run_fwaas_tests',
173 default=True,
174 help=("If it is set to False fwaas api and scenario tests "
175 "will be skipped")),
176]
177
178fwaas_group = cfg.OptGroup(
179 name="fwaas", title=("Neutron-fwaas Service Options"))
180CONF.register_group(fwaas_group)
181CONF.register_opts(FwaasGroup, group="fwaas")
182
183# TODO(slaweq): This config option is added to avoid running SFC tests twice
184# on stable branches till stable/stein. We need to remove this config option
185# once stable/stein is EOL. SFC tempest plugin has been merged into
186# neutron-tempest-plugin from Train. Train onwards SFC tests will run from
187# neutron-tempest-plugins.
188SfcGroup = [
189 cfg.BoolOpt('run_sfc_tests',
190 default=True,
191 help=("If it is set to False SFC api and scenario tests "
192 "will be skipped")),
193]
194
195sfc_group = cfg.OptGroup(name="sfc", title=("Networking-sfc Service Options"))
196CONF.register_group(sfc_group)
197CONF.register_opts(SfcGroup, group="sfc")
198
Assaf Muller65cc2d22016-04-07 17:56:03 -0400199config_opts_translator = {
200 'project_network_cidr': 'tenant_network_cidr',
201 'project_network_v6_cidr': 'tenant_network_v6_cidr',
202 'project_network_mask_bits': 'tenant_network_mask_bits',
203 'project_network_v6_mask_bits': 'tenant_network_v6_mask_bits'}
204
205
206def safe_get_config_value(group, name):
207 """Safely get Oslo config opts from Tempest, using old and new names."""
208 conf_group = getattr(CONF, group)
209
210 try:
211 return getattr(conf_group, name)
212 except cfg.NoSuchOptError:
213 return getattr(conf_group, config_opts_translator[name])