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
118 # Definition of integration tests
120 INTEGRATION_TESTS = [
122 "Name": "overlay_p2p_mod_tput",
123 "Deployment": "ptunp",
124 "Tunnel Type": "vxlan",
125 "Description": ("Tunneling Throughput RFC2544 Test."
126 "The encap and decap are performed inside the "
127 "virtual switch itself in each direction to avoid "
128 "the need of ingress overlay traffic."),
130 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
132 "traffic_type" : "rfc2544_throughput",
138 "Name": "overlay_p2p_tput",
139 "Deployment": "op2p",
140 "Tunnel Operation": "encapsulation",
141 "Description": "Overlay Encapsulation Throughput RFC2544 Test",
143 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
145 "traffic_type" : "rfc2544_throughput",
151 "Name": "overlay_p2p_cont",
152 "Deployment": "op2p",
153 "Tunnel Operation": "encapsulation",
154 "Description": "Overlay Encapsulation RFC2544 Continuous Stream",
156 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
158 "traffic_type" : "rfc2544_continuous",
164 "Name": "overlay_p2p_decap_tput",
165 "Deployment": "op2p",
166 "Tunnel Operation": "decapsulation",
167 "Description": "Overlay Decapsulation Throughput RFC2544 Test",
169 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
171 "traffic_type" : "rfc2544_throughput",
177 "Name": "overlay_p2p_decap_cont",
178 "Deployment": "op2p",
179 "Tunnel Operation": "decapsulation",
180 "Description": "Overlay Decapsulation RFC2544 Continuous Stream",
182 "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
184 "traffic_type" : "rfc2544_continuous",
190 "Name": "vswitch_add_del_bridge",
191 "Deployment": "clean",
192 "Description": "vSwitch - add and delete bridge",
194 ['vswitch', 'add_switch', 'int_br0'],
195 ['vswitch', 'del_switch', 'int_br0'],
199 "Name": "vswitch_add_del_bridges",
200 "Deployment": "clean",
201 "Description": "vSwitch - add and delete bridges",
203 ['vswitch', 'add_switch', 'int_br0'],
204 ['vswitch', 'add_switch', 'int_br1'],
205 ['vswitch', 'del_switch', 'int_br0'],
206 ['vswitch', 'del_switch', 'int_br1'],
210 "Name": "vswitch_add_del_phy_port",
211 "Deployment": "clean",
212 "Description": "vSwitch - add and delete physical port",
214 ['vswitch', 'add_switch', 'int_br0'],
215 ['vswitch', 'add_phy_port', 'int_br0'],
216 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
217 ['vswitch', 'del_switch', 'int_br0'],
221 "Name": "vswitch_add_del_phy_ports",
222 "Deployment": "clean",
223 "Description": "vSwitch - add and delete physical ports",
225 ['vswitch', 'add_switch', 'int_br0'],
226 ['vswitch', 'add_phy_port', 'int_br0'],
227 ['vswitch', 'add_phy_port', 'int_br0'],
228 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
229 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
230 ['vswitch', 'del_switch', 'int_br0'],
234 "Name": "vswitch_add_del_vport",
235 "Deployment": "clean",
236 "Description": "vSwitch - add and delete virtual port",
238 ['vswitch', 'add_switch', 'int_br0'],
239 ['vswitch', 'add_vport', 'int_br0'],
240 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
241 ['vswitch', 'del_switch', 'int_br0'],
245 "Name": "vswitch_add_del_vports",
246 "Deployment": "clean",
247 "Description": "vSwitch - add and delete virtual ports",
249 ['vswitch', 'add_switch', 'int_br0'],
250 ['vswitch', 'add_vport', 'int_br0'],
251 ['vswitch', 'add_vport', 'int_br0'],
252 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
253 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
254 ['vswitch', 'del_switch', 'int_br0'],
258 "Name": "vswitch_add_del_flow",
259 "Deployment": "clean",
260 "Description": "vSwitch - add and delete flow",
262 ['vswitch', 'add_switch', 'int_br0'],
263 ['vswitch', 'add_phy_port', 'int_br0'],
264 ['vswitch', 'add_phy_port', 'int_br0'],
265 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
266 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
267 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
268 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
269 ['vswitch', 'del_switch', 'int_br0'],
273 "Name": "vswitch_vports_add_del_flow",
274 "Deployment": "clean",
275 "Description": "vSwitch - configure switch with vports, add and delete flow",
277 ['vswitch', 'add_switch', 'int_br0'],
278 ['vswitch', 'add_vport', 'int_br0'],
279 ['vswitch', 'add_vport', 'int_br0'],
280 ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
281 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
282 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
283 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
284 ['vswitch', 'del_switch', 'int_br0'],
288 "Name": "vswitch_add_del_flows",
289 "Deployment": "clean",
290 "Description": "vSwitch - add and delete flows",
291 "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
292 STEP_VSWITCH_P2P_FLOWS_FINIT
295 "Name": "vswitch_p2p_tput",
296 "Deployment": "clean",
297 "Description": "vSwitch - configure switch and execute RFC2544 throughput test",
298 "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
300 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
302 STEP_VSWITCH_P2P_FLOWS_FINIT
305 "Name": "vswitch_p2p_back2back",
306 "Deployment": "clean",
307 "Description": "vSwitch - configure switch and execute RFC2544 back2back test",
308 "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
310 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
312 STEP_VSWITCH_P2P_FLOWS_FINIT
315 "Name": "vswitch_p2p_cont",
316 "Deployment": "clean",
317 "Description": "vSwitch - configure switch and execute RFC2544 continuous stream test",
318 "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
320 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
322 STEP_VSWITCH_P2P_FLOWS_FINIT
325 "Name": "vswitch_pvp",
326 "Deployment": "clean",
327 "Description": "vSwitch - configure switch and one vnf",
328 "TestSteps": STEP_VSWITCH_PVP_INIT +
333 STEP_VSWITCH_PVP_FINIT
336 "Name": "vswitch_vports_pvp",
337 "Deployment": "clean",
338 "Description": "vSwitch - configure switch with vports and one vnf",
340 ['vswitch', 'add_switch', 'int_br0'],
341 ['vswitch', 'add_vport', 'int_br0'],
342 ['vswitch', 'add_vport', 'int_br0'],
345 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
346 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
347 ['vswitch', 'del_switch', 'int_br0'],
351 "Name": "vswitch_pvp_tput",
352 "Deployment": "clean",
353 "Description": "vSwitch - configure switch, vnf and execute RFC2544 throughput test",
354 "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
357 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
360 STEP_VSWITCH_PVP_FLOWS_FINIT
363 "Name": "vswitch_pvp_back2back",
364 "Deployment": "clean",
365 "Description": "vSwitch - configure switch, vnf and execute RFC2544 back2back test",
366 "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
369 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
372 STEP_VSWITCH_PVP_FLOWS_FINIT
375 "Name": "vswitch_pvp_cont",
376 "Deployment": "clean",
377 "Description": "vSwitch - configure switch, vnf and execute RFC2544 continuous stream test",
378 "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
381 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
384 STEP_VSWITCH_PVP_FLOWS_FINIT
387 "Name": "vswitch_pvp_all",
388 "Deployment": "clean",
389 "Description": "vSwitch - configure switch, vnf and execute all test types",
390 "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
393 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
394 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
395 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
398 STEP_VSWITCH_PVP_FLOWS_FINIT
401 "Name": "vswitch_pvvp",
402 "Deployment": "clean",
403 "Description": "vSwitch - configure switch and two vnfs",
404 "TestSteps": STEP_VSWITCH_PVVP_INIT +
411 STEP_VSWITCH_PVVP_FINIT
414 "Name": "vswitch_pvvp_tput",
415 "Deployment": "clean",
416 "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 throughput test",
417 "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
421 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
425 STEP_VSWITCH_PVVP_FLOWS_FINIT
428 "Name": "vswitch_pvvp_back2back",
429 "Deployment": "clean",
430 "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 back2back test",
431 "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
435 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
439 STEP_VSWITCH_PVVP_FLOWS_FINIT
442 "Name": "vswitch_pvvp_cont",
443 "Deployment": "clean",
444 "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 continuous stream test",
445 "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
449 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
453 STEP_VSWITCH_PVVP_FLOWS_FINIT
456 "Name": "vswitch_pvvp_all",
457 "Deployment": "clean",
458 "Description": "vSwitch - configure switch, two chained vnfs and execute all test types",
459 "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
463 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
464 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
465 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
469 STEP_VSWITCH_PVVP_FLOWS_FINIT
472 "Name": "vswitch_p4vp_tput",
473 "Description": "4 chained vnfs, execute RFC2544 throughput test, deployment pvvp4",
474 "Deployment": "pvvp4",
477 "traffic_type" : "rfc2544_throughput",
482 "Name": "vswitch_p4vp_back2back",
483 "Description": "4 chained vnfs, execute RFC2544 back2back test, deployment pvvp4",
484 "Deployment": "pvvp4",
487 "traffic_type" : "rfc2544_back2back",
492 "Name": "vswitch_p4vp_cont",
493 "Description": "4 chained vnfs, execute RFC2544 continuous stream test, deployment pvvp4",
494 "Deployment": "pvvp4",
497 "traffic_type" : "rfc2544_continuous",
502 "Name": "vswitch_p4vp_all",
503 "Description": "4 chained vnfs, execute RFC2544 throughput tests, deployment pvvp4",
504 "Deployment": "pvvp4",
507 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput'}],
508 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back'}],
509 ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous'}],
513 # Topology: 2 Parallel PVP connections
514 # To run a Linux bridge as a loopback in the Guest use:
515 # --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 2pvp_udp_dest_flows
516 # or add "Parameters" option to the test definition:
517 # "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
518 "Name": "2pvp_udp_dest_flows",
519 "Description": "RFC2544 Continuous TC with 2 Parallel VMs, flows on UDP Dest Port, deployment pvpv2",
520 "Deployment": "pvpv2",
523 "traffic_type" : "rfc2544_continuous",
528 # Topology: 4 Parallel PVP connections
529 # To run a Linux bridge as a loopback in the Guest use:
530 # --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 4pvp_udp_dest_flows
531 # or add "Parameters" option to the test definition:
532 # "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
533 "Name": "4pvp_udp_dest_flows",
534 "Description": "RFC2544 Continuous TC with 4 Parallel VMs, flows on UDP Dest Port, deployment pvpv4",
535 "Deployment": "pvpv4",
538 "traffic_type" : "rfc2544_continuous",
543 # Topology: 6 Parallel PVP connections
544 # To run a Linux bridge as a loopback in the Guest use:
545 # --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 6pvp_udp_dest_flows
546 # or add "Parameters" option to the test definition:
547 # "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
548 "Name": "6pvp_udp_dest_flows",
549 "Description": "RFC2544 Continuous TC with 6 Parallel VMs, flows on UDP Dest Port, deployment pvpv6",
550 "Deployment": "pvpv6",
553 "traffic_type" : "rfc2544_continuous",
558 # Testcase for verification of vHost User NUMA awareness feature
559 # introduced in DPDK v2.2. Test case will execute two VNFs, each
560 # pinned to different NUMA slot. After that it will verify that
561 # QEMU and PMD threads serving its interfaces are co-located
562 # at the same NUMA slot.
565 # * architecture with at least 2 NUMA slots
566 # * OVS with DPDK support and DPDK v2.2 and newer
567 # * OVS configuration utilizing both NUMA slots
569 # Example of OVS configuration valid for DPDK v16.04 and cores
570 # split between NUMA slots as follows:
571 # node 0 cpus: 0 1 2 3 4 5 6 7 8 9
572 # node 1 cpus: 10 11 12 13 14 15 16 17 18 19
574 # VSWITCH_PMD_CPU_MASK = '1010'
575 # VSWITCHD_DPDK_CONFIG = {
576 # 'dpdk-init' : 'true',
577 # 'dpdk-lcore-mask' : '0x4004',
578 # 'pmd-cpu-mask' : 'FF0FF',
579 # 'dpdk-socket-mem' : '1024,1024',
582 "Name": "vhost_numa_awareness",
583 "Deployment": "clean",
584 "Description": "vSwitch DPDK - verify that PMD threads are served "
585 "by the same NUMA slot as QEMU instances",
586 "vSwitch" : "OvsDpdkVhost",
587 "TestSteps": STEP_VSWITCH_PVVP_INIT + # STEP 0-6
589 # check that at least 2 numa slots are available
590 ['tools', 'exec_shell', 'numactl -H', 'available: ([0-9]+)'], # STEP 7
591 ['tools', 'assert', '#STEP[-1][0]>1'], # STEP 8
592 # store last 2 cores from numa slot 0
593 ['tools', 'exec_shell', 'numactl -H', 'node 0 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 9
594 # store last 2 cores from numa slot 1
595 ['tools', 'exec_shell', 'numactl -H', 'node 1 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 10
596 # pin VNF1 to 1st NUMA slot and VNF2 to 2nd NUMA slot
597 ['settings', 'setValue', 'GUEST_CORE_BINDING', # STEP 11
598 [("#STEP[-2][0][0]", "#STEP[-2][0][1]"),
599 ("#STEP[-1][0][0]", "#STEP[-1][0][1]")]
602 ['vnf1', 'start'], # STEP 12
603 ['vnf2', 'start'], # STEP 13
604 # read paths to ovs utilities
605 ['settings', 'getValue', 'TOOLS'], # STEP 14
606 # check that PMD thread serving VNF1 runs at NUMA slot 0
607 ## i.e. get numa slot ID serving dpdhvhostuser0...
608 ['tools', 'exec_shell', "sudo #STEP[-1]['ovs-appctl'] " # STEP 15
609 "dpif-netdev/pmd-rxq-show | "
610 "sed -e '/dpdkvhostuser0/,$d' | tac",
611 'pmd thread numa_id ([0-9])+'
613 ## ...and check that it is NUMA slot 0
614 ['tools', 'assert', '#STEP[-1][0]==0'], # STEP 16
615 # check that PMD thread serving VNF2 runs at NUMA slot 1
616 ## i.e. get numa slot ID serving dpdhvhostuser2...
617 ['tools', 'exec_shell', "sudo #STEP[-3]['ovs-appctl'] " # STEP 17
618 "dpif-netdev/pmd-rxq-show | "
619 "sed -e '/dpdkvhostuser2/,$d' | tac",
620 'pmd thread numa_id ([0-9])+'
622 ## ...and check that it is NUMA slot 1
623 ['tools', 'assert', '#STEP[-1][0]==1'], # STEP 18
625 ['vnf2', 'stop'], # STEP 19
626 ['vnf1', 'stop'], # STEP 20
628 STEP_VSWITCH_PVVP_FINIT # STEP 21...
631 # Testcase to demonstrate 1 port connection between DUT and IXIA traffic
632 # generator. Testcase will enforce IxNet trafficgen and it will configure
633 # both ports to the value of TRAFFICGEN_IXIA_PORT1 to indicate one port
635 # Please note, that it is essential to ensure that TRAFFICGEN_IXIA_PORT1
636 # is physically connected to the first NIC from WHITELIST_NICS list.
637 "Name": "ixnet_pvp_tput_1nic",
638 "Deployment": "clean",
639 "Description": "PVP Scenario with 1 port towards IXIA",
641 "TRAFFICGEN" : "IxNet",
643 "traffic_type" : "rfc2544_throughput",
644 # we are using one port, thus it's already a bidir connection
649 ['vswitch', 'add_switch', 'int_br0'], # STEP 0
650 ['vswitch', 'add_phy_port', 'int_br0'], # STEP 1
651 ['vswitch', 'add_vport', 'int_br0'], # STEP 2
652 ['vswitch', 'add_vport', 'int_br0'], # STEP 3
653 ['vswitch', 'add_flow', 'int_br0',
654 {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'],
655 'idle_timeout': '0'}], # STEP 4
656 ['vswitch', 'add_flow', 'int_br0',
657 {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'],
658 'idle_timeout': '0'}], # STEP 5
659 ['vnf', 'start'], # STEP 6
660 ['settings', 'getValue', 'TRAFFICGEN_IXIA_PORT1'], # STEP 7
661 ['settings', 'setValue', 'TRAFFICGEN_IXIA_PORT2', '#STEP[-1]'],
662 ['trafficgen', 'send_traffic', {}],
663 ['vswitch', 'dump_flows', 'int_br0'],
664 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
665 ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
666 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
667 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
668 ['vswitch', 'del_port', 'int_br0', '#STEP[3][0]'],
669 ['vswitch', 'del_switch', 'int_br0'],
673 # VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
676 "Name": "vswitch_version_vpp",
677 "Deployment": "clean",
678 "Description": "VPP: vSwitch - determine VPP version and fail if it is not possible.",
679 "vSwitch" : "VppDpdkVhost",
681 ['vswitch', 'run_vppctl', ['show', 'version', 'verbose'], '|Version:\s+(v\d+\.\d+)'],
682 ['tools', 'assert', 'len(#STEP[-1][0])'],
686 "Name": "vswitch_vports_add_del_connection_vpp",
687 "Deployment": "clean",
688 "Description": "VPP: vSwitch - configure switch with vports, add and delete connection",
689 "vSwitch" : "VppDpdkVhost",
691 ['vswitch', 'add_switch', 'int_br0'],
692 ['vswitch', 'add_vport', 'int_br0'],
693 ['vswitch', 'add_vport', 'int_br0'],
694 ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]', True],
695 ['vswitch', 'dump_connections', 'int_br0'],
696 ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]', True],
697 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
698 ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
699 ['vswitch', 'del_switch', 'int_br0'],
703 # END of VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
707 # Examples of functional testcases with traffic capture validation
709 # Capture Example 1 - Traffic capture inside VM (PVP scenario)
710 # This TestCase will modify VLAN ID set by the traffic generator to the new value.
711 # Correct VLAN ID settings is verified by inspection of captured frames.
713 "Name": "capture_pvp_modify_vid",
715 "Description": "Test and verify VLAN ID modification by Open vSwitch",
717 "VSWITCH" : "OvsDpdkVhost", # works also for Vanilla OVS
718 "TRAFFICGEN_DURATION" : 5,
720 "traffic_type" : "rfc2544_continuous",
729 "GUEST_LOOPBACK" : ['linux_bridge'],
732 # replace original flows with vlan ID modification
733 ['!vswitch', 'add_flow', 'br0', {'in_port': '1', 'actions': ['mod_vlan_vid:4','output:3']}],
734 ['!vswitch', 'add_flow', 'br0', {'in_port': '2', 'actions': ['mod_vlan_vid:4','output:4']}],
735 ['vswitch', 'dump_flows', 'br0'],
736 # verify that received frames have modified vlan ID
737 ['VNF0', 'execute_and_wait', 'tcpdump -i eth0 -c 5 -w dump.pcap vlan 4 &'],
738 ['trafficgen', 'send_traffic',{}],
739 ['!VNF0', 'execute_and_wait', 'tcpdump -qer dump.pcap vlan 4 2>/dev/null | wc -l','|^(\d+)$'],
740 ['tools', 'assert', '#STEP[-1][0] == 5'],
744 # Capture Example 2 - Setup with 2 NICs, where traffic is captured after it is
745 # processed by NIC under the test (2nd NIC). See documentation for further details.
746 # This TestCase will strip VLAN headers from traffic sent by the traffic generator.
747 # The removal of VLAN headers is verified by inspection of captured frames.
749 # NOTE: This setup expects a DUT with two NICs with two ports each. First NIC is
750 # connected to the traffic generator (standard VSPERF setup). Ports of a second NIC
751 # are interconnected by a patch cable. PCI addresses of all four ports have to be
752 # properly configured in the WHITELIST_NICS parameter.
753 _CAPTURE_P2P2P_OVS_ACTION = ''
754 _CAPTURE_P2P2P_SETUP = [
755 # restore original NICS configuration, so we can refer to NICS elements
756 ['settings', 'resetValue', 'WHITELIST_NICS'],
757 ['settings', 'resetValue', 'NICS'],
758 # create and configure two bridges to forward traffic through NIC under
759 # the test and back to the traffic generator
761 ['vswitch', 'add_switch', 'br0'],
762 ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[0]["device"]'],
763 ['tools', 'exec_shell', 'sudo ip link set dev $NICS[0]["device"] up'],
764 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br0 $NICS[0]["device"]'],
765 ['tools', 'exec_shell', 'sudo $TOOLS["bind-tool"] --bind igb_uio $NICS[3]["pci"]'],
766 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br0 dpdk0 -- '
767 'set Interface dpdk0 type=dpdk options:dpdk-devargs=$NICS[3]["pci"]'],
768 ['tools', 'exec_shell', '$TOOLS["ovs-ofctl"] add-flow br0 in_port=1,action='
769 '$_CAPTURE_P2P2P_OVS_ACTION,output:2'],
771 ['vswitch', 'add_switch', 'br1'],
772 ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[2]["device"]'],
773 ['tools', 'exec_shell', 'sudo ip link set dev $NICS[2]["device"] up'],
774 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br1 $NICS[2]["device"]'],
775 ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[1]["device"]'],
776 ['tools', 'exec_shell', 'sudo ip link set dev $NICS[1]["device"] up'],
777 ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br1 $NICS[1]["device"]'],
778 ['vswitch', 'add_flow', 'br1', {'in_port': '1', 'actions': ['output:2']}],
780 ['vswitch', 'dump_flows', 'br0'],
781 ['vswitch', 'dump_flows', 'br1'],
783 INTEGRATION_TESTS += [
785 "Name": "capture_p2p2p_strip_vlan_ovs",
786 "Deployment": "clean",
787 "Description": "P2P Continuous Stream",
789 "_CAPTURE_P2P2P_OVS_ACTION" : 'strip_vlan',
792 "traffic_type" : "rfc2544_continuous",
795 'srcmac': "ca:fe:00:00:00:00",
796 'dstmac': "00:00:00:00:00:01"
805 # suppress DPDK configuration, so physical interfaces are not bound to DPDK driver
806 'WHITELIST_NICS' : [],
809 "TestSteps": _CAPTURE_P2P2P_SETUP + [
810 # capture traffic after processing by NIC under the test (after possible egress HW offloading)
811 ['tools', 'exec_shell_background', 'tcpdump -i $NICS[2]["device"] -c 5 -w capture.pcap '
812 'ether src $TRAFFIC["l2"]["srcmac"]'],
813 ['trafficgen', 'send_traffic', {}],
814 ['vswitch', 'dump_flows', 'br0'],
815 ['vswitch', 'dump_flows', 'br1'],
816 # there must be 5 captured frames...
817 ['tools', 'exec_shell', 'tcpdump -r capture.pcap | wc -l', '|^(\d+)$'],
818 ['tools', 'assert', '#STEP[-1][0] == 5'],
819 # ...but no vlan headers
820 ['tools', 'exec_shell', 'tcpdump -r capture.pcap vlan | wc -l', '|^(\d+)$'],
821 ['tools', 'assert', '#STEP[-1][0] == 0'],
824 # Capture Example 3 - Traffic capture by traffic generator.
825 # This TestCase uses OVS flow to add VLAN tag with given ID into every
826 # frame send by traffic generator. Correct frame modificaiton is verified by
827 # inspection of packet capture received by T-Rex.
829 "Name": "capture_p2p_add_vlan_ovs_trex",
830 "Deployment": "clean",
831 "Description": "OVS: Test VLAN tag modification and verify it by traffic capture",
832 "vSwitch" : "OvsDpdkVhost", # works also for Vanilla OVS
834 "TRAFFICGEN" : "Trex",
835 "TRAFFICGEN_TREX_LEARNING_MODE" : True,
837 "traffic_type" : "burst",
840 # enable capture of five RX frames
849 "TestSteps" : STEP_VSWITCH_P2P_INIT + [
850 # replace standard L2 flows by flows, which will add VLAN tag with ID 3
851 ['!vswitch', 'add_flow', 'int_br0', {'in_port': '1', 'actions': ['mod_vlan_vid:3','output:2']}],
852 ['!vswitch', 'add_flow', 'int_br0', {'in_port': '2', 'actions': ['mod_vlan_vid:3','output:1']}],
853 ['vswitch', 'dump_flows', 'int_br0'],
854 ['trafficgen', 'send_traffic', {}],
855 ['trafficgen', 'get_results'],
856 # verify that captured frames have vlan tag with ID 3
857 ['tools', 'exec_shell', 'tcpdump -qer $RESULTS_PATH/#STEP[-1][0]["capture_rx"] vlan 3 '
858 '2>/dev/null | wc -l', '|^(\d+)$'],
859 # number of received frames with expected VLAN id must match the number of captured frames
860 ['tools', 'assert', '#STEP[-1][0] == 5'],
861 ] + STEP_VSWITCH_P2P_FINIT,
864 # End of examples of functional testcases with traffic capture validation
868 # Example of TC definition with exact vSwitch, VNF and TRAFFICGEN values.
870 # "Name": "ovs_vanilla_linux_bridge_pvp_cont",
871 # "Deployment": "clean",
872 # "Description": "vSwitch - configure OVS Vanilla, QemuVirtioNet with linux bridge and execute continuous stream test",
873 # "vSwitch" : "OvsVanilla",
874 # "VNF" : "QemuVirtioNet",
875 # "Trafficgen": "IxNet",
876 # "Parameters": {"GUEST_LOOPBACK" : ["linux_bridge"],},
877 # "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
880 # ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
883 # STEP_VSWITCH_PVP_FLOWS_FINIT