945b36f7b704c9abaa4a161117782478f0b8e1d2
[vswitchperf.git] / conf / integration / 01_testcases.conf
1 # Copyright 2015-2018 Intel Corporation, Tieto and others.
2 #
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
6 #
7 #   http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14
15 #
16 # Generic test configuration options are described at conf/01_testcases.conf
17 #
18
19 #
20 # Options specific to integration testcases are described below:
21 #
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.
25 #                                   # Values:
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".
30 #
31 # bidirectional testing for OP2P is not yet supported.
32 # TRAFFIC['bidir'] must be set to 'False'.
33
34 #
35 # Common TestSteps parts ("macros")
36 #
37
38 # P2P 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
43 ]
44
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'],
49 ]
50
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'}],
54 ]
55
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
61
62 # PVP and PVVP macros
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
66 ]
67
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
72
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'}],
78 ]
79
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
87
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
91 ]
92
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
97
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'}],
105 ]
106
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
116
117 #
118 # Definition of integration tests
119 #
120 INTEGRATION_TESTS = [
121     {
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."),
129         "Parameters": {
130             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
131             "TRAFFIC" : {
132                 "traffic_type" : "rfc2544_throughput",
133                 "bidir" : "False",
134             },
135         },
136     },
137     {
138         "Name": "overlay_p2p_tput",
139         "Deployment": "op2p",
140         "Tunnel Operation": "encapsulation",
141         "Description": "Overlay Encapsulation Throughput RFC2544 Test",
142         "Parameters": {
143             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
144             "TRAFFIC" : {
145                 "traffic_type" : "rfc2544_throughput",
146                 "bidir" : "False",
147             },
148         },
149     },
150     {
151         "Name": "overlay_p2p_cont",
152         "Deployment": "op2p",
153         "Tunnel Operation": "encapsulation",
154         "Description": "Overlay Encapsulation RFC2544 Continuous Stream",
155         "Parameters": {
156             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
157             "TRAFFIC" : {
158                 "traffic_type" : "rfc2544_continuous",
159                 "bidir" : "False",
160             },
161         },
162     },
163     {
164         "Name": "overlay_p2p_decap_tput",
165         "Deployment": "op2p",
166         "Tunnel Operation": "decapsulation",
167         "Description": "Overlay Decapsulation Throughput RFC2544 Test",
168         "Parameters": {
169             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
170             "TRAFFIC" : {
171                 "traffic_type" : "rfc2544_throughput",
172                 "bidir" : "False",
173             },
174         },
175     },
176     {
177         "Name": "overlay_p2p_decap_cont",
178         "Deployment": "op2p",
179         "Tunnel Operation": "decapsulation",
180         "Description": "Overlay Decapsulation RFC2544 Continuous Stream",
181         "Parameters": {
182             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
183             "TRAFFIC" : {
184                 "traffic_type" : "rfc2544_continuous",
185                 "bidir" : "False",
186             },
187         },
188     },
189     {
190         "Name": "vswitch_add_del_bridge",
191         "Deployment": "clean",
192         "Description": "vSwitch - add and delete bridge",
193         "TestSteps": [
194                         ['vswitch', 'add_switch', 'int_br0'],
195                         ['vswitch', 'del_switch', 'int_br0'],
196                      ]
197     },
198     {
199         "Name": "vswitch_add_del_bridges",
200         "Deployment": "clean",
201         "Description": "vSwitch - add and delete bridges",
202         "TestSteps": [
203                         ['vswitch', 'add_switch', 'int_br0'],
204                         ['vswitch', 'add_switch', 'int_br1'],
205                         ['vswitch', 'del_switch', 'int_br0'],
206                         ['vswitch', 'del_switch', 'int_br1'],
207                      ]
208     },
209     {
210         "Name": "vswitch_add_del_phy_port",
211         "Deployment": "clean",
212         "Description": "vSwitch - add and delete physical port",
213         "TestSteps": [
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'],
218                      ]
219     },
220     {
221         "Name": "vswitch_add_del_phy_ports",
222         "Deployment": "clean",
223         "Description": "vSwitch - add and delete physical ports",
224         "TestSteps": [
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'],
231                      ]
232     },
233     {
234         "Name": "vswitch_add_del_vport",
235         "Deployment": "clean",
236         "Description": "vSwitch - add and delete virtual port",
237         "TestSteps": [
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'],
242                      ]
243     },
244     {
245         "Name": "vswitch_add_del_vports",
246         "Deployment": "clean",
247         "Description": "vSwitch - add and delete virtual ports",
248         "TestSteps": [
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'],
255                      ]
256     },
257     {
258         "Name": "vswitch_add_del_flow",
259         "Deployment": "clean",
260         "Description": "vSwitch - add and delete flow",
261         "TestSteps": [
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'],
270                      ]
271     },
272     {
273         "Name": "vswitch_vports_add_del_flow",
274         "Deployment": "clean",
275         "Description": "vSwitch - configure switch with vports, add and delete flow",
276         "TestSteps": [
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'],
285                      ]
286     },
287     {
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
293     },
294     {
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 +
299                      [
300                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
301                      ] +
302                      STEP_VSWITCH_P2P_FLOWS_FINIT
303     },
304     {
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 +
309                      [
310                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
311                      ] +
312                      STEP_VSWITCH_P2P_FLOWS_FINIT
313     },
314     {
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 +
319                      [
320                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
321                      ] +
322                      STEP_VSWITCH_P2P_FLOWS_FINIT
323     },
324     {
325         "Name": "vswitch_pvp",
326         "Deployment": "clean",
327         "Description": "vSwitch - configure switch and one vnf",
328         "TestSteps": STEP_VSWITCH_PVP_INIT +
329                      [
330                         ['vnf', 'start'],
331                         ['vnf', 'stop'],
332                      ] +
333                      STEP_VSWITCH_PVP_FINIT
334     },
335     {
336         "Name": "vswitch_vports_pvp",
337         "Deployment": "clean",
338         "Description": "vSwitch - configure switch with vports and one vnf",
339         "TestSteps": [
340                         ['vswitch', 'add_switch', 'int_br0'],
341                         ['vswitch', 'add_vport', 'int_br0'],
342                         ['vswitch', 'add_vport', 'int_br0'],
343                         ['vnf', 'start'],
344                         ['vnf', 'stop'],
345                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
346                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
347                         ['vswitch', 'del_switch', 'int_br0'],
348                      ]
349     },
350     {
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 +
355                      [
356                         ['vnf', 'start'],
357                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
358                         ['vnf', 'stop'],
359                      ] +
360                      STEP_VSWITCH_PVP_FLOWS_FINIT
361     },
362     {
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 +
367                      [
368                         ['vnf', 'start'],
369                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
370                         ['vnf', 'stop'],
371                      ] +
372                      STEP_VSWITCH_PVP_FLOWS_FINIT
373     },
374     {
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 +
379                      [
380                         ['vnf', 'start'],
381                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
382                         ['vnf', 'stop'],
383                      ] +
384                      STEP_VSWITCH_PVP_FLOWS_FINIT
385     },
386     {
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 +
391                      [
392                         ['vnf', 'start'],
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'}],
396                         ['vnf', 'stop'],
397                      ] +
398                      STEP_VSWITCH_PVP_FLOWS_FINIT
399     },
400     {
401         "Name": "vswitch_pvvp",
402         "Deployment": "clean",
403         "Description": "vSwitch - configure switch and two vnfs",
404         "TestSteps": STEP_VSWITCH_PVVP_INIT +
405                      [
406                         ['vnf1', 'start'],
407                         ['vnf2', 'start'],
408                         ['vnf1', 'stop'],
409                         ['vnf2', 'stop'],
410                      ] +
411                      STEP_VSWITCH_PVVP_FINIT
412     },
413     {
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 +
418                      [
419                         ['vnf1', 'start'],
420                         ['vnf2', 'start'],
421                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
422                         ['vnf1', 'stop'],
423                         ['vnf2', 'stop'],
424                      ] +
425                      STEP_VSWITCH_PVVP_FLOWS_FINIT
426     },
427     {
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 +
432                      [
433                         ['vnf1', 'start'],
434                         ['vnf2', 'start'],
435                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
436                         ['vnf1', 'stop'],
437                         ['vnf2', 'stop'],
438                      ] +
439                      STEP_VSWITCH_PVVP_FLOWS_FINIT
440     },
441     {
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 +
446                      [
447                         ['vnf1', 'start'],
448                         ['vnf2', 'start'],
449                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
450                         ['vnf1', 'stop'],
451                         ['vnf2', 'stop'],
452                      ] +
453                      STEP_VSWITCH_PVVP_FLOWS_FINIT
454     },
455     {
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 +
460                      [
461                         ['vnf1', 'start'],
462                         ['vnf2', 'start'],
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'}],
466                         ['vnf1', 'stop'],
467                         ['vnf2', 'stop'],
468                      ] +
469                      STEP_VSWITCH_PVVP_FLOWS_FINIT
470     },
471     {
472         "Name": "vswitch_p4vp_tput",
473         "Description": "4 chained vnfs, execute RFC2544 throughput test, deployment pvvp4",
474         "Deployment": "pvvp4",
475         "Parameters" : {
476             "TRAFFIC" : {
477                 "traffic_type" : "rfc2544_throughput",
478             },
479         },
480     },
481     {
482         "Name": "vswitch_p4vp_back2back",
483         "Description": "4 chained vnfs, execute RFC2544 back2back test, deployment pvvp4",
484         "Deployment": "pvvp4",
485         "Parameters" : {
486             "TRAFFIC" : {
487                 "traffic_type" : "rfc2544_back2back",
488             },
489         },
490     },
491     {
492         "Name": "vswitch_p4vp_cont",
493         "Description": "4 chained vnfs, execute RFC2544 continuous stream test, deployment pvvp4",
494         "Deployment": "pvvp4",
495         "Parameters" : {
496             "TRAFFIC" : {
497                 "traffic_type" : "rfc2544_continuous",
498             },
499         },
500     },
501     {
502         "Name": "vswitch_p4vp_all",
503         "Description": "4 chained vnfs, execute RFC2544 throughput tests, deployment pvvp4",
504         "Deployment": "pvvp4",
505         "TestSteps":
506         [
507             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput'}],
508             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back'}],
509             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous'}],
510         ]
511     },
512     {
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",
521         "Parameters" : {
522             "TRAFFIC" : {
523                 "traffic_type" : "rfc2544_continuous",
524             },
525         },
526     },
527     {
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",
536         "Parameters" : {
537             "TRAFFIC" : {
538                 "traffic_type" : "rfc2544_continuous",
539             },
540         },
541     },
542     {
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",
551         "Parameters" : {
552             "TRAFFIC" : {
553                 "traffic_type" : "rfc2544_continuous",
554             },
555         },
556     },
557     {
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.
563         #
564         # Prerequisites:
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
568         #
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
573         #
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',
580         #     }
581         #
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
588             [
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]")]
600                 ],
601                 # start 2 VNFs
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])+'
612                 ],
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])+'
621                 ],
622                 ## ...and check that it is NUMA slot 1
623                 ['tools', 'assert', '#STEP[-1][0]==1'],                             # STEP 18
624                 # clean up
625                 ['vnf2', 'stop'],                                                   # STEP 19
626                 ['vnf1', 'stop'],                                                   # STEP 20
627             ] +
628             STEP_VSWITCH_PVVP_FINIT                                                 # STEP 21...
629     },
630     {
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
634         # connection.
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",
640         "Parameters" : {
641             "TRAFFICGEN" : "IxNet",
642             "TRAFFIC" : {
643                 "traffic_type" : "rfc2544_throughput",
644                 # we are using one port, thus it's already a bidir connection
645                 "bidir" : "False",
646             },
647         },
648         "TestSteps": [
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'],
670         ]
671     },
672     #
673     # VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
674     #
675     {
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",
680         "TestSteps": [
681                         ['vswitch', 'run_vppctl', ['show', 'version', 'verbose'], '|Version:\s+(v\d+\.\d+)'],
682                         ['tools', 'assert', 'len(#STEP[-1][0])'],
683                      ]
684     },
685     {
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",
690         "TestSteps": [
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'],
700                      ]
701     },
702     #
703     # END of VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
704     #
705
706     #
707     # Examples of functional testcases with traffic capture validation
708     #
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.
712     {
713         "Name": "capture_pvp_modify_vid",
714         "Deployment": "pvp",
715         "Description": "Test and verify VLAN ID modification by Open vSwitch",
716         "Parameters" : {
717             "VSWITCH" : "OvsDpdkVhost", # works also for Vanilla OVS
718             "TRAFFICGEN_DURATION" : 5,
719             "TRAFFIC" : {
720                 "traffic_type" : "rfc2544_continuous",
721                 "frame_rate" : 100,
722                 'vlan': {
723                     'enabled': True,
724                     'id': 8,
725                     'priority': 1,
726                     'cfi': 0,
727                 },
728             },
729             "GUEST_LOOPBACK" : ['linux_bridge'],
730         },
731         "TestSteps": [
732             # replace original flows with vlan ID modification
733             ['!vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '1', 'actions': ['mod_vlan_vid:4','output:3']}],
734             ['!vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '2', 'actions': ['mod_vlan_vid:4','output:4']}],
735             ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'],
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'],
741         ],
742     },
743 ]
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.
748 #
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
760         # 1st bridge:
761         ['vswitch', 'add_switch', '$VSWITCH_BRIDGE_NAME'],
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 $VSWITCH_BRIDGE_NAME $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 $VSWITCH_BRIDGE_NAME dpdk0 -- '
767                                 'set Interface dpdk0 type=dpdk options:dpdk-devargs=$NICS[3]["pci"]'],
768         ['tools', 'exec_shell', '$TOOLS["ovs-ofctl"] add-flow $VSWITCH_BRIDGE_NAME in_port=1,action='
769                                 '$_CAPTURE_P2P2P_OVS_ACTION,output:2'],
770         # 2nd bridge:
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']}],
779         # log flow details
780         ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'],
781         ['vswitch', 'dump_flows', 'br1'],
782 ]
783 INTEGRATION_TESTS += [
784     {
785         "Name": "capture_p2p2p_strip_vlan_ovs",
786         "Deployment": "clean",
787         "Description": "P2P Continuous Stream",
788         "Parameters" : {
789             "_CAPTURE_P2P2P_OVS_ACTION" : 'strip_vlan',
790             "TRAFFIC" : {
791                 "bidir" : "False",
792                 "traffic_type" : "rfc2544_continuous",
793                 "frame_rate" : 100,
794                 'l2': {
795                     'srcmac': "ca:fe:00:00:00:00",
796                     'dstmac': "00:00:00:00:00:01"
797                 },
798                 'vlan': {
799                     'enabled': True,
800                     'id': 8,
801                     'priority': 1,
802                     'cfi': 0,
803                 },
804             },
805             # suppress DPDK configuration, so physical interfaces are not bound to DPDK driver
806             'WHITELIST_NICS' : [],
807             'NICS' : [],
808         },
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', '$VSWITCH_BRIDGE_NAME'],
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'],
822         ],
823     },
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.
828     {
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
833         "Parameters" : {
834             "TRAFFICGEN" : "Trex",
835             "TRAFFICGEN_TREX_LEARNING_MODE" : True,
836             "TRAFFIC" : {
837                 "traffic_type" : "burst",
838                 "frame_rate" : 100,
839                 "burst_size" : 5,
840                 # enable capture of five RX frames
841                 'capture': {
842                     'enabled': True,
843                     'tx_ports' : [],
844                     'rx_ports' : [1],
845                     'count' : 5,
846                 },
847             },
848         },
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,
862     },
863     #
864     # End of examples of functional testcases with traffic capture validation
865     #
866 ]
867
868 # Example of TC definition with exact vSwitch, VNF and TRAFFICGEN values.
869 #    {
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 +
878 #                     [
879 #                        ['vnf', 'start'],
880 #                        ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
881 #                        ['vnf', 'stop'],
882 #                     ] +
883 #                     STEP_VSWITCH_PVP_FLOWS_FINIT
884 #    },