1 # Copyright 2015-2017 Intel Corporation.
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.
15 # The 1st value of SUPPORTED_TUNNELING_PROTO is used as the default
16 # tunneling protocol for OP2P tests.
17 SUPPORTED_TUNNELING_PROTO = ['vxlan', 'gre', 'geneve']
20 # Generic test configuration options are described at conf/01_testcases.conf
24 # Options specific to integration testcases are described below:
26 # Required for OP2P tests
27 # "Tunnel Type": ["vxlan"|"gre"|"geneve"] # Tunnel Type defines tunneling protocol to use.
28 # # It can be overridden by cli option TUNNEL_TYPE.
30 # # "vxlan" - iteration of destination MAC address
31 # # "gre" - iteration of destination IP address
32 # # "geneve" - iteration of destination UDP port
33 # # Default value is "vxlan".
35 # bidirectional testing for OP2P is not yet supported.
36 # TRAFFIC['bidir'] must be set to 'False'.
39 # Common TestSteps parts ("macros")
43 STEP_VSWITCH_P2P_INIT = [
44 ['vswitch', 'add_switch', 'int_br0'], # STEP 0
45 ['vswitch', 'add_phy_port', 'int_br0'], # STEP 1
46 ['vswitch', 'add_phy_port', 'int_br0'], # STEP 2
49 STEP_VSWITCH_P2P_FINIT = [
50 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
51 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
52 ['vswitch', 'del_switch', 'int_br0'],
55 STEP_VSWITCH_P2P_FLOWS_INIT = STEP_VSWITCH_P2P_INIT + [
56 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
57 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
60 STEP_VSWITCH_P2P_FLOWS_FINIT = [
61 ['vswitch', 'dump_flows', 'int_br0'],
62 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
63 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[2][1]'}],
64 ] + STEP_VSWITCH_P2P_FINIT
67 STEP_VSWITCH_PVP_INIT = STEP_VSWITCH_P2P_INIT + [
68 ['vswitch', 'add_vport', 'int_br0'], # STEP 3 vm1 ports
69 ['vswitch', 'add_vport', 'int_br0'], # STEP 4
72 STEP_VSWITCH_PVP_FINIT = [
73 ['vswitch', 'del_port', 'int_br0', '#STEP[3][0]'], # vm1 ports
74 ['vswitch', 'del_port', 'int_br0', '#STEP[4][0]'],
75 ] + STEP_VSWITCH_P2P_FINIT
77 STEP_VSWITCH_PVP_FLOWS_INIT = STEP_VSWITCH_PVP_INIT + [
78 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
79 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
80 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
81 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
84 STEP_VSWITCH_PVP_FLOWS_FINIT = [
85 ['vswitch', 'dump_flows', 'int_br0'],
86 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
87 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[4][1]'}],
88 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[2][1]'}],
89 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
90 ] + STEP_VSWITCH_PVP_FINIT
92 STEP_VSWITCH_PVVP_INIT = STEP_VSWITCH_PVP_INIT + [
93 ['vswitch', 'add_vport', 'int_br0'], # STEP 5 vm2 ports
94 ['vswitch', 'add_vport', 'int_br0'], # STEP 6
97 STEP_VSWITCH_PVVP_FINIT = [
98 ['vswitch', 'del_port', 'int_br0', '#STEP[5][0]'], # vm2 ports
99 ['vswitch', 'del_port', 'int_br0', '#STEP[6][0]'],
100 ] + STEP_VSWITCH_PVP_FINIT
102 STEP_VSWITCH_PVVP_FLOWS_INIT = STEP_VSWITCH_PVVP_INIT + [
103 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
104 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
105 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
106 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
107 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[5][1]', 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
108 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
111 STEP_VSWITCH_PVVP_FLOWS_FINIT = [
112 ['vswitch', 'dump_flows', 'int_br0'],
113 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
114 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[4][1]'}],
115 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[6][1]'}],
116 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[2][1]'}],
117 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[5][1]'}],
118 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
119 ] + STEP_VSWITCH_PVVP_FINIT
121 STEP_VSWITCH_P4VP_INIT = STEP_VSWITCH_PVVP_INIT + [
122 ['vswitch', 'add_vport', 'int_br0'], # STEP 7 vm3 ports
123 ['vswitch', 'add_vport', 'int_br0'], # STEP 8
124 ['vswitch', 'add_vport', 'int_br0'], # STEP 9 vm4 ports
125 ['vswitch', 'add_vport', 'int_br0'], # STEP 10
128 STEP_VSWITCH_P4VP_FINIT = [
129 ['vswitch', 'del_port', 'int_br0', '#STEP[7][0]'], # vm3 ports
130 ['vswitch', 'del_port', 'int_br0', '#STEP[8][0]'],
131 ['vswitch', 'del_port', 'int_br0', '#STEP[9][0]'], # vm4 ports
132 ['vswitch', 'del_port', 'int_br0', '#STEP[10][0]'],
133 ] + STEP_VSWITCH_PVVP_FINIT
135 STEP_VSWITCH_P4VP_FLOWS_INIT = STEP_VSWITCH_P4VP_INIT + [
136 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
137 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
138 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
139 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
140 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
141 'actions': ['output:#STEP[7][1]'], 'idle_timeout': '0'}],
142 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[8][1]', \
143 'actions': ['output:#STEP[9][1]'], 'idle_timeout': '0'}],
144 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[10][1]', \
145 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
146 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', \
147 'actions': ['output:#STEP[10][1]'], 'idle_timeout': '0'}],
148 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[9][1]', \
149 'actions': ['output:#STEP[8][1]'], 'idle_timeout': '0'}],
150 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[7][1]', \
151 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
152 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[5][1]', \
153 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
154 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', \
155 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
158 STEP_VSWITCH_P4VP_FLOWS_FINIT = [
159 ['vswitch', 'dump_flows', 'int_br0'],
160 ['vswitch', 'del_flow', 'int_br0'],
161 ] + STEP_VSWITCH_P4VP_FINIT
163 STEP_VSWITCH_2PHY_2VM_INIT = STEP_VSWITCH_PVVP_INIT
165 STEP_VSWITCH_2PHY_2VM_FINIT = STEP_VSWITCH_PVVP_FINIT
167 STEP_VSWITCH_2_PARALLEL_VM_FLOWS_INIT = [
168 # Setup Flows to reply ICMPv6 and similar packets, so to
169 # avoid flooding the internal port with their re-transmissions
170 ['vswitch', 'add_flow', 'int_br0', \
171 {'priority': '1', 'dl_src': '00:00:00:00:00:01', \
172 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
173 ['vswitch', 'add_flow', 'int_br0', \
174 {'priority': '1', 'dl_src': '00:00:00:00:00:02', \
175 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
176 ['vswitch', 'add_flow', 'int_br0', \
177 {'priority': '1', 'dl_src': '00:00:00:00:00:03', \
178 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
179 ['vswitch', 'add_flow', 'int_br0', \
180 {'priority': '1', 'dl_src': '00:00:00:00:00:04', \
181 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
182 # Forward UDP packets depending on dest port
183 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
184 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '0', \
185 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
186 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
187 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '1', \
188 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
189 # Send VM outputs to phy port #2
190 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
191 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
192 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
193 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
196 STEP_VSWITCH_2PHY_4VM_INIT = STEP_VSWITCH_2PHY_2VM_INIT + [
197 ['vswitch', 'add_vport', 'int_br0'], # STEP 7 vm3 ports
198 ['vswitch', 'add_vport', 'int_br0'], # STEP 8
199 ['vswitch', 'add_vport', 'int_br0'], # STEP 9 vm4 ports
200 ['vswitch', 'add_vport', 'int_br0'], # STEP 10
203 STEP_VSWITCH_2PHY_4VM_FINIT = [
204 ['vswitch', 'del_port', 'int_br0', '#STEP[7][0]'], # vm3 ports
205 ['vswitch', 'del_port', 'int_br0', '#STEP[8][0]'],
206 ['vswitch', 'del_port', 'int_br0', '#STEP[9][0]'], # vm4 ports
207 ['vswitch', 'del_port', 'int_br0', '#STEP[10][0]'],
208 ] + STEP_VSWITCH_2PHY_2VM_FINIT
210 STEP_VSWITCH_FLOWS_FINIT = [
211 ['vswitch', 'dump_flows', 'int_br0'],
212 ['vswitch', 'del_flow', 'int_br0'],
215 STEP_VSWITCH_4_PARALLEL_VM_FLOWS_INIT = [
216 # Setup Flows to reply ICMPv6 and similar packets, so to
217 # avoid flooding the internal port with their re-transmissions
218 ['vswitch', 'add_flow', 'int_br0', \
219 {'priority': '1', 'dl_src': '00:00:00:00:00:01', \
220 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
221 ['vswitch', 'add_flow', 'int_br0', \
222 {'priority': '1', 'dl_src': '00:00:00:00:00:02', \
223 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
224 ['vswitch', 'add_flow', 'int_br0', \
225 {'priority': '1', 'dl_src': '00:00:00:00:00:03', \
226 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
227 ['vswitch', 'add_flow', 'int_br0', \
228 {'priority': '1', 'dl_src': '00:00:00:00:00:04', \
229 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
230 ['vswitch', 'add_flow', 'int_br0', \
231 {'priority': '1', 'dl_src': '00:00:00:00:00:05', \
232 'actions': ['output:#STEP[7][1]'], 'idle_timeout': '0'}],
233 ['vswitch', 'add_flow', 'int_br0', \
234 {'priority': '1', 'dl_src': '00:00:00:00:00:06', \
235 'actions': ['output:#STEP[8][1]'], 'idle_timeout': '0'}],
236 ['vswitch', 'add_flow', 'int_br0', \
237 {'priority': '1', 'dl_src': '00:00:00:00:00:07', \
238 'actions': ['output:#STEP[9][1]'], 'idle_timeout': '0'}],
239 ['vswitch', 'add_flow', 'int_br0', \
240 {'priority': '1', 'dl_src': '00:00:00:00:00:08', \
241 'actions': ['output:#STEP[10][1]'], 'idle_timeout': '0'}],
242 # Forward UDP packets depending on dest port
243 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
244 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '0', \
245 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
246 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
247 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '1', \
248 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
249 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
250 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '2', \
251 'actions': ['output:#STEP[7][1]'], 'idle_timeout': '0'}],
252 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
253 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '3', \
254 'actions': ['output:#STEP[9][1]'], 'idle_timeout': '0'}],
255 # Send VM outputs to phy port #2
256 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
257 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
258 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
259 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
260 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[8][1]', \
261 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
262 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[10][1]', \
263 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
266 STEP_VSWITCH_2PHY_6VM_INIT = STEP_VSWITCH_2PHY_4VM_INIT + [
267 ['vswitch', 'add_vport', 'int_br0'], # STEP 11 vm5 vhu8
268 ['vswitch', 'add_vport', 'int_br0'], # STEP 12 vhu9
269 ['vswitch', 'add_vport', 'int_br0'], # STEP 13 vm6 vhu10
270 ['vswitch', 'add_vport', 'int_br0'], # STEP 14 vhu11
273 STEP_VSWITCH_6_PARALLEL_VM_FLOWS_INIT = STEP_VSWITCH_4_PARALLEL_VM_FLOWS_INIT + [
274 ['vswitch', 'add_flow', 'int_br0', \
275 {'priority': '1', 'dl_src': '00:00:00:00:00:09', \
276 'actions': ['output:#STEP[11][1]'], 'idle_timeout': '0'}],
277 ['vswitch', 'add_flow', 'int_br0', \
278 {'priority': '1', 'dl_src': '00:00:00:00:00:0a', \
279 'actions': ['output:#STEP[12][1]'], 'idle_timeout': '0'}],
280 ['vswitch', 'add_flow', 'int_br0', \
281 {'priority': '1', 'dl_src': '00:00:00:00:00:0b', \
282 'actions': ['output:#STEP[13][1]'], 'idle_timeout': '0'}],
283 ['vswitch', 'add_flow', 'int_br0', \
284 {'priority': '1', 'dl_src': '00:00:00:00:00:0c', \
285 'actions': ['output:#STEP[14][1]'], 'idle_timeout': '0'}],
286 # Forward UDP packets depending on dest port
287 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
288 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '4', \
289 'actions': ['output:#STEP[11][1]'], 'idle_timeout': '0'}],
290 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
291 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '5', \
292 'actions': ['output:#STEP[13][1]'], 'idle_timeout': '0'}],
293 # Send VM outputs to phy port #2
294 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[12][1]', \
295 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
296 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[14][1]', \
297 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
300 STEP_VSWITCH_2PHY_6VM_FINIT = [
301 ['vswitch', 'del_port', 'int_br0', '#STEP[11][0]'], # vm5 ports
302 ['vswitch', 'del_port', 'int_br0', '#STEP[12][0]'],
303 ['vswitch', 'del_port', 'int_br0', '#STEP[13][0]'], # vm6 ports
304 ['vswitch', 'del_port', 'int_br0', '#STEP[14][0]'],
305 ] + STEP_VSWITCH_2PHY_4VM_FINIT
308 # Definition of integration tests
310 INTEGRATION_TESTS = [
312 "Name": "overlay_p2p_mod_tput",
313 "Deployment": "ptunp",
314 "Tunnel Type": "vxlan",
315 "Description": ("Tunneling Throughput RFC2544 Test."
316 "The encap and decap are performed inside the "
317 "virtual switch itself in each direction to avoid "
318 "the need of ingress overlay traffic."),
320 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
322 "traffic_type" : "rfc2544_throughput",
328 "Name": "overlay_p2p_tput",
329 "Deployment": "op2p",
330 "Tunnel Type": SUPPORTED_TUNNELING_PROTO[0],
331 "Tunnel Operation": "encapsulation",
332 "Description": "Overlay Encapsulation Throughput RFC2544 Test",
334 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
336 "traffic_type" : "rfc2544_throughput",
342 "Name": "overlay_p2p_cont",
343 "Deployment": "op2p",
344 "Tunnel Type": SUPPORTED_TUNNELING_PROTO[0],
345 "Tunnel Operation": "encapsulation",
346 "Description": "Overlay Encapsulation RFC2544 Continuous Stream",
348 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
350 "traffic_type" : "rfc2544_continuous",
356 "Name": "overlay_p2p_decap_tput",
357 "Deployment": "op2p",
358 "Tunnel Type": SUPPORTED_TUNNELING_PROTO[0],
359 "Tunnel Operation": "decapsulation",
360 "Description": "Overlay Decapsulation Throughput RFC2544 Test",
362 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
364 "traffic_type" : "rfc2544_throughput",
370 "Name": "overlay_p2p_decap_cont",
371 "Deployment": "op2p",
372 "Tunnel Type": SUPPORTED_TUNNELING_PROTO[0],
373 "Tunnel Operation": "decapsulation",
374 "Description": "Overlay Decapsulation RFC2544 Continuous Stream",
376 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
378 "traffic_type" : "rfc2544_continuous",
384 "Name": "vswitch_add_del_bridge",
385 "Deployment": "clean",
386 "Description": "vSwitch - add and delete bridge",
388 ['vswitch', 'add_switch', 'int_br0'],
389 ['vswitch', 'del_switch', 'int_br0'],
393 "Name": "vswitch_add_del_bridges",
394 "Deployment": "clean",
395 "Description": "vSwitch - add and delete bridges",
397 ['vswitch', 'add_switch', 'int_br0'],
398 ['vswitch', 'add_switch', 'int_br1'],
399 ['vswitch', 'del_switch', 'int_br0'],
400 ['vswitch', 'del_switch', 'int_br1'],
404 "Name": "vswitch_add_del_phy_port",
405 "Deployment": "clean",
406 "Description": "vSwitch - add and delete physical port",
408 ['vswitch', 'add_switch', 'int_br0'],
409 ['vswitch', 'add_phy_port', 'int_br0'],
410 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
411 ['vswitch', 'del_switch', 'int_br0'],
415 "Name": "vswitch_add_del_phy_ports",
416 "Deployment": "clean",
417 "Description": "vSwitch - add and delete physical ports",
419 ['vswitch', 'add_switch', 'int_br0'],
420 ['vswitch', 'add_phy_port', 'int_br0'],
421 ['vswitch', 'add_phy_port', 'int_br0'],
422 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
423 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
424 ['vswitch', 'del_switch', 'int_br0'],
428 "Name": "vswitch_add_del_vport",
429 "Deployment": "clean",
430 "Description": "vSwitch - add and delete virtual port",
432 ['vswitch', 'add_switch', 'int_br0'],
433 ['vswitch', 'add_vport', 'int_br0'],
434 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
435 ['vswitch', 'del_switch', 'int_br0'],
439 "Name": "vswitch_add_del_vports",
440 "Deployment": "clean",
441 "Description": "vSwitch - add and delete virtual ports",
443 ['vswitch', 'add_switch', 'int_br0'],
444 ['vswitch', 'add_vport', 'int_br0'],
445 ['vswitch', 'add_vport', 'int_br0'],
446 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
447 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
448 ['vswitch', 'del_switch', 'int_br0'],
452 "Name": "vswitch_add_del_flow",
453 "Deployment": "clean",
454 "Description": "vSwitch - add and delete flow",
456 ['vswitch', 'add_switch', 'int_br0'],
457 ['vswitch', 'add_phy_port', 'int_br0'],
458 ['vswitch', 'add_phy_port', 'int_br0'],
459 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
460 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
461 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
462 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
463 ['vswitch', 'del_switch', 'int_br0'],
467 "Name": "vswitch_vports_add_del_flow",
468 "Deployment": "clean",
469 "Description": "vSwitch - configure switch with vports, add and delete flow",
471 ['vswitch', 'add_switch', 'int_br0'],
472 ['vswitch', 'add_vport', 'int_br0'],
473 ['vswitch', 'add_vport', 'int_br0'],
474 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
475 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
476 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
477 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
478 ['vswitch', 'del_switch', 'int_br0'],
482 "Name": "vswitch_add_del_flows",
483 "Deployment": "clean",
484 "Description": "vSwitch - add and delete flows",
485 "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
486 STEP_VSWITCH_P2P_FLOWS_FINIT
489 "Name": "vswitch_p2p_tput",
490 "Deployment": "clean",
491 "Description": "vSwitch - configure switch and execute RFC2544 throughput test",
492 "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
494 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
496 STEP_VSWITCH_P2P_FLOWS_FINIT
499 "Name": "vswitch_p2p_back2back",
500 "Deployment": "clean",
501 "Description": "vSwitch - configure switch and execute RFC2544 back2back test",
502 "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
504 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
506 STEP_VSWITCH_P2P_FLOWS_FINIT
509 "Name": "vswitch_p2p_cont",
510 "Deployment": "clean",
511 "Description": "vSwitch - configure switch and execute RFC2544 continuous stream test",
512 "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
514 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
516 STEP_VSWITCH_P2P_FLOWS_FINIT
519 "Name": "vswitch_pvp",
520 "Deployment": "clean",
521 "Description": "vSwitch - configure switch and one vnf",
522 "TestSteps": STEP_VSWITCH_PVP_INIT +
527 STEP_VSWITCH_PVP_FINIT
530 "Name": "vswitch_vports_pvp",
531 "Deployment": "clean",
532 "Description": "vSwitch - configure switch with vports and one vnf",
534 ['vswitch', 'add_switch', 'int_br0'],
535 ['vswitch', 'add_vport', 'int_br0'],
536 ['vswitch', 'add_vport', 'int_br0'],
539 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
540 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
541 ['vswitch', 'del_switch', 'int_br0'],
545 "Name": "vswitch_pvp_tput",
546 "Deployment": "clean",
547 "Description": "vSwitch - configure switch, vnf and execute RFC2544 throughput test",
548 "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
551 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
554 STEP_VSWITCH_PVP_FLOWS_FINIT
557 "Name": "vswitch_pvp_back2back",
558 "Deployment": "clean",
559 "Description": "vSwitch - configure switch, vnf and execute RFC2544 back2back test",
560 "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
563 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
566 STEP_VSWITCH_PVP_FLOWS_FINIT
569 "Name": "vswitch_pvp_cont",
570 "Deployment": "clean",
571 "Description": "vSwitch - configure switch, vnf and execute RFC2544 continuous stream test",
572 "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
575 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
578 STEP_VSWITCH_PVP_FLOWS_FINIT
581 "Name": "vswitch_pvp_all",
582 "Deployment": "clean",
583 "Description": "vSwitch - configure switch, vnf and execute all test types",
584 "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
587 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
588 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
589 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
592 STEP_VSWITCH_PVP_FLOWS_FINIT
595 "Name": "vswitch_pvvp",
596 "Deployment": "clean",
597 "Description": "vSwitch - configure switch and two vnfs",
598 "TestSteps": STEP_VSWITCH_PVVP_INIT +
605 STEP_VSWITCH_PVVP_FINIT
608 "Name": "vswitch_pvvp_tput",
609 "Deployment": "clean",
610 "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 throughput test",
611 "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
615 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
619 STEP_VSWITCH_PVVP_FLOWS_FINIT
622 "Name": "vswitch_pvvp_back2back",
623 "Deployment": "clean",
624 "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 back2back test",
625 "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
629 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
633 STEP_VSWITCH_PVVP_FLOWS_FINIT
636 "Name": "vswitch_pvvp_cont",
637 "Deployment": "clean",
638 "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 continuous stream test",
639 "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
643 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
647 STEP_VSWITCH_PVVP_FLOWS_FINIT
650 "Name": "vswitch_pvvp_all",
651 "Deployment": "clean",
652 "Description": "vSwitch - configure switch, two chained vnfs and execute all test types",
653 "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
657 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
658 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
659 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
663 STEP_VSWITCH_PVVP_FLOWS_FINIT
666 "Name": "vswitch_p4vp",
667 "Description": "Just configure 4 chained vnfs",
668 "Deployment": "clean",
669 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
680 STEP_VSWITCH_P4VP_FLOWS_FINIT
683 "Name": "vswitch_p4vp_tput",
684 "Description": "4 chained vnfs, execute RFC2544 throughput test",
685 "Deployment": "clean",
686 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
692 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', \
699 STEP_VSWITCH_P4VP_FLOWS_FINIT
702 "Name": "vswitch_p4vp_back2back",
703 "Description": "4 chained vnfs, execute RFC2544 back2back test",
704 "Deployment": "clean",
705 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
711 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', \
718 STEP_VSWITCH_P4VP_FLOWS_FINIT
721 "Name": "vswitch_p4vp_cont",
722 "Description": "4 chained vnfs, execute RFC2544 continuous stream test",
723 "Deployment": "clean",
724 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
730 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', \
737 STEP_VSWITCH_P4VP_FLOWS_FINIT
740 "Name": "vswitch_p4vp_all",
741 "Description": "4 chained vnfs, execute RFC2544 throughput test",
742 "Deployment": "clean",
743 "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
749 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', \
751 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', \
753 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', \
760 STEP_VSWITCH_P4VP_FLOWS_FINIT
763 # Topology: 2 Parallel PVP connections
764 # To run a Linux bridge as a loopback in the Guest use:
765 # --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 2pvp_udp_dest_flows
766 # or add "Parameters" option to the test definition:
767 # "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
768 "Name": "2pvp_udp_dest_flows",
769 "Description": "RFC2544 Continuous TC with 2 Parallel VMs, flows on UDP Dest Port",
770 "Deployment": "clean",
774 "stream_type" : "L4",
777 "TestSteps": STEP_VSWITCH_2PHY_2VM_INIT +
778 STEP_VSWITCH_2_PARALLEL_VM_FLOWS_INIT + [
782 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'False'}],
786 ] + STEP_VSWITCH_FLOWS_FINIT +
787 STEP_VSWITCH_2PHY_2VM_FINIT
790 # Topology: 4 Parallel PVP connections
791 # To run a Linux bridge as a loopback in the Guest use:
792 # --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 4pvp_udp_dest_flows
793 # or add "Parameters" option to the test definition:
794 # "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
795 "Name": "4pvp_udp_dest_flows",
796 "Description": "RFC2544 Continuous TC with 4 Parallel VMs, flows on UDP Dest Port",
797 "Deployment": "clean",
801 "stream_type" : "L4",
804 "TestSteps": STEP_VSWITCH_2PHY_4VM_INIT +
805 STEP_VSWITCH_4_PARALLEL_VM_FLOWS_INIT + [
811 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'False'}],
817 ] + STEP_VSWITCH_FLOWS_FINIT +
818 STEP_VSWITCH_2PHY_4VM_FINIT
821 # Topology: 6 Parallel PVP connections
822 # To run a Linux bridge as a loopback in the Guest use:
823 # --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 6pvp_udp_dest_flows
824 # or add "Parameters" option to the test definition:
825 # "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
826 "Name": "6pvp_udp_dest_flows",
827 "Description": "RFC2544 Continuous TC with 6 Parallel VMs, flows on UDP Dest Port",
828 "Deployment": "clean",
832 "stream_type" : "L4",
835 "TestSteps": STEP_VSWITCH_2PHY_6VM_INIT +
836 STEP_VSWITCH_6_PARALLEL_VM_FLOWS_INIT + [
844 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'False'}],
851 ] + STEP_VSWITCH_FLOWS_FINIT +
852 STEP_VSWITCH_2PHY_6VM_FINIT
855 # Testcase for verification of vHost User NUMA awareness feature
856 # introduced in DPDK v2.2. Test case will execute two VNFs, each
857 # pinned to different NUMA slot. After that it will verify that
858 # QEMU and PMD threads serving its interfaces are co-located
859 # at the same NUMA slot.
862 # * architecture with at least 2 NUMA slots
863 # * OVS with DPDK support and DPDK v2.2 and newer
864 # * OVS configuration utilizing both NUMA slots
866 # Example of OVS configuration valid for DPDK v16.04 and cores
867 # split between NUMA slots as follows:
868 # node 0 cpus: 0 1 2 3 4 5 6 7 8 9
869 # node 1 cpus: 10 11 12 13 14 15 16 17 18 19
871 # VSWITCH_PMD_CPU_MASK = '1010'
872 # VSWITCHD_DPDK_CONFIG = {
873 # 'dpdk-init' : 'true',
874 # 'dpdk-lcore-mask' : '0x4004',
875 # 'pmd-cpu-mask' : 'FF0FF',
876 # 'dpdk-socket-mem' : '1024,1024',
879 "Name": "vhost_numa_awareness",
880 "Deployment": "clean",
881 "Description": "vSwitch DPDK - verify that PMD threads are served "
882 "by the same NUMA slot as QEMU instances",
883 "vSwitch" : "OvsDpdkVhost",
884 "TestSteps": STEP_VSWITCH_PVVP_INIT + # STEP 0-6
886 # check that at least 2 numa slots are available
887 ['tools', 'exec_shell', 'numactl -H', 'available: ([0-9]+)'], # STEP 7
888 ['tools', 'assert', '#STEP[-1][0]>1'], # STEP 8
889 # store last 2 cores from numa slot 0
890 ['tools', 'exec_shell', 'numactl -H', 'node 0 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 9
891 # store last 2 cores from numa slot 1
892 ['tools', 'exec_shell', 'numactl -H', 'node 1 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 10
893 # pin VNF1 to 1st NUMA slot and VNF2 to 2nd NUMA slot
894 ['settings', 'setValue', 'GUEST_CORE_BINDING', # STEP 11
895 [("#STEP[-2][0][0]", "#STEP[-2][0][1]"),
896 ("#STEP[-1][0][0]", "#STEP[-1][0][1]")]
899 ['vnf1', 'start'], # STEP 12
900 ['vnf2', 'start'], # STEP 13
901 # read paths to ovs utilities
902 ['settings', 'getValue', 'TOOLS'], # STEP 14
903 # check that PMD thread serving VNF1 runs at NUMA slot 0
904 ## i.e. get numa slot ID serving dpdhvhostuser0...
905 ['tools', 'exec_shell', "sudo #STEP[-1]['ovs-appctl'] " # STEP 15
906 "dpif-netdev/pmd-rxq-show | "
907 "sed -e '/dpdkvhostuser0/,$d' | tac",
908 'pmd thread numa_id ([0-9])+'
910 ## ...and check that it is NUMA slot 0
911 ['tools', 'assert', '#STEP[-1][0]==0'], # STEP 16
912 # check that PMD thread serving VNF2 runs at NUMA slot 1
913 ## i.e. get numa slot ID serving dpdhvhostuser2...
914 ['tools', 'exec_shell', "sudo #STEP[-3]['ovs-appctl'] " # STEP 17
915 "dpif-netdev/pmd-rxq-show | "
916 "sed -e '/dpdkvhostuser2/,$d' | tac",
917 'pmd thread numa_id ([0-9])+'
919 ## ...and check that it is NUMA slot 1
920 ['tools', 'assert', '#STEP[-1][0]==1'], # STEP 18
922 ['vnf2', 'stop'], # STEP 19
923 ['vnf1', 'stop'], # STEP 20
925 STEP_VSWITCH_PVVP_FINIT # STEP 21...
928 # Testcase to demonstrate 1 port connection between DUT and IXIA traffic
929 # generator. Testcase will enforce IxNet trafficgen and it will configure
930 # both ports to the value of TRAFFICGEN_IXIA_PORT1 to indicate one port
932 # Please note, that it is essential to ensure that TRAFFICGEN_IXIA_PORT1
933 # is physically connected to the first NIC from WHITELIST_NICS list.
934 "Name": "ixnet_pvp_tput_1nic",
935 "Deployment": "clean",
936 "Description": "PVP Scenario with 1 port towards IXIA",
938 "TRAFFICGEN" : "IxNet",
940 "traffic_type" : "rfc2544_throughput",
941 # we are using one port, thus it's already a bidir connection
946 ['vswitch', 'add_switch', 'int_br0'], # STEP 0
947 ['vswitch', 'add_phy_port', 'int_br0'], # STEP 1
948 ['vswitch', 'add_vport', 'int_br0'], # STEP 2
949 ['vswitch', 'add_vport', 'int_br0'], # STEP 3
950 ['vswitch', 'add_flow', 'int_br0',
951 {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'],
952 'idle_timeout': '0'}], # STEP 4
953 ['vswitch', 'add_flow', 'int_br0',
954 {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'],
955 'idle_timeout': '0'}], # STEP 5
956 ['vnf', 'start'], # STEP 6
957 ['settings', 'getValue', 'TRAFFICGEN_IXIA_PORT1'], # STEP 7
958 ['settings', 'setValue', 'TRAFFICGEN_IXIA_PORT2', '#STEP[-1]'],
959 ['trafficgen', 'send_traffic', {}],
960 ['vswitch', 'dump_flows', 'int_br0'],
961 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
962 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
963 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
964 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
965 ['vswitch', 'del_port', 'int_br0', '#STEP[3][0]'],
966 ['vswitch', 'del_switch', 'int_br0'],
970 # VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
973 "Name": "vswitch_version_vpp",
974 "Deployment": "clean",
975 "Description": "VPP: vSwitch - determine VPP version and fail if it is not possible.",
976 "vSwitch" : "VppDpdkVhost",
978 ['vswitch', 'run_vppctl', ['show', 'version', 'verbose'], '|Version:\s+(v\d+\.\d+)'],
979 ['tools', 'assert', 'len(#STEP[-1][0])'],
983 "Name": "vswitch_vports_add_del_connection_vpp",
984 "Deployment": "clean",
985 "Description": "VPP: vSwitch - configure switch with vports, add and delete connection",
986 "vSwitch" : "VppDpdkVhost",
988 ['vswitch', 'add_switch', 'int_br0'],
989 ['vswitch', 'add_vport', 'int_br0'],
990 ['vswitch', 'add_vport', 'int_br0'],
991 ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]', True],
992 ['vswitch', 'dump_connections', 'int_br0'],
993 ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]', True],
994 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
995 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
996 ['vswitch', 'del_switch', 'int_br0'],
1000 # END of VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
1004 # Examples of functional testcases with traffic capture validation
1006 # Capture Example 1 - Traffic capture inside VM (PVP scenario)
1007 # This TestCase will modify VLAN ID set by the traffic generator to the new value.
1008 # Correct VLAN ID settings is verified by inspection of captured frames.
1010 "Name": "capture_pvp_modify_vid",
1011 "Deployment": "pvp",
1012 "Description": "Test and verify VLAN ID modification by Open vSwitch",
1014 "VSWITCH" : "OvsDpdkVhost", # works also for Vanilla OVS
1015 "TRAFFICGEN_DURATION" : 5,
1017 "traffic_type" : "rfc2544_continuous",
1026 "GUEST_LOOPBACK" : ['linux_bridge'],
1029 # replace original flows with vlan ID modification
1030 ['!vswitch', 'add_flow', 'br0', {'in_port': '1', 'actions': ['mod_vlan_vid:4','output:3']}],
1031 ['!vswitch', 'add_flow', 'br0', {'in_port': '2', 'actions': ['mod_vlan_vid:4','output:4']}],
1032 ['vswitch', 'dump_flows', 'br0'],
1033 # verify that received frames have modified vlan ID
1034 ['VNF0', 'execute_and_wait', 'tcpdump -i eth0 -c 5 -w dump.pcap vlan 4 &'],
1035 ['trafficgen', 'send_traffic',{}],
1036 ['!VNF0', 'execute_and_wait', 'tcpdump -qer dump.pcap vlan 4 2>/dev/null | wc -l','|^(\d+)$'],
1037 ['tools', 'assert', '#STEP[-1][0] == 5'],
1041 # Capture Example 2 - Setup with 2 NICs, where traffic is captured after it is
1042 # processed by NIC under the test (2nd NIC). See documentation for further details.
1043 # This TestCase will strip VLAN headers from traffic sent by the traffic generator.
1044 # The removal of VLAN headers is verified by inspection of captured frames.
1046 # NOTE: This setup expects a DUT with two NICs with two ports each. First NIC is
1047 # connected to the traffic generator (standard VSPERF setup). Ports of a second NIC
1048 # are interconnected by a patch cable. PCI addresses of all four ports have to be
1049 # properly configured in the WHITELIST_NICS parameter.
1050 _CAPTURE_P2P2P_OVS_ACTION = ''
1051 _CAPTURE_P2P2P_SETUP = [
1052 # restore original NICS configuration, so we can refer to NICS elements
1053 ['settings', 'resetValue', 'WHITELIST_NICS'],
1054 ['settings', 'resetValue', 'NICS'],
1055 # create and configure two bridges to forward traffic through NIC under
1056 # the test and back to the traffic generator
1058 ['vswitch', 'add_switch', 'br0'],
1059 ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[0]["device"]'],
1060 ['tools', 'exec_shell', 'sudo ip link set dev $NICS[0]["device"] up'],
1061 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br0 $NICS[0]["device"]'],
1062 ['tools', 'exec_shell', 'sudo $TOOLS["bind-tool"] --bind igb_uio $NICS[3]["pci"]'],
1063 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br0 dpdk0 -- '
1064 'set Interface dpdk0 type=dpdk options:dpdk-devargs=$NICS[3]["pci"]'],
1065 ['tools', 'exec_shell', '$TOOLS["ovs-ofctl"] add-flow br0 in_port=1,action='
1066 '$_CAPTURE_P2P2P_OVS_ACTION,output:2'],
1068 ['vswitch', 'add_switch', 'br1'],
1069 ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[2]["device"]'],
1070 ['tools', 'exec_shell', 'sudo ip link set dev $NICS[2]["device"] up'],
1071 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br1 $NICS[2]["device"]'],
1072 ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[1]["device"]'],
1073 ['tools', 'exec_shell', 'sudo ip link set dev $NICS[1]["device"] up'],
1074 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br1 $NICS[1]["device"]'],
1075 ['vswitch', 'add_flow', 'br1', {'in_port': '1', 'actions': ['output:2']}],
1077 ['vswitch', 'dump_flows', 'br0'],
1078 ['vswitch', 'dump_flows', 'br1'],
1080 INTEGRATION_TESTS += [
1082 "Name": "capture_p2p2p_strip_vlan_ovs",
1083 "Deployment": "clean",
1084 "Description": "P2P Continuous Stream",
1086 "_CAPTURE_P2P2P_OVS_ACTION" : 'strip_vlan',
1089 "traffic_type" : "rfc2544_continuous",
1092 'srcmac': "ca:fe:00:00:00:00",
1093 'dstmac': "00:00:00:00:00:01"
1102 # suppress DPDK configuration, so physical interfaces are not bound to DPDK driver
1103 'WHITELIST_NICS' : [],
1106 "TestSteps": _CAPTURE_P2P2P_SETUP + [
1107 # capture traffic after processing by NIC under the test (after possible egress HW offloading)
1108 ['tools', 'exec_shell_background', 'tcpdump -i $NICS[2]["device"] -c 5 -w capture.pcap '
1109 'ether src $TRAFFIC["l2"]["srcmac"]'],
1110 ['trafficgen', 'send_traffic', {}],
1111 ['vswitch', 'dump_flows', 'br0'],
1112 ['vswitch', 'dump_flows', 'br1'],
1113 # there must be 5 captured frames...
1114 ['tools', 'exec_shell', 'tcpdump -r capture.pcap | wc -l', '|^(\d+)$'],
1115 ['tools', 'assert', '#STEP[-1][0] == 5'],
1116 # ...but no vlan headers
1117 ['tools', 'exec_shell', 'tcpdump -r capture.pcap vlan | wc -l', '|^(\d+)$'],
1118 ['tools', 'assert', '#STEP[-1][0] == 0'],
1121 # Capture Example 3 - Traffic capture by traffic generator.
1122 # This TestCase uses OVS flow to add VLAN tag with given ID into every
1123 # frame send by traffic generator. Correct frame modificaiton is verified by
1124 # inspection of packet capture received by T-Rex.
1126 "Name": "capture_p2p_add_vlan_ovs_trex",
1127 "Deployment": "clean",
1128 "Description": "OVS: Test VLAN tag modification and verify it by traffic capture",
1129 "vSwitch" : "OvsDpdkVhost", # works also for Vanilla OVS
1131 "TRAFFICGEN" : "Trex",
1132 "TRAFFICGEN_DURATION" : 5,
1134 "traffic_type" : "rfc2544_continuous",
1136 # enable capture of five RX frames
1145 "TestSteps" : STEP_VSWITCH_P2P_INIT + [
1146 # replace standard L2 flows by flows, which will add VLAN tag with ID 3
1147 ['!vswitch', 'add_flow', 'int_br0', {'in_port': '1', 'actions': ['mod_vlan_vid:3','output:2']}],
1148 ['!vswitch', 'add_flow', 'int_br0', {'in_port': '2', 'actions': ['mod_vlan_vid:3','output:1']}],
1149 ['vswitch', 'dump_flows', 'int_br0'],
1150 ['trafficgen', 'send_traffic', {}],
1151 ['trafficgen', 'get_results'],
1152 # verify that captured frames have vlan tag with ID 3
1153 ['tools', 'exec_shell', 'tcpdump -qer $RESULTS_PATH/#STEP[-1][0]["capture_rx"] vlan 3 '
1154 '2>/dev/null | wc -l', '|^(\d+)$'],
1155 # number of received frames with expected VLAN id must match the number of captured frames
1156 ['tools', 'assert', '#STEP[-1][0] == 5'],
1157 ] + STEP_VSWITCH_P2P_FINIT,
1160 # End of examples of functional testcases with traffic capture validation
1164 # Example of TC definition with exact vSwitch, VNF and TRAFFICGEN values.
1166 # "Name": "ovs_vanilla_linux_bridge_pvp_cont",
1167 # "Deployment": "clean",
1168 # "Description": "vSwitch - configure OVS Vanilla, QemuVirtioNet with linux bridge and execute continuous stream test",
1169 # "vSwitch" : "OvsVanilla",
1170 # "VNF" : "QemuVirtioNet",
1171 # "Trafficgen": "IxNet",
1172 # "Parameters": {"GUEST_LOOPBACK" : ["linux_bridge"],},
1173 # "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
1176 # ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
1179 # STEP_VSWITCH_PVP_FLOWS_FINIT