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")
39 STEP_VSWITCH_P2P_INIT = [
40 ['vswitch', 'add_switch', 'int_br0'], # STEP 0
41 ['vswitch', 'add_phy_port', 'int_br0'], # STEP 1
42 ['vswitch', 'add_phy_port', 'int_br0'], # STEP 2
45 STEP_VSWITCH_P2P_FINIT = [
46 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
47 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
48 ['vswitch', 'del_switch', 'int_br0'],
51 STEP_VSWITCH_P2P_FLOWS_INIT = STEP_VSWITCH_P2P_INIT + [
52 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
53 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
56 STEP_VSWITCH_P2P_FLOWS_FINIT = [
57 ['vswitch', 'dump_flows', 'int_br0'],
58 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
59 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[2][1]'}],
60 ] + STEP_VSWITCH_P2P_FINIT
63 STEP_VSWITCH_PVP_INIT = STEP_VSWITCH_P2P_INIT + [
64 ['vswitch', 'add_vport', 'int_br0'], # STEP 3 vm1 ports
65 ['vswitch', 'add_vport', 'int_br0'], # STEP 4
68 STEP_VSWITCH_PVP_FINIT = [
69 ['vswitch', 'del_port', 'int_br0', '#STEP[3][0]'], # vm1 ports
70 ['vswitch', 'del_port', 'int_br0', '#STEP[4][0]'],
71 ] + STEP_VSWITCH_P2P_FINIT
73 STEP_VSWITCH_PVP_FLOWS_INIT = STEP_VSWITCH_PVP_INIT + [
74 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
75 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
76 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
77 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
80 STEP_VSWITCH_PVP_FLOWS_FINIT = [
81 ['vswitch', 'dump_flows', 'int_br0'],
82 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
83 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[4][1]'}],
84 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[2][1]'}],
85 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
86 ] + STEP_VSWITCH_PVP_FINIT
88 STEP_VSWITCH_PVVP_INIT = STEP_VSWITCH_PVP_INIT + [
89 ['vswitch', 'add_vport', 'int_br0'], # STEP 5 vm2 ports
90 ['vswitch', 'add_vport', 'int_br0'], # STEP 6
93 STEP_VSWITCH_PVVP_FINIT = [
94 ['vswitch', 'del_port', 'int_br0', '#STEP[5][0]'], # vm2 ports
95 ['vswitch', 'del_port', 'int_br0', '#STEP[6][0]'],
96 ] + STEP_VSWITCH_PVP_FINIT
98 STEP_VSWITCH_PVVP_FLOWS_INIT = STEP_VSWITCH_PVVP_INIT + [
99 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
100 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
101 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
102 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
103 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[5][1]', 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
104 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
107 STEP_VSWITCH_PVVP_FLOWS_FINIT = [
108 ['vswitch', 'dump_flows', 'int_br0'],
109 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
110 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[4][1]'}],
111 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[6][1]'}],
112 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[2][1]'}],
113 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[5][1]'}],
114 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
115 ] + STEP_VSWITCH_PVVP_FINIT
117 STEP_VSWITCH_P4VP_INIT = STEP_VSWITCH_PVVP_INIT + [
118 ['vswitch', 'add_vport', 'int_br0'], # STEP 7 vm3 ports
119 ['vswitch', 'add_vport', 'int_br0'], # STEP 8
120 ['vswitch', 'add_vport', 'int_br0'], # STEP 9 vm4 ports
121 ['vswitch', 'add_vport', 'int_br0'], # STEP 10
124 STEP_VSWITCH_P4VP_FINIT = [
125 ['vswitch', 'del_port', 'int_br0', '#STEP[7][0]'], # vm3 ports
126 ['vswitch', 'del_port', 'int_br0', '#STEP[8][0]'],
127 ['vswitch', 'del_port', 'int_br0', '#STEP[9][0]'], # vm4 ports
128 ['vswitch', 'del_port', 'int_br0', '#STEP[10][0]'],
129 ] + STEP_VSWITCH_PVVP_FINIT
131 STEP_VSWITCH_P4VP_FLOWS_INIT = STEP_VSWITCH_P4VP_INIT + [
132 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
133 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
134 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
135 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
136 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
137 'actions': ['output:#STEP[7][1]'], 'idle_timeout': '0'}],
138 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[8][1]', \
139 'actions': ['output:#STEP[9][1]'], 'idle_timeout': '0'}],
140 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[10][1]', \
141 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
142 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', \
143 'actions': ['output:#STEP[10][1]'], 'idle_timeout': '0'}],
144 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[9][1]', \
145 'actions': ['output:#STEP[8][1]'], 'idle_timeout': '0'}],
146 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[7][1]', \
147 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
148 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[5][1]', \
149 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
150 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', \
151 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
154 STEP_VSWITCH_P4VP_FLOWS_FINIT = [
155 ['vswitch', 'dump_flows', 'int_br0'],
156 ['vswitch', 'del_flow', 'int_br0'],
157 ] + STEP_VSWITCH_P4VP_FINIT
159 STEP_VSWITCH_2PHY_2VM_INIT = STEP_VSWITCH_PVVP_INIT
161 STEP_VSWITCH_2PHY_2VM_FINIT = STEP_VSWITCH_PVVP_FINIT
163 STEP_VSWITCH_2_PARALLEL_VM_FLOWS_INIT = [
164 # Setup Flows to reply ICMPv6 and similar packets, so to
165 # avoid flooding the internal port with their re-transmissions
166 ['vswitch', 'add_flow', 'int_br0', \
167 {'priority': '1', 'dl_src': '00:00:00:00:00:01', \
168 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
169 ['vswitch', 'add_flow', 'int_br0', \
170 {'priority': '1', 'dl_src': '00:00:00:00:00:02', \
171 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
172 ['vswitch', 'add_flow', 'int_br0', \
173 {'priority': '1', 'dl_src': '00:00:00:00:00:03', \
174 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
175 ['vswitch', 'add_flow', 'int_br0', \
176 {'priority': '1', 'dl_src': '00:00:00:00:00:04', \
177 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
178 # Forward UDP packets depending on dest port
179 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
180 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '0', \
181 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
182 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
183 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '1', \
184 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
185 # Send VM outputs to phy port #2
186 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
187 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
188 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
189 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
192 STEP_VSWITCH_2PHY_4VM_INIT = STEP_VSWITCH_2PHY_2VM_INIT + [
193 ['vswitch', 'add_vport', 'int_br0'], # STEP 7 vm3 ports
194 ['vswitch', 'add_vport', 'int_br0'], # STEP 8
195 ['vswitch', 'add_vport', 'int_br0'], # STEP 9 vm4 ports
196 ['vswitch', 'add_vport', 'int_br0'], # STEP 10
199 STEP_VSWITCH_2PHY_4VM_FINIT = [
200 ['vswitch', 'del_port', 'int_br0', '#STEP[7][0]'], # vm3 ports
201 ['vswitch', 'del_port', 'int_br0', '#STEP[8][0]'],
202 ['vswitch', 'del_port', 'int_br0', '#STEP[9][0]'], # vm4 ports
203 ['vswitch', 'del_port', 'int_br0', '#STEP[10][0]'],
204 ] + STEP_VSWITCH_2PHY_2VM_FINIT
206 STEP_VSWITCH_FLOWS_FINIT = [
207 ['vswitch', 'dump_flows', 'int_br0'],
208 ['vswitch', 'del_flow', 'int_br0'],
211 STEP_VSWITCH_4_PARALLEL_VM_FLOWS_INIT = [
212 # Setup Flows to reply ICMPv6 and similar packets, so to
213 # avoid flooding the internal port with their re-transmissions
214 ['vswitch', 'add_flow', 'int_br0', \
215 {'priority': '1', 'dl_src': '00:00:00:00:00:01', \
216 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
217 ['vswitch', 'add_flow', 'int_br0', \
218 {'priority': '1', 'dl_src': '00:00:00:00:00:02', \
219 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
220 ['vswitch', 'add_flow', 'int_br0', \
221 {'priority': '1', 'dl_src': '00:00:00:00:00:03', \
222 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
223 ['vswitch', 'add_flow', 'int_br0', \
224 {'priority': '1', 'dl_src': '00:00:00:00:00:04', \
225 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
226 ['vswitch', 'add_flow', 'int_br0', \
227 {'priority': '1', 'dl_src': '00:00:00:00:00:05', \
228 'actions': ['output:#STEP[7][1]'], 'idle_timeout': '0'}],
229 ['vswitch', 'add_flow', 'int_br0', \
230 {'priority': '1', 'dl_src': '00:00:00:00:00:06', \
231 'actions': ['output:#STEP[8][1]'], 'idle_timeout': '0'}],
232 ['vswitch', 'add_flow', 'int_br0', \
233 {'priority': '1', 'dl_src': '00:00:00:00:00:07', \
234 'actions': ['output:#STEP[9][1]'], 'idle_timeout': '0'}],
235 ['vswitch', 'add_flow', 'int_br0', \
236 {'priority': '1', 'dl_src': '00:00:00:00:00:08', \
237 'actions': ['output:#STEP[10][1]'], 'idle_timeout': '0'}],
238 # Forward UDP packets depending on dest port
239 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
240 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '0', \
241 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
242 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
243 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '1', \
244 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
245 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
246 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '2', \
247 'actions': ['output:#STEP[7][1]'], 'idle_timeout': '0'}],
248 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
249 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '3', \
250 'actions': ['output:#STEP[9][1]'], 'idle_timeout': '0'}],
251 # Send VM outputs to phy port #2
252 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
253 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
254 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
255 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
256 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[8][1]', \
257 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
258 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[10][1]', \
259 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
262 STEP_VSWITCH_2PHY_6VM_INIT = STEP_VSWITCH_2PHY_4VM_INIT + [
263 ['vswitch', 'add_vport', 'int_br0'], # STEP 11 vm5 vhu8
264 ['vswitch', 'add_vport', 'int_br0'], # STEP 12 vhu9
265 ['vswitch', 'add_vport', 'int_br0'], # STEP 13 vm6 vhu10
266 ['vswitch', 'add_vport', 'int_br0'], # STEP 14 vhu11
269 STEP_VSWITCH_6_PARALLEL_VM_FLOWS_INIT = STEP_VSWITCH_4_PARALLEL_VM_FLOWS_INIT + [
270 ['vswitch', 'add_flow', 'int_br0', \
271 {'priority': '1', 'dl_src': '00:00:00:00:00:09', \
272 'actions': ['output:#STEP[11][1]'], 'idle_timeout': '0'}],
273 ['vswitch', 'add_flow', 'int_br0', \
274 {'priority': '1', 'dl_src': '00:00:00:00:00:0a', \
275 'actions': ['output:#STEP[12][1]'], 'idle_timeout': '0'}],
276 ['vswitch', 'add_flow', 'int_br0', \
277 {'priority': '1', 'dl_src': '00:00:00:00:00:0b', \
278 'actions': ['output:#STEP[13][1]'], 'idle_timeout': '0'}],
279 ['vswitch', 'add_flow', 'int_br0', \
280 {'priority': '1', 'dl_src': '00:00:00:00:00:0c', \
281 'actions': ['output:#STEP[14][1]'], 'idle_timeout': '0'}],
282 # Forward UDP packets depending on dest port
283 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
284 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '4', \
285 'actions': ['output:#STEP[11][1]'], 'idle_timeout': '0'}],
286 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
287 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '5', \
288 'actions': ['output:#STEP[13][1]'], 'idle_timeout': '0'}],
289 # Send VM outputs to phy port #2
290 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[12][1]', \
291 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
292 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[14][1]', \
293 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
296 STEP_VSWITCH_2PHY_6VM_FINIT = [
297 ['vswitch', 'del_port', 'int_br0', '#STEP[11][0]'], # vm5 ports
298 ['vswitch', 'del_port', 'int_br0', '#STEP[12][0]'],
299 ['vswitch', 'del_port', 'int_br0', '#STEP[13][0]'], # vm6 ports
300 ['vswitch', 'del_port', 'int_br0', '#STEP[14][0]'],
301 ] + STEP_VSWITCH_2PHY_4VM_FINIT
304 # Definition of integration tests
306 INTEGRATION_TESTS = [
308 "Name": "overlay_p2p_mod_tput",
309 "Deployment": "ptunp",
310 "Tunnel Type": "vxlan",
311 "Description": ("Tunneling Throughput RFC2544 Test."
312 "The encap and decap are performed inside the "
313 "virtual switch itself in each direction to avoid "
314 "the need of ingress overlay traffic."),
316 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
318 "traffic_type" : "rfc2544_throughput",
324 "Name": "overlay_p2p_tput",
325 "Deployment": "op2p",
326 "Tunnel Operation": "encapsulation",
327 "Description": "Overlay Encapsulation Throughput RFC2544 Test",
329 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
331 "traffic_type" : "rfc2544_throughput",
337 "Name": "overlay_p2p_cont",
338 "Deployment": "op2p",
339 "Tunnel Operation": "encapsulation",
340 "Description": "Overlay Encapsulation RFC2544 Continuous Stream",
342 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
344 "traffic_type" : "rfc2544_continuous",
350 "Name": "overlay_p2p_decap_tput",
351 "Deployment": "op2p",
352 "Tunnel Operation": "decapsulation",
353 "Description": "Overlay Decapsulation Throughput RFC2544 Test",
355 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
357 "traffic_type" : "rfc2544_throughput",
363 "Name": "overlay_p2p_decap_cont",
364 "Deployment": "op2p",
365 "Tunnel Operation": "decapsulation",
366 "Description": "Overlay Decapsulation RFC2544 Continuous Stream",
368 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
370 "traffic_type" : "rfc2544_continuous",
376 "Name": "vswitch_add_del_bridge",
377 "Deployment": "clean",
378 "Description": "vSwitch - add and delete bridge",
380 ['vswitch', 'add_switch', 'int_br0'],
381 ['vswitch', 'del_switch', 'int_br0'],
385 "Name": "vswitch_add_del_bridges",
386 "Deployment": "clean",
387 "Description": "vSwitch - add and delete bridges",
389 ['vswitch', 'add_switch', 'int_br0'],
390 ['vswitch', 'add_switch', 'int_br1'],
391 ['vswitch', 'del_switch', 'int_br0'],
392 ['vswitch', 'del_switch', 'int_br1'],
396 "Name": "vswitch_add_del_phy_port",
397 "Deployment": "clean",
398 "Description": "vSwitch - add and delete physical port",
400 ['vswitch', 'add_switch', 'int_br0'],
401 ['vswitch', 'add_phy_port', 'int_br0'],
402 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
403 ['vswitch', 'del_switch', 'int_br0'],
407 "Name": "vswitch_add_del_phy_ports",
408 "Deployment": "clean",
409 "Description": "vSwitch - add and delete physical ports",
411 ['vswitch', 'add_switch', 'int_br0'],
412 ['vswitch', 'add_phy_port', 'int_br0'],
413 ['vswitch', 'add_phy_port', 'int_br0'],
414 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
415 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
416 ['vswitch', 'del_switch', 'int_br0'],
420 "Name": "vswitch_add_del_vport",
421 "Deployment": "clean",
422 "Description": "vSwitch - add and delete virtual port",
424 ['vswitch', 'add_switch', 'int_br0'],
425 ['vswitch', 'add_vport', 'int_br0'],
426 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
427 ['vswitch', 'del_switch', 'int_br0'],
431 "Name": "vswitch_add_del_vports",
432 "Deployment": "clean",
433 "Description": "vSwitch - add and delete virtual ports",
435 ['vswitch', 'add_switch', 'int_br0'],
436 ['vswitch', 'add_vport', 'int_br0'],
437 ['vswitch', 'add_vport', 'int_br0'],
438 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
439 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
440 ['vswitch', 'del_switch', 'int_br0'],
444 "Name": "vswitch_add_del_flow",
445 "Deployment": "clean",
446 "Description": "vSwitch - add and delete flow",
448 ['vswitch', 'add_switch', 'int_br0'],
449 ['vswitch', 'add_phy_port', 'int_br0'],
450 ['vswitch', 'add_phy_port', 'int_br0'],
451 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
452 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
453 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
454 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
455 ['vswitch', 'del_switch', 'int_br0'],
459 "Name": "vswitch_vports_add_del_flow",
460 "Deployment": "clean",
461 "Description": "vSwitch - configure switch with vports, add and delete flow",
463 ['vswitch', 'add_switch', 'int_br0'],
464 ['vswitch', 'add_vport', 'int_br0'],
465 ['vswitch', 'add_vport', 'int_br0'],
466 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
467 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
468 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
469 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
470 ['vswitch', 'del_switch', 'int_br0'],
474 "Name": "vswitch_add_del_flows",
475 "Deployment": "clean",
476 "Description": "vSwitch - add and delete flows",
477 "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
478 STEP_VSWITCH_P2P_FLOWS_FINIT
481 "Name": "vswitch_p2p_tput",
482 "Deployment": "clean",
483 "Description": "vSwitch - configure switch and execute RFC2544 throughput test",
484 "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
486 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
488 STEP_VSWITCH_P2P_FLOWS_FINIT
491 "Name": "vswitch_p2p_back2back",
492 "Deployment": "clean",
493 "Description": "vSwitch - configure switch and execute RFC2544 back2back test",
494 "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
496 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
498 STEP_VSWITCH_P2P_FLOWS_FINIT
501 "Name": "vswitch_p2p_cont",
502 "Deployment": "clean",
503 "Description": "vSwitch - configure switch and execute RFC2544 continuous stream test",
504 "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
506 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
508 STEP_VSWITCH_P2P_FLOWS_FINIT
511 "Name": "vswitch_pvp",
512 "Deployment": "clean",
513 "Description": "vSwitch - configure switch and one vnf",
514 "TestSteps": STEP_VSWITCH_PVP_INIT +
519 STEP_VSWITCH_PVP_FINIT
522 "Name": "vswitch_vports_pvp",
523 "Deployment": "clean",
524 "Description": "vSwitch - configure switch with vports and one vnf",
526 ['vswitch', 'add_switch', 'int_br0'],
527 ['vswitch', 'add_vport', 'int_br0'],
528 ['vswitch', 'add_vport', 'int_br0'],
531 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
532 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
533 ['vswitch', 'del_switch', 'int_br0'],
537 "Name": "vswitch_pvp_tput",
538 "Deployment": "clean",
539 "Description": "vSwitch - configure switch, vnf and execute RFC2544 throughput test",
540 "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
543 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
546 STEP_VSWITCH_PVP_FLOWS_FINIT
549 "Name": "vswitch_pvp_back2back",
550 "Deployment": "clean",
551 "Description": "vSwitch - configure switch, vnf and execute RFC2544 back2back test",
552 "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
555 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
558 STEP_VSWITCH_PVP_FLOWS_FINIT
561 "Name": "vswitch_pvp_cont",
562 "Deployment": "clean",
563 "Description": "vSwitch - configure switch, vnf and execute RFC2544 continuous stream test",
564 "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
567 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
570 STEP_VSWITCH_PVP_FLOWS_FINIT
573 "Name": "vswitch_pvp_all",
574 "Deployment": "clean",
575 "Description": "vSwitch - configure switch, vnf and execute all test types",
576 "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
579 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
580 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
581 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
584 STEP_VSWITCH_PVP_FLOWS_FINIT
587 "Name": "vswitch_pvvp",
588 "Deployment": "clean",
589 "Description": "vSwitch - configure switch and two vnfs",
590 "TestSteps": STEP_VSWITCH_PVVP_INIT +
597 STEP_VSWITCH_PVVP_FINIT
600 "Name": "vswitch_pvvp_tput",
601 "Deployment": "clean",
602 "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 throughput test",
603 "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
607 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
611 STEP_VSWITCH_PVVP_FLOWS_FINIT
614 "Name": "vswitch_pvvp_back2back",
615 "Deployment": "clean",
616 "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 back2back test",
617 "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
621 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
625 STEP_VSWITCH_PVVP_FLOWS_FINIT
628 "Name": "vswitch_pvvp_cont",
629 "Deployment": "clean",
630 "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 continuous stream test",
631 "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
635 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
639 STEP_VSWITCH_PVVP_FLOWS_FINIT
642 "Name": "vswitch_pvvp_all",
643 "Deployment": "clean",
644 "Description": "vSwitch - configure switch, two chained vnfs and execute all test types",
645 "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
649 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
650 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
651 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
655 STEP_VSWITCH_PVVP_FLOWS_FINIT
658 "Name": "vswitch_p4vp",
659 "Description": "Just configure 4 chained vnfs",
660 "Deployment": "clean",
661 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
672 STEP_VSWITCH_P4VP_FLOWS_FINIT
675 "Name": "vswitch_p4vp_tput",
676 "Description": "4 chained vnfs, execute RFC2544 throughput test",
677 "Deployment": "clean",
678 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
684 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', \
691 STEP_VSWITCH_P4VP_FLOWS_FINIT
694 "Name": "vswitch_p4vp_back2back",
695 "Description": "4 chained vnfs, execute RFC2544 back2back test",
696 "Deployment": "clean",
697 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
703 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', \
710 STEP_VSWITCH_P4VP_FLOWS_FINIT
713 "Name": "vswitch_p4vp_cont",
714 "Description": "4 chained vnfs, execute RFC2544 continuous stream test",
715 "Deployment": "clean",
716 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
722 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', \
729 STEP_VSWITCH_P4VP_FLOWS_FINIT
732 "Name": "vswitch_p4vp_all",
733 "Description": "4 chained vnfs, execute RFC2544 throughput test",
734 "Deployment": "clean",
735 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
741 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', \
743 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', \
745 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', \
752 STEP_VSWITCH_P4VP_FLOWS_FINIT
755 # Topology: 2 Parallel PVP connections
756 # To run a Linux bridge as a loopback in the Guest use:
757 # --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 2pvp_udp_dest_flows
758 # or add "Parameters" option to the test definition:
759 # "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
760 "Name": "2pvp_udp_dest_flows",
761 "Description": "RFC2544 Continuous TC with 2 Parallel VMs, flows on UDP Dest Port",
762 "Deployment": "clean",
766 "stream_type" : "L4",
769 "TestSteps": STEP_VSWITCH_2PHY_2VM_INIT +
770 STEP_VSWITCH_2_PARALLEL_VM_FLOWS_INIT + [
774 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'False'}],
778 ] + STEP_VSWITCH_FLOWS_FINIT +
779 STEP_VSWITCH_2PHY_2VM_FINIT
782 # Topology: 4 Parallel PVP connections
783 # To run a Linux bridge as a loopback in the Guest use:
784 # --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 4pvp_udp_dest_flows
785 # or add "Parameters" option to the test definition:
786 # "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
787 "Name": "4pvp_udp_dest_flows",
788 "Description": "RFC2544 Continuous TC with 4 Parallel VMs, flows on UDP Dest Port",
789 "Deployment": "clean",
793 "stream_type" : "L4",
796 "TestSteps": STEP_VSWITCH_2PHY_4VM_INIT +
797 STEP_VSWITCH_4_PARALLEL_VM_FLOWS_INIT + [
803 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'False'}],
809 ] + STEP_VSWITCH_FLOWS_FINIT +
810 STEP_VSWITCH_2PHY_4VM_FINIT
813 # Topology: 6 Parallel PVP connections
814 # To run a Linux bridge as a loopback in the Guest use:
815 # --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 6pvp_udp_dest_flows
816 # or add "Parameters" option to the test definition:
817 # "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
818 "Name": "6pvp_udp_dest_flows",
819 "Description": "RFC2544 Continuous TC with 6 Parallel VMs, flows on UDP Dest Port",
820 "Deployment": "clean",
824 "stream_type" : "L4",
827 "TestSteps": STEP_VSWITCH_2PHY_6VM_INIT +
828 STEP_VSWITCH_6_PARALLEL_VM_FLOWS_INIT + [
836 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'False'}],
843 ] + STEP_VSWITCH_FLOWS_FINIT +
844 STEP_VSWITCH_2PHY_6VM_FINIT
847 # Testcase for verification of vHost User NUMA awareness feature
848 # introduced in DPDK v2.2. Test case will execute two VNFs, each
849 # pinned to different NUMA slot. After that it will verify that
850 # QEMU and PMD threads serving its interfaces are co-located
851 # at the same NUMA slot.
854 # * architecture with at least 2 NUMA slots
855 # * OVS with DPDK support and DPDK v2.2 and newer
856 # * OVS configuration utilizing both NUMA slots
858 # Example of OVS configuration valid for DPDK v16.04 and cores
859 # split between NUMA slots as follows:
860 # node 0 cpus: 0 1 2 3 4 5 6 7 8 9
861 # node 1 cpus: 10 11 12 13 14 15 16 17 18 19
863 # VSWITCH_PMD_CPU_MASK = '1010'
864 # VSWITCHD_DPDK_CONFIG = {
865 # 'dpdk-init' : 'true',
866 # 'dpdk-lcore-mask' : '0x4004',
867 # 'pmd-cpu-mask' : 'FF0FF',
868 # 'dpdk-socket-mem' : '1024,1024',
871 "Name": "vhost_numa_awareness",
872 "Deployment": "clean",
873 "Description": "vSwitch DPDK - verify that PMD threads are served "
874 "by the same NUMA slot as QEMU instances",
875 "vSwitch" : "OvsDpdkVhost",
876 "TestSteps": STEP_VSWITCH_PVVP_INIT + # STEP 0-6
878 # check that at least 2 numa slots are available
879 ['tools', 'exec_shell', 'numactl -H', 'available: ([0-9]+)'], # STEP 7
880 ['tools', 'assert', '#STEP[-1][0]>1'], # STEP 8
881 # store last 2 cores from numa slot 0
882 ['tools', 'exec_shell', 'numactl -H', 'node 0 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 9
883 # store last 2 cores from numa slot 1
884 ['tools', 'exec_shell', 'numactl -H', 'node 1 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 10
885 # pin VNF1 to 1st NUMA slot and VNF2 to 2nd NUMA slot
886 ['settings', 'setValue', 'GUEST_CORE_BINDING', # STEP 11
887 [("#STEP[-2][0][0]", "#STEP[-2][0][1]"),
888 ("#STEP[-1][0][0]", "#STEP[-1][0][1]")]
891 ['vnf1', 'start'], # STEP 12
892 ['vnf2', 'start'], # STEP 13
893 # read paths to ovs utilities
894 ['settings', 'getValue', 'TOOLS'], # STEP 14
895 # check that PMD thread serving VNF1 runs at NUMA slot 0
896 ## i.e. get numa slot ID serving dpdhvhostuser0...
897 ['tools', 'exec_shell', "sudo #STEP[-1]['ovs-appctl'] " # STEP 15
898 "dpif-netdev/pmd-rxq-show | "
899 "sed -e '/dpdkvhostuser0/,$d' | tac",
900 'pmd thread numa_id ([0-9])+'
902 ## ...and check that it is NUMA slot 0
903 ['tools', 'assert', '#STEP[-1][0]==0'], # STEP 16
904 # check that PMD thread serving VNF2 runs at NUMA slot 1
905 ## i.e. get numa slot ID serving dpdhvhostuser2...
906 ['tools', 'exec_shell', "sudo #STEP[-3]['ovs-appctl'] " # STEP 17
907 "dpif-netdev/pmd-rxq-show | "
908 "sed -e '/dpdkvhostuser2/,$d' | tac",
909 'pmd thread numa_id ([0-9])+'
911 ## ...and check that it is NUMA slot 1
912 ['tools', 'assert', '#STEP[-1][0]==1'], # STEP 18
914 ['vnf2', 'stop'], # STEP 19
915 ['vnf1', 'stop'], # STEP 20
917 STEP_VSWITCH_PVVP_FINIT # STEP 21...
920 # Testcase to demonstrate 1 port connection between DUT and IXIA traffic
921 # generator. Testcase will enforce IxNet trafficgen and it will configure
922 # both ports to the value of TRAFFICGEN_IXIA_PORT1 to indicate one port
924 # Please note, that it is essential to ensure that TRAFFICGEN_IXIA_PORT1
925 # is physically connected to the first NIC from WHITELIST_NICS list.
926 "Name": "ixnet_pvp_tput_1nic",
927 "Deployment": "clean",
928 "Description": "PVP Scenario with 1 port towards IXIA",
930 "TRAFFICGEN" : "IxNet",
932 "traffic_type" : "rfc2544_throughput",
933 # we are using one port, thus it's already a bidir connection
938 ['vswitch', 'add_switch', 'int_br0'], # STEP 0
939 ['vswitch', 'add_phy_port', 'int_br0'], # STEP 1
940 ['vswitch', 'add_vport', 'int_br0'], # STEP 2
941 ['vswitch', 'add_vport', 'int_br0'], # STEP 3
942 ['vswitch', 'add_flow', 'int_br0',
943 {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'],
944 'idle_timeout': '0'}], # STEP 4
945 ['vswitch', 'add_flow', 'int_br0',
946 {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'],
947 'idle_timeout': '0'}], # STEP 5
948 ['vnf', 'start'], # STEP 6
949 ['settings', 'getValue', 'TRAFFICGEN_IXIA_PORT1'], # STEP 7
950 ['settings', 'setValue', 'TRAFFICGEN_IXIA_PORT2', '#STEP[-1]'],
951 ['trafficgen', 'send_traffic', {}],
952 ['vswitch', 'dump_flows', 'int_br0'],
953 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
954 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
955 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
956 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
957 ['vswitch', 'del_port', 'int_br0', '#STEP[3][0]'],
958 ['vswitch', 'del_switch', 'int_br0'],
962 # VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
965 "Name": "vswitch_version_vpp",
966 "Deployment": "clean",
967 "Description": "VPP: vSwitch - determine VPP version and fail if it is not possible.",
968 "vSwitch" : "VppDpdkVhost",
970 ['vswitch', 'run_vppctl', ['show', 'version', 'verbose'], '|Version:\s+(v\d+\.\d+)'],
971 ['tools', 'assert', 'len(#STEP[-1][0])'],
975 "Name": "vswitch_vports_add_del_connection_vpp",
976 "Deployment": "clean",
977 "Description": "VPP: vSwitch - configure switch with vports, add and delete connection",
978 "vSwitch" : "VppDpdkVhost",
980 ['vswitch', 'add_switch', 'int_br0'],
981 ['vswitch', 'add_vport', 'int_br0'],
982 ['vswitch', 'add_vport', 'int_br0'],
983 ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]', True],
984 ['vswitch', 'dump_connections', 'int_br0'],
985 ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]', True],
986 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
987 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
988 ['vswitch', 'del_switch', 'int_br0'],
992 # END of VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
996 # Examples of functional testcases with traffic capture validation
998 # Capture Example 1 - Traffic capture inside VM (PVP scenario)
999 # This TestCase will modify VLAN ID set by the traffic generator to the new value.
1000 # Correct VLAN ID settings is verified by inspection of captured frames.
1002 "Name": "capture_pvp_modify_vid",
1003 "Deployment": "pvp",
1004 "Description": "Test and verify VLAN ID modification by Open vSwitch",
1006 "VSWITCH" : "OvsDpdkVhost", # works also for Vanilla OVS
1007 "TRAFFICGEN_DURATION" : 5,
1009 "traffic_type" : "rfc2544_continuous",
1018 "GUEST_LOOPBACK" : ['linux_bridge'],
1021 # replace original flows with vlan ID modification
1022 ['!vswitch', 'add_flow', 'br0', {'in_port': '1', 'actions': ['mod_vlan_vid:4','output:3']}],
1023 ['!vswitch', 'add_flow', 'br0', {'in_port': '2', 'actions': ['mod_vlan_vid:4','output:4']}],
1024 ['vswitch', 'dump_flows', 'br0'],
1025 # verify that received frames have modified vlan ID
1026 ['VNF0', 'execute_and_wait', 'tcpdump -i eth0 -c 5 -w dump.pcap vlan 4 &'],
1027 ['trafficgen', 'send_traffic',{}],
1028 ['!VNF0', 'execute_and_wait', 'tcpdump -qer dump.pcap vlan 4 2>/dev/null | wc -l','|^(\d+)$'],
1029 ['tools', 'assert', '#STEP[-1][0] == 5'],
1033 # Capture Example 2 - Setup with 2 NICs, where traffic is captured after it is
1034 # processed by NIC under the test (2nd NIC). See documentation for further details.
1035 # This TestCase will strip VLAN headers from traffic sent by the traffic generator.
1036 # The removal of VLAN headers is verified by inspection of captured frames.
1038 # NOTE: This setup expects a DUT with two NICs with two ports each. First NIC is
1039 # connected to the traffic generator (standard VSPERF setup). Ports of a second NIC
1040 # are interconnected by a patch cable. PCI addresses of all four ports have to be
1041 # properly configured in the WHITELIST_NICS parameter.
1042 _CAPTURE_P2P2P_OVS_ACTION = ''
1043 _CAPTURE_P2P2P_SETUP = [
1044 # restore original NICS configuration, so we can refer to NICS elements
1045 ['settings', 'resetValue', 'WHITELIST_NICS'],
1046 ['settings', 'resetValue', 'NICS'],
1047 # create and configure two bridges to forward traffic through NIC under
1048 # the test and back to the traffic generator
1050 ['vswitch', 'add_switch', 'br0'],
1051 ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[0]["device"]'],
1052 ['tools', 'exec_shell', 'sudo ip link set dev $NICS[0]["device"] up'],
1053 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br0 $NICS[0]["device"]'],
1054 ['tools', 'exec_shell', 'sudo $TOOLS["bind-tool"] --bind igb_uio $NICS[3]["pci"]'],
1055 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br0 dpdk0 -- '
1056 'set Interface dpdk0 type=dpdk options:dpdk-devargs=$NICS[3]["pci"]'],
1057 ['tools', 'exec_shell', '$TOOLS["ovs-ofctl"] add-flow br0 in_port=1,action='
1058 '$_CAPTURE_P2P2P_OVS_ACTION,output:2'],
1060 ['vswitch', 'add_switch', 'br1'],
1061 ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[2]["device"]'],
1062 ['tools', 'exec_shell', 'sudo ip link set dev $NICS[2]["device"] up'],
1063 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br1 $NICS[2]["device"]'],
1064 ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[1]["device"]'],
1065 ['tools', 'exec_shell', 'sudo ip link set dev $NICS[1]["device"] up'],
1066 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br1 $NICS[1]["device"]'],
1067 ['vswitch', 'add_flow', 'br1', {'in_port': '1', 'actions': ['output:2']}],
1069 ['vswitch', 'dump_flows', 'br0'],
1070 ['vswitch', 'dump_flows', 'br1'],
1072 INTEGRATION_TESTS += [
1074 "Name": "capture_p2p2p_strip_vlan_ovs",
1075 "Deployment": "clean",
1076 "Description": "P2P Continuous Stream",
1078 "_CAPTURE_P2P2P_OVS_ACTION" : 'strip_vlan',
1081 "traffic_type" : "rfc2544_continuous",
1084 'srcmac': "ca:fe:00:00:00:00",
1085 'dstmac': "00:00:00:00:00:01"
1094 # suppress DPDK configuration, so physical interfaces are not bound to DPDK driver
1095 'WHITELIST_NICS' : [],
1098 "TestSteps": _CAPTURE_P2P2P_SETUP + [
1099 # capture traffic after processing by NIC under the test (after possible egress HW offloading)
1100 ['tools', 'exec_shell_background', 'tcpdump -i $NICS[2]["device"] -c 5 -w capture.pcap '
1101 'ether src $TRAFFIC["l2"]["srcmac"]'],
1102 ['trafficgen', 'send_traffic', {}],
1103 ['vswitch', 'dump_flows', 'br0'],
1104 ['vswitch', 'dump_flows', 'br1'],
1105 # there must be 5 captured frames...
1106 ['tools', 'exec_shell', 'tcpdump -r capture.pcap | wc -l', '|^(\d+)$'],
1107 ['tools', 'assert', '#STEP[-1][0] == 5'],
1108 # ...but no vlan headers
1109 ['tools', 'exec_shell', 'tcpdump -r capture.pcap vlan | wc -l', '|^(\d+)$'],
1110 ['tools', 'assert', '#STEP[-1][0] == 0'],
1113 # Capture Example 3 - Traffic capture by traffic generator.
1114 # This TestCase uses OVS flow to add VLAN tag with given ID into every
1115 # frame send by traffic generator. Correct frame modificaiton is verified by
1116 # inspection of packet capture received by T-Rex.
1118 "Name": "capture_p2p_add_vlan_ovs_trex",
1119 "Deployment": "clean",
1120 "Description": "OVS: Test VLAN tag modification and verify it by traffic capture",
1121 "vSwitch" : "OvsDpdkVhost", # works also for Vanilla OVS
1123 "TRAFFICGEN" : "Trex",
1124 "TRAFFICGEN_TREX_LEARNING_MODE" : True,
1126 "traffic_type" : "burst",
1129 # enable capture of five RX frames
1138 "TestSteps" : STEP_VSWITCH_P2P_INIT + [
1139 # replace standard L2 flows by flows, which will add VLAN tag with ID 3
1140 ['!vswitch', 'add_flow', 'int_br0', {'in_port': '1', 'actions': ['mod_vlan_vid:3','output:2']}],
1141 ['!vswitch', 'add_flow', 'int_br0', {'in_port': '2', 'actions': ['mod_vlan_vid:3','output:1']}],
1142 ['vswitch', 'dump_flows', 'int_br0'],
1143 ['trafficgen', 'send_traffic', {}],
1144 ['trafficgen', 'get_results'],
1145 # verify that captured frames have vlan tag with ID 3
1146 ['tools', 'exec_shell', 'tcpdump -qer $RESULTS_PATH/#STEP[-1][0]["capture_rx"] vlan 3 '
1147 '2>/dev/null | wc -l', '|^(\d+)$'],
1148 # number of received frames with expected VLAN id must match the number of captured frames
1149 ['tools', 'assert', '#STEP[-1][0] == 5'],
1150 ] + STEP_VSWITCH_P2P_FINIT,
1153 # End of examples of functional testcases with traffic capture validation
1157 # Example of TC definition with exact vSwitch, VNF and TRAFFICGEN values.
1159 # "Name": "ovs_vanilla_linux_bridge_pvp_cont",
1160 # "Deployment": "clean",
1161 # "Description": "vSwitch - configure OVS Vanilla, QemuVirtioNet with linux bridge and execute continuous stream test",
1162 # "vSwitch" : "OvsVanilla",
1163 # "VNF" : "QemuVirtioNet",
1164 # "Trafficgen": "IxNet",
1165 # "Parameters": {"GUEST_LOOPBACK" : ["linux_bridge"],},
1166 # "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
1169 # ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
1172 # STEP_VSWITCH_PVP_FLOWS_FINIT