1 # Copyright 2015-2018 Intel Corporation, Tieto and others.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 # Generic test configuration options are described at conf/01_testcases.conf
20 # Options specific to integration testcases are described below:
22 # Required for OP2P tests
23 # "Tunnel Type": ["vxlan"|"gre"|"geneve"] # Tunnel Type defines tunneling protocol to use.
24 # # It can be overridden by cli option TUNNEL_TYPE.
26 # # "vxlan" - iteration of destination MAC address
27 # # "gre" - iteration of destination IP address
28 # # "geneve" - iteration of destination UDP port
29 # # Default value is "vxlan".
31 # bidirectional testing for OP2P is not yet supported.
32 # TRAFFIC['bidir'] must be set to 'False'.
35 # Common TestSteps parts ("macros")
41 STEP_VSWITCH_P2P_INIT = [
42 ['vswitch', 'add_switch', 'int_br0'], # STEP 0
43 ['vswitch', 'add_phy_port', 'int_br0'], # STEP 1
44 ['vswitch', 'add_phy_port', 'int_br0'], # STEP 2
47 STEP_VSWITCH_P2P_FINIT = [
48 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
49 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
50 ['vswitch', 'del_switch', 'int_br0'],
53 STEP_VSWITCH_P2P_CONNECTIONS_INIT = STEP_VSWITCH_P2P_INIT + [
54 ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]'],
55 ['vswitch', 'add_connection', 'int_br0', '#STEP[2][0]', '#STEP[1][0]'],
58 STEP_VSWITCH_P2P_CONNECTIONS_FINIT = [
59 ['vswitch', 'dump_connections', 'int_br0'],
60 ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]'],
61 ['vswitch', 'del_connection', 'int_br0', '#STEP[2][0]', '#STEP[1][0]'],
62 ] + STEP_VSWITCH_P2P_FINIT
64 # P2P OVS specific macros
65 STEP_VSWITCH_P2P_FLOWS_INIT = STEP_VSWITCH_P2P_INIT + [
66 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
67 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
70 STEP_VSWITCH_P2P_FLOWS_FINIT = [
71 ['vswitch', 'dump_flows', 'int_br0'],
72 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
73 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[2][1]'}],
74 ] + STEP_VSWITCH_P2P_FINIT
79 STEP_VSWITCH_PVP_INIT = STEP_VSWITCH_P2P_INIT + [
80 ['vswitch', 'add_vport', 'int_br0'], # STEP 3 vm1 ports
81 ['vswitch', 'add_vport', 'int_br0'], # STEP 4
84 STEP_VSWITCH_PVP_FINIT = [
85 ['vswitch', 'del_port', 'int_br0', '#STEP[3][0]'], # vm1 ports
86 ['vswitch', 'del_port', 'int_br0', '#STEP[4][0]'],
87 ] + STEP_VSWITCH_P2P_FINIT
89 STEP_VSWITCH_PVP_CONNECTIONS_INIT = STEP_VSWITCH_PVP_INIT + [
90 ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[3][0]'],
91 ['vswitch', 'add_connection', 'int_br0', '#STEP[4][0]', '#STEP[2][0]'],
92 ['vswitch', 'add_connection', 'int_br0', '#STEP[2][0]', '#STEP[4][0]'],
93 ['vswitch', 'add_connection', 'int_br0', '#STEP[3][0]', '#STEP[1][0]'],
96 STEP_VSWITCH_PVP_CONNECTIONS_FINIT = [
97 ['vswitch', 'dump_connections', 'int_br0'],
98 ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[3][0]'],
99 ['vswitch', 'del_connection', 'int_br0', '#STEP[4][0]', '#STEP[2][0]'],
100 ['vswitch', 'del_connection', 'int_br0', '#STEP[2][0]', '#STEP[4][0]'],
101 ['vswitch', 'del_connection', 'int_br0', '#STEP[3][0]', '#STEP[1][0]'],
102 ] + STEP_VSWITCH_PVP_FINIT
104 # PVP OVS specific macros
105 STEP_VSWITCH_PVP_FLOWS_INIT = STEP_VSWITCH_PVP_INIT + [
106 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
107 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
108 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
109 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
112 STEP_VSWITCH_PVP_FLOWS_FINIT = [
113 ['vswitch', 'dump_flows', 'int_br0'],
114 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
115 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[4][1]'}],
116 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[2][1]'}],
117 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
118 ] + STEP_VSWITCH_PVP_FINIT
123 STEP_VSWITCH_PVVP_INIT = STEP_VSWITCH_PVP_INIT + [
124 ['vswitch', 'add_vport', 'int_br0'], # STEP 5 vm2 ports
125 ['vswitch', 'add_vport', 'int_br0'], # STEP 6
128 STEP_VSWITCH_PVVP_FINIT = [
129 ['vswitch', 'del_port', 'int_br0', '#STEP[5][0]'], # vm2 ports
130 ['vswitch', 'del_port', 'int_br0', '#STEP[6][0]'],
131 ] + STEP_VSWITCH_PVP_FINIT
133 STEP_VSWITCH_PVVP_CONNECTIONS_INIT = STEP_VSWITCH_PVVP_INIT + [
134 ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[3][0]'],
135 ['vswitch', 'add_connection', 'int_br0', '#STEP[4][0]', '#STEP[5][0]'],
136 ['vswitch', 'add_connection', 'int_br0', '#STEP[6][0]', '#STEP[2][0]'],
137 ['vswitch', 'add_connection', 'int_br0', '#STEP[2][0]', '#STEP[6][0]'],
138 ['vswitch', 'add_connection', 'int_br0', '#STEP[5][0]', '#STEP[4][0]'],
139 ['vswitch', 'add_connection', 'int_br0', '#STEP[3][0]', '#STEP[1][0]'],
142 STEP_VSWITCH_PVVP_CONNECTIONS_FINIT = [
143 ['vswitch', 'dump_connections', 'int_br0'],
144 ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[3][0]'],
145 ['vswitch', 'del_connection', 'int_br0', '#STEP[4][0]', '#STEP[5][0]'],
146 ['vswitch', 'del_connection', 'int_br0', '#STEP[6][0]', '#STEP[2][0]'],
147 ['vswitch', 'del_connection', 'int_br0', '#STEP[2][0]', '#STEP[6][0]'],
148 ['vswitch', 'del_connection', 'int_br0', '#STEP[5][0]', '#STEP[4][0]'],
149 ['vswitch', 'del_connection', 'int_br0', '#STEP[3][0]', '#STEP[1][0]'],
150 ] + STEP_VSWITCH_PVVP_FINIT
152 # PVVP OVS specific macros
153 STEP_VSWITCH_PVVP_FLOWS_INIT = STEP_VSWITCH_PVVP_INIT + [
154 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
155 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
156 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
157 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
158 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[5][1]', 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
159 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
162 STEP_VSWITCH_PVVP_FLOWS_FINIT = [
163 ['vswitch', 'dump_flows', 'int_br0'],
164 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
165 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[4][1]'}],
166 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[6][1]'}],
167 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[2][1]'}],
168 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[5][1]'}],
169 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
170 ] + STEP_VSWITCH_PVVP_FINIT
172 STEP_VSWITCH_P4VP_INIT = STEP_VSWITCH_PVVP_INIT + [
173 ['vswitch', 'add_vport', 'int_br0'], # STEP 7 vm3 ports
174 ['vswitch', 'add_vport', 'int_br0'], # STEP 8
175 ['vswitch', 'add_vport', 'int_br0'], # STEP 9 vm4 ports
176 ['vswitch', 'add_vport', 'int_br0'], # STEP 10
179 STEP_VSWITCH_P4VP_FINIT = [
180 ['vswitch', 'del_port', 'int_br0', '#STEP[7][0]'], # vm3 ports
181 ['vswitch', 'del_port', 'int_br0', '#STEP[8][0]'],
182 ['vswitch', 'del_port', 'int_br0', '#STEP[9][0]'], # vm4 ports
183 ['vswitch', 'del_port', 'int_br0', '#STEP[10][0]'],
184 ] + STEP_VSWITCH_PVVP_FINIT
186 STEP_VSWITCH_P4VP_FLOWS_INIT = STEP_VSWITCH_P4VP_INIT + [
187 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
188 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
189 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
190 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
191 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
192 'actions': ['output:#STEP[7][1]'], 'idle_timeout': '0'}],
193 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[8][1]', \
194 'actions': ['output:#STEP[9][1]'], 'idle_timeout': '0'}],
195 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[10][1]', \
196 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
197 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', \
198 'actions': ['output:#STEP[10][1]'], 'idle_timeout': '0'}],
199 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[9][1]', \
200 'actions': ['output:#STEP[8][1]'], 'idle_timeout': '0'}],
201 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[7][1]', \
202 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
203 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[5][1]', \
204 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
205 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', \
206 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
209 STEP_VSWITCH_P4VP_FLOWS_FINIT = [
210 ['vswitch', 'dump_flows', 'int_br0'],
211 ['vswitch', 'del_flow', 'int_br0'],
212 ] + STEP_VSWITCH_P4VP_FINIT
214 STEP_VSWITCH_2PHY_2VM_INIT = STEP_VSWITCH_PVVP_INIT
216 STEP_VSWITCH_2PHY_2VM_FINIT = STEP_VSWITCH_PVVP_FINIT
218 STEP_VSWITCH_2_PARALLEL_VM_FLOWS_INIT = [
219 # Setup Flows to reply ICMPv6 and similar packets, so to
220 # avoid flooding the internal port with their re-transmissions
221 ['vswitch', 'add_flow', 'int_br0', \
222 {'priority': '1', 'dl_src': '00:00:00:00:00:01', \
223 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
224 ['vswitch', 'add_flow', 'int_br0', \
225 {'priority': '1', 'dl_src': '00:00:00:00:00:02', \
226 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
227 ['vswitch', 'add_flow', 'int_br0', \
228 {'priority': '1', 'dl_src': '00:00:00:00:00:03', \
229 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
230 ['vswitch', 'add_flow', 'int_br0', \
231 {'priority': '1', 'dl_src': '00:00:00:00:00:04', \
232 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
233 # Forward UDP packets depending on dest port
234 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
235 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '0', \
236 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
237 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
238 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '1', \
239 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
240 # Send VM outputs to phy port #2
241 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
242 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
243 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
244 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
247 STEP_VSWITCH_2PHY_4VM_INIT = STEP_VSWITCH_2PHY_2VM_INIT + [
248 ['vswitch', 'add_vport', 'int_br0'], # STEP 7 vm3 ports
249 ['vswitch', 'add_vport', 'int_br0'], # STEP 8
250 ['vswitch', 'add_vport', 'int_br0'], # STEP 9 vm4 ports
251 ['vswitch', 'add_vport', 'int_br0'], # STEP 10
254 STEP_VSWITCH_2PHY_4VM_FINIT = [
255 ['vswitch', 'del_port', 'int_br0', '#STEP[7][0]'], # vm3 ports
256 ['vswitch', 'del_port', 'int_br0', '#STEP[8][0]'],
257 ['vswitch', 'del_port', 'int_br0', '#STEP[9][0]'], # vm4 ports
258 ['vswitch', 'del_port', 'int_br0', '#STEP[10][0]'],
259 ] + STEP_VSWITCH_2PHY_2VM_FINIT
261 STEP_VSWITCH_FLOWS_FINIT = [
262 ['vswitch', 'dump_flows', 'int_br0'],
263 ['vswitch', 'del_flow', 'int_br0'],
266 STEP_VSWITCH_4_PARALLEL_VM_FLOWS_INIT = [
267 # Setup Flows to reply ICMPv6 and similar packets, so to
268 # avoid flooding the internal port with their re-transmissions
269 ['vswitch', 'add_flow', 'int_br0', \
270 {'priority': '1', 'dl_src': '00:00:00:00:00:01', \
271 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
272 ['vswitch', 'add_flow', 'int_br0', \
273 {'priority': '1', 'dl_src': '00:00:00:00:00:02', \
274 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
275 ['vswitch', 'add_flow', 'int_br0', \
276 {'priority': '1', 'dl_src': '00:00:00:00:00:03', \
277 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
278 ['vswitch', 'add_flow', 'int_br0', \
279 {'priority': '1', 'dl_src': '00:00:00:00:00:04', \
280 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
281 ['vswitch', 'add_flow', 'int_br0', \
282 {'priority': '1', 'dl_src': '00:00:00:00:00:05', \
283 'actions': ['output:#STEP[7][1]'], 'idle_timeout': '0'}],
284 ['vswitch', 'add_flow', 'int_br0', \
285 {'priority': '1', 'dl_src': '00:00:00:00:00:06', \
286 'actions': ['output:#STEP[8][1]'], 'idle_timeout': '0'}],
287 ['vswitch', 'add_flow', 'int_br0', \
288 {'priority': '1', 'dl_src': '00:00:00:00:00:07', \
289 'actions': ['output:#STEP[9][1]'], 'idle_timeout': '0'}],
290 ['vswitch', 'add_flow', 'int_br0', \
291 {'priority': '1', 'dl_src': '00:00:00:00:00:08', \
292 'actions': ['output:#STEP[10][1]'], 'idle_timeout': '0'}],
293 # Forward UDP packets depending on dest port
294 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
295 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '0', \
296 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
297 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
298 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '1', \
299 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
300 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
301 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '2', \
302 'actions': ['output:#STEP[7][1]'], 'idle_timeout': '0'}],
303 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
304 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '3', \
305 'actions': ['output:#STEP[9][1]'], 'idle_timeout': '0'}],
306 # Send VM outputs to phy port #2
307 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
308 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
309 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
310 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
311 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[8][1]', \
312 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
313 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[10][1]', \
314 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
317 STEP_VSWITCH_2PHY_6VM_INIT = STEP_VSWITCH_2PHY_4VM_INIT + [
318 ['vswitch', 'add_vport', 'int_br0'], # STEP 11 vm5 vhu8
319 ['vswitch', 'add_vport', 'int_br0'], # STEP 12 vhu9
320 ['vswitch', 'add_vport', 'int_br0'], # STEP 13 vm6 vhu10
321 ['vswitch', 'add_vport', 'int_br0'], # STEP 14 vhu11
324 STEP_VSWITCH_6_PARALLEL_VM_FLOWS_INIT = STEP_VSWITCH_4_PARALLEL_VM_FLOWS_INIT + [
325 ['vswitch', 'add_flow', 'int_br0', \
326 {'priority': '1', 'dl_src': '00:00:00:00:00:09', \
327 'actions': ['output:#STEP[11][1]'], 'idle_timeout': '0'}],
328 ['vswitch', 'add_flow', 'int_br0', \
329 {'priority': '1', 'dl_src': '00:00:00:00:00:0a', \
330 'actions': ['output:#STEP[12][1]'], 'idle_timeout': '0'}],
331 ['vswitch', 'add_flow', 'int_br0', \
332 {'priority': '1', 'dl_src': '00:00:00:00:00:0b', \
333 'actions': ['output:#STEP[13][1]'], 'idle_timeout': '0'}],
334 ['vswitch', 'add_flow', 'int_br0', \
335 {'priority': '1', 'dl_src': '00:00:00:00:00:0c', \
336 'actions': ['output:#STEP[14][1]'], 'idle_timeout': '0'}],
337 # Forward UDP packets depending on dest port
338 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
339 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '4', \
340 'actions': ['output:#STEP[11][1]'], 'idle_timeout': '0'}],
341 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
342 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '5', \
343 'actions': ['output:#STEP[13][1]'], 'idle_timeout': '0'}],
344 # Send VM outputs to phy port #2
345 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[12][1]', \
346 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
347 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[14][1]', \
348 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
351 STEP_VSWITCH_2PHY_6VM_FINIT = [
352 ['vswitch', 'del_port', 'int_br0', '#STEP[11][0]'], # vm5 ports
353 ['vswitch', 'del_port', 'int_br0', '#STEP[12][0]'],
354 ['vswitch', 'del_port', 'int_br0', '#STEP[13][0]'], # vm6 ports
355 ['vswitch', 'del_port', 'int_br0', '#STEP[14][0]'],
356 ] + STEP_VSWITCH_2PHY_4VM_FINIT
359 # Definition of integration tests
361 INTEGRATION_TESTS = [
363 "Name": "overlay_p2p_mod_tput",
364 "Deployment": "ptunp",
365 "Tunnel Type": "vxlan",
366 "Description": ("Tunneling Throughput RFC2544 Test."
367 "The encap and decap are performed inside the "
368 "virtual switch itself in each direction to avoid "
369 "the need of ingress overlay traffic."),
371 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
373 "traffic_type" : "rfc2544_throughput",
379 "Name": "overlay_p2p_tput",
380 "Deployment": "op2p",
381 "Tunnel Operation": "encapsulation",
382 "Description": "Overlay Encapsulation Throughput RFC2544 Test",
384 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
386 "traffic_type" : "rfc2544_throughput",
392 "Name": "overlay_p2p_cont",
393 "Deployment": "op2p",
394 "Tunnel Operation": "encapsulation",
395 "Description": "Overlay Encapsulation RFC2544 Continuous Stream",
397 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
399 "traffic_type" : "rfc2544_continuous",
405 "Name": "overlay_p2p_decap_tput",
406 "Deployment": "op2p",
407 "Tunnel Operation": "decapsulation",
408 "Description": "Overlay Decapsulation Throughput RFC2544 Test",
410 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
412 "traffic_type" : "rfc2544_throughput",
418 "Name": "overlay_p2p_decap_cont",
419 "Deployment": "op2p",
420 "Tunnel Operation": "decapsulation",
421 "Description": "Overlay Decapsulation RFC2544 Continuous Stream",
423 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
425 "traffic_type" : "rfc2544_continuous",
431 "Name": "vswitch_add_del_bridge",
432 "Deployment": "clean",
433 "Description": "vSwitch - add and delete bridge",
435 ['vswitch', 'add_switch', 'int_br0'],
436 ['vswitch', 'del_switch', 'int_br0'],
440 "Name": "vswitch_add_del_bridges",
441 "Deployment": "clean",
442 "Description": "vSwitch - add and delete bridges",
444 ['vswitch', 'add_switch', 'int_br0'],
445 ['vswitch', 'add_switch', 'int_br1'],
446 ['vswitch', 'del_switch', 'int_br0'],
447 ['vswitch', 'del_switch', 'int_br1'],
451 "Name": "vswitch_add_del_phy_port",
452 "Deployment": "clean",
453 "Description": "vSwitch - add and delete physical port",
455 ['vswitch', 'add_switch', 'int_br0'],
456 ['vswitch', 'add_phy_port', 'int_br0'],
457 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
458 ['vswitch', 'del_switch', 'int_br0'],
462 "Name": "vswitch_add_del_phy_ports",
463 "Deployment": "clean",
464 "Description": "vSwitch - add and delete physical ports",
466 ['vswitch', 'add_switch', 'int_br0'],
467 ['vswitch', 'add_phy_port', 'int_br0'],
468 ['vswitch', 'add_phy_port', 'int_br0'],
469 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
470 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
471 ['vswitch', 'del_switch', 'int_br0'],
475 "Name": "vswitch_add_del_vport",
476 "Deployment": "clean",
477 "Description": "vSwitch - add and delete virtual port",
479 ['vswitch', 'add_switch', 'int_br0'],
480 ['vswitch', 'add_vport', 'int_br0'],
481 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
482 ['vswitch', 'del_switch', 'int_br0'],
486 "Name": "vswitch_add_del_vports",
487 "Deployment": "clean",
488 "Description": "vSwitch - add and delete virtual ports",
490 ['vswitch', 'add_switch', 'int_br0'],
491 ['vswitch', 'add_vport', 'int_br0'],
492 ['vswitch', 'add_vport', 'int_br0'],
493 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
494 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
495 ['vswitch', 'del_switch', 'int_br0'],
499 "Name": "vswitch_add_del_connection",
500 "Deployment": "clean",
501 "Description": "vSwitch - add and delete connection",
503 ['vswitch', 'add_switch', 'int_br0'],
504 ['vswitch', 'add_phy_port', 'int_br0'],
505 ['vswitch', 'add_phy_port', 'int_br0'],
506 ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]'],
507 ['vswitch', 'dump_connections', 'int_br0'],
508 ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]'],
509 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
510 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
511 ['vswitch', 'del_switch', 'int_br0'],
515 "Name": "vswitch_vports_add_del_connection",
516 "Deployment": "clean",
517 "Description": "vSwitch - add and delete connection",
518 "Description": "vSwitch - configure switch with vports, add and delete connection",
520 ['vswitch', 'add_switch', 'int_br0'],
521 ['vswitch', 'add_vport', 'int_br0'],
522 ['vswitch', 'add_vport', 'int_br0'],
523 ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]'],
524 ['vswitch', 'dump_connections', 'int_br0'],
525 ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]'],
526 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
527 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
528 ['vswitch', 'del_switch', 'int_br0'],
532 "Name": "vswitch_add_del_connections",
533 "Deployment": "clean",
534 "Description": "vSwitch - add and delete connections",
535 "TestSteps": STEP_VSWITCH_P2P_CONNECTIONS_INIT +
536 STEP_VSWITCH_P2P_CONNECTIONS_FINIT
539 "Name": "vswitch_add_del_flow",
540 "Deployment": "clean",
541 "Description": "OVS: vSwitch - add and delete flow",
543 ['vswitch', 'add_switch', 'int_br0'],
544 ['vswitch', 'add_phy_port', 'int_br0'],
545 ['vswitch', 'add_phy_port', 'int_br0'],
546 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
547 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
548 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
549 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
550 ['vswitch', 'del_switch', 'int_br0'],
554 "Name": "vswitch_vports_add_del_flow",
555 "Deployment": "clean",
556 "Description": "OVS: vSwitch - configure switch with vports, add and delete flow",
558 ['vswitch', 'add_switch', 'int_br0'],
559 ['vswitch', 'add_vport', 'int_br0'],
560 ['vswitch', 'add_vport', 'int_br0'],
561 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
562 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
563 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
564 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
565 ['vswitch', 'del_switch', 'int_br0'],
569 "Name": "vswitch_add_del_flows",
570 "Deployment": "clean",
571 "Description": "OVS: vSwitch - add and delete flows",
572 "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
573 STEP_VSWITCH_P2P_FLOWS_FINIT
576 "Name": "vswitch_p2p_tput",
577 "Deployment": "clean",
578 "Description": "vSwitch - configure switch and execute RFC2544 throughput test",
579 "TestSteps": STEP_VSWITCH_P2P_CONNECTIONS_INIT +
581 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
583 STEP_VSWITCH_P2P_CONNECTIONS_FINIT
586 "Name": "vswitch_p2p_back2back",
587 "Deployment": "clean",
588 "Description": "vSwitch - configure switch and execute RFC2544 back2back test",
589 "TestSteps": STEP_VSWITCH_P2P_CONNECTIONS_INIT +
591 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
593 STEP_VSWITCH_P2P_CONNECTIONS_FINIT
596 "Name": "vswitch_p2p_cont",
597 "Deployment": "clean",
598 "Description": "vSwitch - configure switch and execute RFC2544 continuous stream test",
599 "TestSteps": STEP_VSWITCH_P2P_CONNECTIONS_INIT +
601 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
603 STEP_VSWITCH_P2P_CONNECTIONS_FINIT
606 "Name": "vswitch_pvp",
607 "Deployment": "clean",
608 "Description": "vSwitch - configure switch and one vnf",
609 "TestSteps": STEP_VSWITCH_PVP_INIT +
614 STEP_VSWITCH_PVP_FINIT
617 "Name": "vswitch_vports_pvp",
618 "Deployment": "clean",
619 "Description": "vSwitch - configure switch with vports and one vnf",
621 ['vswitch', 'add_switch', 'int_br0'],
622 ['vswitch', 'add_vport', 'int_br0'],
623 ['vswitch', 'add_vport', 'int_br0'],
626 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
627 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
628 ['vswitch', 'del_switch', 'int_br0'],
632 "Name": "vswitch_pvp_tput",
633 "Deployment": "clean",
634 "Description": "vSwitch - configure switch, vnf and execute RFC2544 throughput test",
635 "TestSteps": STEP_VSWITCH_PVP_CONNECTIONS_INIT +
638 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
641 STEP_VSWITCH_PVP_CONNECTIONS_FINIT
644 "Name": "vswitch_pvp_back2back",
645 "Deployment": "clean",
646 "Description": "vSwitch - configure switch, vnf and execute RFC2544 back2back test",
647 "TestSteps": STEP_VSWITCH_PVP_CONNECTIONS_INIT +
650 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
653 STEP_VSWITCH_PVP_CONNECTIONS_FINIT
656 "Name": "vswitch_pvp_cont",
657 "Deployment": "clean",
658 "Description": "vSwitch - configure switch, vnf and execute RFC2544 continuous stream test",
659 "TestSteps": STEP_VSWITCH_PVP_CONNECTIONS_INIT +
662 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
665 STEP_VSWITCH_PVP_CONNECTIONS_FINIT
668 "Name": "vswitch_pvp_all",
669 "Deployment": "clean",
670 "Description": "vSwitch - configure switch, vnf and execute all test types",
671 "TestSteps": STEP_VSWITCH_PVP_CONNECTIONS_INIT +
674 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
675 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
676 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
679 STEP_VSWITCH_PVP_CONNECTIONS_FINIT
682 "Name": "vswitch_pvvp",
683 "Deployment": "clean",
684 "Description": "vSwitch - configure switch and two vnfs",
685 "TestSteps": STEP_VSWITCH_PVVP_INIT +
692 STEP_VSWITCH_PVVP_FINIT
695 "Name": "vswitch_pvvp_tput",
696 "Deployment": "clean",
697 "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 throughput test",
698 "TestSteps": STEP_VSWITCH_PVVP_CONNECTIONS_INIT +
702 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
706 STEP_VSWITCH_PVVP_CONNECTIONS_FINIT
709 "Name": "vswitch_pvvp_back2back",
710 "Deployment": "clean",
711 "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 back2back test",
712 "TestSteps": STEP_VSWITCH_PVVP_CONNECTIONS_INIT +
716 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
720 STEP_VSWITCH_PVVP_CONNECTIONS_FINIT
723 "Name": "vswitch_pvvp_cont",
724 "Deployment": "clean",
725 "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 continuous stream test",
726 "TestSteps": STEP_VSWITCH_PVVP_CONNECTIONS_INIT +
730 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
734 STEP_VSWITCH_PVVP_CONNECTIONS_FINIT
737 "Name": "vswitch_pvvp_all",
738 "Deployment": "clean",
739 "Description": "vSwitch - configure switch, two chained vnfs and execute all test types",
740 "TestSteps": STEP_VSWITCH_PVVP_CONNECTIONS_INIT +
744 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
745 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
746 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
750 STEP_VSWITCH_PVVP_CONNECTIONS_FINIT
753 "Name": "vswitch_p4vp",
754 "Description": "Just configure 4 chained vnfs",
755 "Deployment": "clean",
756 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
767 STEP_VSWITCH_P4VP_FLOWS_FINIT
770 "Name": "vswitch_p4vp_tput",
771 "Description": "4 chained vnfs, execute RFC2544 throughput test",
772 "Deployment": "clean",
773 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
779 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', \
786 STEP_VSWITCH_P4VP_FLOWS_FINIT
789 "Name": "vswitch_p4vp_back2back",
790 "Description": "4 chained vnfs, execute RFC2544 back2back test",
791 "Deployment": "clean",
792 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
798 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', \
805 STEP_VSWITCH_P4VP_FLOWS_FINIT
808 "Name": "vswitch_p4vp_cont",
809 "Description": "4 chained vnfs, execute RFC2544 continuous stream test",
810 "Deployment": "clean",
811 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
817 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', \
824 STEP_VSWITCH_P4VP_FLOWS_FINIT
827 "Name": "vswitch_p4vp_all",
828 "Description": "4 chained vnfs, execute RFC2544 throughput test",
829 "Deployment": "clean",
830 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
836 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', \
838 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', \
840 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', \
847 STEP_VSWITCH_P4VP_FLOWS_FINIT
850 # Topology: 2 Parallel PVP connections
851 # To run a Linux bridge as a loopback in the Guest use:
852 # --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 2pvp_udp_dest_flows
853 # or add "Parameters" option to the test definition:
854 # "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
855 "Name": "2pvp_udp_dest_flows",
856 "Description": "RFC2544 Continuous TC with 2 Parallel VMs, flows on UDP Dest Port",
857 "Deployment": "clean",
861 "stream_type" : "L4",
864 "TestSteps": STEP_VSWITCH_2PHY_2VM_INIT +
865 STEP_VSWITCH_2_PARALLEL_VM_FLOWS_INIT + [
869 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'False'}],
873 ] + STEP_VSWITCH_FLOWS_FINIT +
874 STEP_VSWITCH_2PHY_2VM_FINIT
877 # Topology: 4 Parallel PVP connections
878 # To run a Linux bridge as a loopback in the Guest use:
879 # --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 4pvp_udp_dest_flows
880 # or add "Parameters" option to the test definition:
881 # "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
882 "Name": "4pvp_udp_dest_flows",
883 "Description": "RFC2544 Continuous TC with 4 Parallel VMs, flows on UDP Dest Port",
884 "Deployment": "clean",
888 "stream_type" : "L4",
891 "TestSteps": STEP_VSWITCH_2PHY_4VM_INIT +
892 STEP_VSWITCH_4_PARALLEL_VM_FLOWS_INIT + [
898 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'False'}],
904 ] + STEP_VSWITCH_FLOWS_FINIT +
905 STEP_VSWITCH_2PHY_4VM_FINIT
908 # Topology: 6 Parallel PVP connections
909 # To run a Linux bridge as a loopback in the Guest use:
910 # --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 6pvp_udp_dest_flows
911 # or add "Parameters" option to the test definition:
912 # "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
913 "Name": "6pvp_udp_dest_flows",
914 "Description": "RFC2544 Continuous TC with 6 Parallel VMs, flows on UDP Dest Port",
915 "Deployment": "clean",
919 "stream_type" : "L4",
922 "TestSteps": STEP_VSWITCH_2PHY_6VM_INIT +
923 STEP_VSWITCH_6_PARALLEL_VM_FLOWS_INIT + [
931 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'False'}],
938 ] + STEP_VSWITCH_FLOWS_FINIT +
939 STEP_VSWITCH_2PHY_6VM_FINIT
942 # Testcase for verification of vHost User NUMA awareness feature
943 # introduced in DPDK v2.2. Test case will execute two VNFs, each
944 # pinned to different NUMA slot. After that it will verify that
945 # QEMU and PMD threads serving its interfaces are co-located
946 # at the same NUMA slot.
949 # * architecture with at least 2 NUMA slots
950 # * OVS with DPDK support and DPDK v2.2 and newer
951 # * OVS configuration utilizing both NUMA slots
953 # Example of OVS configuration valid for DPDK v16.04 and cores
954 # split between NUMA slots as follows:
955 # node 0 cpus: 0 1 2 3 4 5 6 7 8 9
956 # node 1 cpus: 10 11 12 13 14 15 16 17 18 19
958 # VSWITCH_PMD_CPU_MASK = '1010'
959 # VSWITCHD_DPDK_CONFIG = {
960 # 'dpdk-init' : 'true',
961 # 'dpdk-lcore-mask' : '0x4004',
962 # 'pmd-cpu-mask' : 'FF0FF',
963 # 'dpdk-socket-mem' : '1024,1024',
966 "Name": "vhost_numa_awareness",
967 "Deployment": "clean",
968 "Description": "vSwitch DPDK - verify that PMD threads are served "
969 "by the same NUMA slot as QEMU instances",
970 "vSwitch" : "OvsDpdkVhost",
971 "TestSteps": STEP_VSWITCH_PVVP_INIT + # STEP 0-6
973 # check that at least 2 numa slots are available
974 ['tools', 'exec_shell', 'numactl -H', 'available: ([0-9]+)'], # STEP 7
975 ['tools', 'assert', '#STEP[-1][0]>1'], # STEP 8
976 # store last 2 cores from numa slot 0
977 ['tools', 'exec_shell', 'numactl -H', 'node 0 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 9
978 # store last 2 cores from numa slot 1
979 ['tools', 'exec_shell', 'numactl -H', 'node 1 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 10
980 # pin VNF1 to 1st NUMA slot and VNF2 to 2nd NUMA slot
981 ['settings', 'setValue', 'GUEST_CORE_BINDING', # STEP 11
982 [("#STEP[-2][0][0]", "#STEP[-2][0][1]"),
983 ("#STEP[-1][0][0]", "#STEP[-1][0][1]")]
986 ['vnf1', 'start'], # STEP 12
987 ['vnf2', 'start'], # STEP 13
988 # read paths to ovs utilities
989 ['settings', 'getValue', 'TOOLS'], # STEP 14
990 # check that PMD thread serving VNF1 runs at NUMA slot 0
991 ## i.e. get numa slot ID serving dpdhvhostuser0...
992 ['tools', 'exec_shell', "sudo #STEP[-1]['ovs-appctl'] " # STEP 15
993 "dpif-netdev/pmd-rxq-show | "
994 "sed -e '/dpdkvhostuser0/,$d' | tac",
995 'pmd thread numa_id ([0-9])+'
997 ## ...and check that it is NUMA slot 0
998 ['tools', 'assert', '#STEP[-1][0]==0'], # STEP 16
999 # check that PMD thread serving VNF2 runs at NUMA slot 1
1000 ## i.e. get numa slot ID serving dpdhvhostuser2...
1001 ['tools', 'exec_shell', "sudo #STEP[-3]['ovs-appctl'] " # STEP 17
1002 "dpif-netdev/pmd-rxq-show | "
1003 "sed -e '/dpdkvhostuser2/,$d' | tac",
1004 'pmd thread numa_id ([0-9])+'
1006 ## ...and check that it is NUMA slot 1
1007 ['tools', 'assert', '#STEP[-1][0]==1'], # STEP 18
1009 ['vnf2', 'stop'], # STEP 19
1010 ['vnf1', 'stop'], # STEP 20
1012 STEP_VSWITCH_PVVP_FINIT # STEP 21...
1015 # Testcase to demonstrate 1 port connection between DUT and IXIA traffic
1016 # generator. Testcase will enforce IxNet trafficgen and it will configure
1017 # both ports to the value of TRAFFICGEN_IXIA_PORT1 to indicate one port
1019 # Please note, that it is essential to ensure that TRAFFICGEN_IXIA_PORT1
1020 # is physically connected to the first NIC from WHITELIST_NICS list.
1021 "Name": "ixnet_pvp_tput_1nic",
1022 "Deployment": "clean",
1023 "Description": "PVP Scenario with 1 port towards IXIA",
1025 "TRAFFICGEN" : "IxNet",
1027 "traffic_type" : "rfc2544_throughput",
1028 # we are using one port, thus it's already a bidir connection
1033 ['vswitch', 'add_switch', 'int_br0'], # STEP 0
1034 ['vswitch', 'add_phy_port', 'int_br0'], # STEP 1
1035 ['vswitch', 'add_vport', 'int_br0'], # STEP 2
1036 ['vswitch', 'add_vport', 'int_br0'], # STEP 3
1037 ['vswitch', 'add_flow', 'int_br0',
1038 {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'],
1039 'idle_timeout': '0'}], # STEP 4
1040 ['vswitch', 'add_flow', 'int_br0',
1041 {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'],
1042 'idle_timeout': '0'}], # STEP 5
1043 ['vnf', 'start'], # STEP 6
1044 ['settings', 'getValue', 'TRAFFICGEN_IXIA_PORT1'], # STEP 7
1045 ['settings', 'setValue', 'TRAFFICGEN_IXIA_PORT2', '#STEP[-1]'],
1046 ['trafficgen', 'send_traffic', {}],
1047 ['vswitch', 'dump_flows', 'int_br0'],
1048 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
1049 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
1050 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
1051 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
1052 ['vswitch', 'del_port', 'int_br0', '#STEP[3][0]'],
1053 ['vswitch', 'del_switch', 'int_br0'],
1057 # VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
1060 "Name": "vswitch_version_vpp",
1061 "Deployment": "clean",
1062 "Description": "VPP: vSwitch - determine VPP version and fail if it is not possible.",
1063 "vSwitch" : "VppDpdkVhost",
1065 ['vswitch', 'run_vppctl', ['show', 'version', 'verbose'], '|Version:\s+(v\d+\.\d+)'],
1066 ['tools', 'assert', 'len(#STEP[-1][0])'],
1070 # END of VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
1074 # Examples of functional testcases with traffic capture validation
1076 # Capture Example 1 - Traffic capture inside VM (PVP scenario)
1077 # This TestCase will modify VLAN ID set by the traffic generator to the new value.
1078 # Correct VLAN ID settings is verified by inspection of captured frames.
1080 "Name": "capture_pvp_modify_vid",
1081 "Deployment": "pvp",
1082 "Description": "Test and verify VLAN ID modification by Open vSwitch",
1084 "VSWITCH" : "OvsDpdkVhost", # works also for Vanilla OVS
1085 "TRAFFICGEN_DURATION" : 5,
1087 "traffic_type" : "rfc2544_continuous",
1096 "GUEST_LOOPBACK" : ['linux_bridge'],
1099 # replace original flows with vlan ID modification
1100 ['!vswitch', 'add_flow', 'br0', {'in_port': '1', 'actions': ['mod_vlan_vid:4','output:3']}],
1101 ['!vswitch', 'add_flow', 'br0', {'in_port': '2', 'actions': ['mod_vlan_vid:4','output:4']}],
1102 ['vswitch', 'dump_flows', 'br0'],
1103 # verify that received frames have modified vlan ID
1104 ['VNF0', 'execute_and_wait', 'tcpdump -i eth0 -c 5 -w dump.pcap vlan 4 &'],
1105 ['trafficgen', 'send_traffic',{}],
1106 ['!VNF0', 'execute_and_wait', 'tcpdump -qer dump.pcap vlan 4 2>/dev/null | wc -l','|^(\d+)$'],
1107 ['tools', 'assert', '#STEP[-1][0] == 5'],
1111 # Capture Example 2 - Setup with 2 NICs, where traffic is captured after it is
1112 # processed by NIC under the test (2nd NIC). See documentation for further details.
1113 # This TestCase will strip VLAN headers from traffic sent by the traffic generator.
1114 # The removal of VLAN headers is verified by inspection of captured frames.
1116 # NOTE: This setup expects a DUT with two NICs with two ports each. First NIC is
1117 # connected to the traffic generator (standard VSPERF setup). Ports of a second NIC
1118 # are interconnected by a patch cable. PCI addresses of all four ports have to be
1119 # properly configured in the WHITELIST_NICS parameter.
1120 _CAPTURE_P2P2P_OVS_ACTION = ''
1121 _CAPTURE_P2P2P_SETUP = [
1122 # restore original NICS configuration, so we can refer to NICS elements
1123 ['settings', 'resetValue', 'WHITELIST_NICS'],
1124 ['settings', 'resetValue', 'NICS'],
1125 # create and configure two bridges to forward traffic through NIC under
1126 # the test and back to the traffic generator
1128 ['vswitch', 'add_switch', 'br0'],
1129 ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[0]["device"]'],
1130 ['tools', 'exec_shell', 'sudo ip link set dev $NICS[0]["device"] up'],
1131 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br0 $NICS[0]["device"]'],
1132 ['tools', 'exec_shell', 'sudo $TOOLS["bind-tool"] --bind igb_uio $NICS[3]["pci"]'],
1133 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br0 dpdk0 -- '
1134 'set Interface dpdk0 type=dpdk options:dpdk-devargs=$NICS[3]["pci"]'],
1135 ['tools', 'exec_shell', '$TOOLS["ovs-ofctl"] add-flow br0 in_port=1,action='
1136 '$_CAPTURE_P2P2P_OVS_ACTION,output:2'],
1138 ['vswitch', 'add_switch', 'br1'],
1139 ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[2]["device"]'],
1140 ['tools', 'exec_shell', 'sudo ip link set dev $NICS[2]["device"] up'],
1141 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br1 $NICS[2]["device"]'],
1142 ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[1]["device"]'],
1143 ['tools', 'exec_shell', 'sudo ip link set dev $NICS[1]["device"] up'],
1144 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br1 $NICS[1]["device"]'],
1145 ['vswitch', 'add_flow', 'br1', {'in_port': '1', 'actions': ['output:2']}],
1147 ['vswitch', 'dump_flows', 'br0'],
1148 ['vswitch', 'dump_flows', 'br1'],
1150 INTEGRATION_TESTS += [
1152 "Name": "capture_p2p2p_strip_vlan_ovs",
1153 "Deployment": "clean",
1154 "Description": "P2P Continuous Stream",
1156 "_CAPTURE_P2P2P_OVS_ACTION" : 'strip_vlan',
1159 "traffic_type" : "rfc2544_continuous",
1162 'srcmac': "ca:fe:00:00:00:00",
1163 'dstmac': "00:00:00:00:00:01"
1172 # suppress DPDK configuration, so physical interfaces are not bound to DPDK driver
1173 'WHITELIST_NICS' : [],
1176 "TestSteps": _CAPTURE_P2P2P_SETUP + [
1177 # capture traffic after processing by NIC under the test (after possible egress HW offloading)
1178 ['tools', 'exec_shell_background', 'tcpdump -i $NICS[2]["device"] -c 5 -w capture.pcap '
1179 'ether src $TRAFFIC["l2"]["srcmac"]'],
1180 ['trafficgen', 'send_traffic', {}],
1181 ['vswitch', 'dump_flows', 'br0'],
1182 ['vswitch', 'dump_flows', 'br1'],
1183 # there must be 5 captured frames...
1184 ['tools', 'exec_shell', 'tcpdump -r capture.pcap | wc -l', '|^(\d+)$'],
1185 ['tools', 'assert', '#STEP[-1][0] == 5'],
1186 # ...but no vlan headers
1187 ['tools', 'exec_shell', 'tcpdump -r capture.pcap vlan | wc -l', '|^(\d+)$'],
1188 ['tools', 'assert', '#STEP[-1][0] == 0'],
1191 # Capture Example 3 - Traffic capture by traffic generator.
1192 # This TestCase uses OVS flow to add VLAN tag with given ID into every
1193 # frame send by traffic generator. Correct frame modificaiton is verified by
1194 # inspection of packet capture received by T-Rex.
1196 "Name": "capture_p2p_add_vlan_ovs_trex",
1197 "Deployment": "clean",
1198 "Description": "OVS: Test VLAN tag modification and verify it by traffic capture",
1199 "vSwitch" : "OvsDpdkVhost", # works also for Vanilla OVS
1201 "TRAFFICGEN" : "Trex",
1202 "TRAFFICGEN_TREX_LEARNING_MODE" : True,
1204 "traffic_type" : "burst",
1207 # enable capture of five RX frames
1216 "TestSteps" : STEP_VSWITCH_P2P_INIT + [
1217 # replace standard L2 flows by flows, which will add VLAN tag with ID 3
1218 ['!vswitch', 'add_flow', 'int_br0', {'in_port': '1', 'actions': ['mod_vlan_vid:3','output:2']}],
1219 ['!vswitch', 'add_flow', 'int_br0', {'in_port': '2', 'actions': ['mod_vlan_vid:3','output:1']}],
1220 ['vswitch', 'dump_flows', 'int_br0'],
1221 ['trafficgen', 'send_traffic', {}],
1222 ['trafficgen', 'get_results'],
1223 # verify that captured frames have vlan tag with ID 3
1224 ['tools', 'exec_shell', 'tcpdump -qer $RESULTS_PATH/#STEP[-1][0]["capture_rx"] vlan 3 '
1225 '2>/dev/null | wc -l', '|^(\d+)$'],
1226 # number of received frames with expected VLAN id must match the number of captured frames
1227 ['tools', 'assert', '#STEP[-1][0] == 5'],
1228 ] + STEP_VSWITCH_P2P_FINIT,
1231 # End of examples of functional testcases with traffic capture validation
1235 # Example of TC definition with exact vSwitch, VNF and TRAFFICGEN values.
1237 # "Name": "ovs_vanilla_linux_bridge_pvp_cont",
1238 # "Deployment": "clean",
1239 # "Description": "vSwitch - configure OVS Vanilla, QemuVirtioNet with linux bridge and execute continuous stream test",
1240 # "vSwitch" : "OvsVanilla",
1241 # "VNF" : "QemuVirtioNet",
1242 # "Trafficgen": "IxNet",
1243 # "Parameters": {"GUEST_LOOPBACK" : ["linux_bridge"],},
1244 # "TestSteps": STEP_VSWITCH_PVP_CONNECTIONS_INIT +
1247 # ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
1250 # STEP_VSWITCH_PVP_CONNECTIONS_FINIT