Merge "Xena_Flow_Fix: Fixes multistream of greater than 64k values"
[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 #
39 # P2P macros
40 #
41 STEP_VSWITCH_P2P_INIT = [
42     ['vswitch', 'add_switch', 'int_br0'],           # STEP 0
43     ['vswitch', 'add_phy_port', 'int_br0'],         # STEP 1
44     ['vswitch', 'add_phy_port', 'int_br0'],         # STEP 2
45 ]
46
47 STEP_VSWITCH_P2P_FINIT = [
48     ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
49     ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
50     ['vswitch', 'del_switch', 'int_br0'],
51 ]
52
53 STEP_VSWITCH_P2P_CONNECTIONS_INIT = STEP_VSWITCH_P2P_INIT + [
54     ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]'],
55     ['vswitch', 'add_connection', 'int_br0', '#STEP[2][0]', '#STEP[1][0]'],
56 ]
57
58 STEP_VSWITCH_P2P_CONNECTIONS_FINIT = [
59     ['vswitch', 'dump_connections', 'int_br0'],
60     ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]'],
61     ['vswitch', 'del_connection', 'int_br0', '#STEP[2][0]', '#STEP[1][0]'],
62 ] + STEP_VSWITCH_P2P_FINIT
63
64 # P2P OVS specific macros
65 STEP_VSWITCH_P2P_FLOWS_INIT = STEP_VSWITCH_P2P_INIT + [
66     ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
67     ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
68 ]
69
70 STEP_VSWITCH_P2P_FLOWS_FINIT = [
71     ['vswitch', 'dump_flows', 'int_br0'],
72     ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
73     ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[2][1]'}],
74 ] + STEP_VSWITCH_P2P_FINIT
75
76 #
77 # PVP macros
78 #
79 STEP_VSWITCH_PVP_INIT = STEP_VSWITCH_P2P_INIT + [
80     ['vswitch', 'add_vport', 'int_br0'],            # STEP 3    vm1 ports
81     ['vswitch', 'add_vport', 'int_br0'],            # STEP 4
82 ]
83
84 STEP_VSWITCH_PVP_FINIT = [
85     ['vswitch', 'del_port', 'int_br0', '#STEP[3][0]'],  # vm1 ports
86     ['vswitch', 'del_port', 'int_br0', '#STEP[4][0]'],
87 ] + STEP_VSWITCH_P2P_FINIT
88
89 STEP_VSWITCH_PVP_CONNECTIONS_INIT = STEP_VSWITCH_PVP_INIT + [
90     ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[3][0]'],
91     ['vswitch', 'add_connection', 'int_br0', '#STEP[4][0]', '#STEP[2][0]'],
92     ['vswitch', 'add_connection', 'int_br0', '#STEP[2][0]', '#STEP[4][0]'],
93     ['vswitch', 'add_connection', 'int_br0', '#STEP[3][0]', '#STEP[1][0]'],
94 ]
95
96 STEP_VSWITCH_PVP_CONNECTIONS_FINIT = [
97     ['vswitch', 'dump_connections', 'int_br0'],
98     ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[3][0]'],
99     ['vswitch', 'del_connection', 'int_br0', '#STEP[4][0]', '#STEP[2][0]'],
100     ['vswitch', 'del_connection', 'int_br0', '#STEP[2][0]', '#STEP[4][0]'],
101     ['vswitch', 'del_connection', 'int_br0', '#STEP[3][0]', '#STEP[1][0]'],
102 ] + STEP_VSWITCH_PVP_FINIT
103
104 # PVP OVS specific macros
105 STEP_VSWITCH_PVP_FLOWS_INIT = STEP_VSWITCH_PVP_INIT + [
106     ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
107     ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
108     ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
109     ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
110 ]
111
112 STEP_VSWITCH_PVP_FLOWS_FINIT = [
113     ['vswitch', 'dump_flows', 'int_br0'],
114     ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
115     ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[4][1]'}],
116     ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[2][1]'}],
117     ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
118 ] + STEP_VSWITCH_PVP_FINIT
119
120 #
121 # PVVP macros
122 #
123 STEP_VSWITCH_PVVP_INIT = STEP_VSWITCH_PVP_INIT + [
124     ['vswitch', 'add_vport', 'int_br0'],            # STEP 5    vm2 ports
125     ['vswitch', 'add_vport', 'int_br0'],            # STEP 6
126 ]
127
128 STEP_VSWITCH_PVVP_FINIT = [
129     ['vswitch', 'del_port', 'int_br0', '#STEP[5][0]'],  # vm2 ports
130     ['vswitch', 'del_port', 'int_br0', '#STEP[6][0]'],
131 ] + STEP_VSWITCH_PVP_FINIT
132
133 STEP_VSWITCH_PVVP_CONNECTIONS_INIT = STEP_VSWITCH_PVVP_INIT + [
134     ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[3][0]'],
135     ['vswitch', 'add_connection', 'int_br0', '#STEP[4][0]', '#STEP[5][0]'],
136     ['vswitch', 'add_connection', 'int_br0', '#STEP[6][0]', '#STEP[2][0]'],
137     ['vswitch', 'add_connection', 'int_br0', '#STEP[2][0]', '#STEP[6][0]'],
138     ['vswitch', 'add_connection', 'int_br0', '#STEP[5][0]', '#STEP[4][0]'],
139     ['vswitch', 'add_connection', 'int_br0', '#STEP[3][0]', '#STEP[1][0]'],
140 ]
141
142 STEP_VSWITCH_PVVP_CONNECTIONS_FINIT = [
143     ['vswitch', 'dump_connections', 'int_br0'],
144     ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[3][0]'],
145     ['vswitch', 'del_connection', 'int_br0', '#STEP[4][0]', '#STEP[5][0]'],
146     ['vswitch', 'del_connection', 'int_br0', '#STEP[6][0]', '#STEP[2][0]'],
147     ['vswitch', 'del_connection', 'int_br0', '#STEP[2][0]', '#STEP[6][0]'],
148     ['vswitch', 'del_connection', 'int_br0', '#STEP[5][0]', '#STEP[4][0]'],
149     ['vswitch', 'del_connection', 'int_br0', '#STEP[3][0]', '#STEP[1][0]'],
150 ] + STEP_VSWITCH_PVVP_FINIT
151
152 # PVVP OVS specific macros
153 STEP_VSWITCH_PVVP_FLOWS_INIT = STEP_VSWITCH_PVVP_INIT + [
154     ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
155     ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
156     ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
157     ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
158     ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[5][1]', 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
159     ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
160 ]
161
162 STEP_VSWITCH_PVVP_FLOWS_FINIT = [
163     ['vswitch', 'dump_flows', 'int_br0'],
164     ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
165     ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[4][1]'}],
166     ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[6][1]'}],
167     ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[2][1]'}],
168     ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[5][1]'}],
169     ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
170 ] + STEP_VSWITCH_PVVP_FINIT
171
172 #
173 # Definition of integration tests
174 #
175 INTEGRATION_TESTS = [
176     {
177         "Name": "overlay_p2p_mod_tput",
178         "Deployment": "ptunp",
179         "Tunnel Type": "vxlan",
180         "Description": ("Tunneling Throughput RFC2544 Test."
181                        "The encap and decap are performed inside the "
182                        "virtual switch itself in each direction to avoid "
183                        "the need of ingress overlay traffic."),
184         "Parameters": {
185             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
186             "TRAFFIC" : {
187                 "traffic_type" : "rfc2544_throughput",
188                 "bidir" : "False",
189             },
190         },
191     },
192     {
193         "Name": "overlay_p2p_tput",
194         "Deployment": "op2p",
195         "Tunnel Operation": "encapsulation",
196         "Description": "Overlay Encapsulation Throughput RFC2544 Test",
197         "Parameters": {
198             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
199             "TRAFFIC" : {
200                 "traffic_type" : "rfc2544_throughput",
201                 "bidir" : "False",
202             },
203         },
204     },
205     {
206         "Name": "overlay_p2p_cont",
207         "Deployment": "op2p",
208         "Tunnel Operation": "encapsulation",
209         "Description": "Overlay Encapsulation RFC2544 Continuous Stream",
210         "Parameters": {
211             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
212             "TRAFFIC" : {
213                 "traffic_type" : "rfc2544_continuous",
214                 "bidir" : "False",
215             },
216         },
217     },
218     {
219         "Name": "overlay_p2p_decap_tput",
220         "Deployment": "op2p",
221         "Tunnel Operation": "decapsulation",
222         "Description": "Overlay Decapsulation Throughput RFC2544 Test",
223         "Parameters": {
224             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
225             "TRAFFIC" : {
226                 "traffic_type" : "rfc2544_throughput",
227                 "bidir" : "False",
228             },
229         },
230     },
231     {
232         "Name": "overlay_p2p_decap_cont",
233         "Deployment": "op2p",
234         "Tunnel Operation": "decapsulation",
235         "Description": "Overlay Decapsulation RFC2544 Continuous Stream",
236         "Parameters": {
237             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
238             "TRAFFIC" : {
239                 "traffic_type" : "rfc2544_continuous",
240                 "bidir" : "False",
241             },
242         },
243     },
244     {
245         "Name": "vswitch_add_del_bridge",
246         "Deployment": "clean",
247         "Description": "vSwitch - add and delete bridge",
248         "TestSteps": [
249                         ['vswitch', 'add_switch', 'int_br0'],
250                         ['vswitch', 'del_switch', 'int_br0'],
251                      ]
252     },
253     {
254         "Name": "vswitch_add_del_bridges",
255         "Deployment": "clean",
256         "Description": "vSwitch - add and delete bridges",
257         "TestSteps": [
258                         ['vswitch', 'add_switch', 'int_br0'],
259                         ['vswitch', 'add_switch', 'int_br1'],
260                         ['vswitch', 'del_switch', 'int_br0'],
261                         ['vswitch', 'del_switch', 'int_br1'],
262                      ]
263     },
264     {
265         "Name": "vswitch_add_del_phy_port",
266         "Deployment": "clean",
267         "Description": "vSwitch - add and delete physical port",
268         "TestSteps": [
269                         ['vswitch', 'add_switch', 'int_br0'],
270                         ['vswitch', 'add_phy_port', 'int_br0'],
271                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
272                         ['vswitch', 'del_switch', 'int_br0'],
273                      ]
274     },
275     {
276         "Name": "vswitch_add_del_phy_ports",
277         "Deployment": "clean",
278         "Description": "vSwitch - add and delete physical ports",
279         "TestSteps": [
280                         ['vswitch', 'add_switch', 'int_br0'],
281                         ['vswitch', 'add_phy_port', 'int_br0'],
282                         ['vswitch', 'add_phy_port', 'int_br0'],
283                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
284                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
285                         ['vswitch', 'del_switch', 'int_br0'],
286                      ]
287     },
288     {
289         "Name": "vswitch_add_del_vport",
290         "Deployment": "clean",
291         "Description": "vSwitch - add and delete virtual port",
292         "TestSteps": [
293                         ['vswitch', 'add_switch', 'int_br0'],
294                         ['vswitch', 'add_vport', 'int_br0'],
295                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
296                         ['vswitch', 'del_switch', 'int_br0'],
297                      ]
298     },
299     {
300         "Name": "vswitch_add_del_vports",
301         "Deployment": "clean",
302         "Description": "vSwitch - add and delete virtual ports",
303         "TestSteps": [
304                         ['vswitch', 'add_switch', 'int_br0'],
305                         ['vswitch', 'add_vport', 'int_br0'],
306                         ['vswitch', 'add_vport', 'int_br0'],
307                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
308                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
309                         ['vswitch', 'del_switch', 'int_br0'],
310                      ]
311     },
312     {
313         "Name": "vswitch_add_del_connection",
314         "Deployment": "clean",
315         "Description": "vSwitch - add and delete connection",
316         "TestSteps": [
317                         ['vswitch', 'add_switch', 'int_br0'],
318                         ['vswitch', 'add_phy_port', 'int_br0'],
319                         ['vswitch', 'add_phy_port', 'int_br0'],
320                         ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]'],
321                         ['vswitch', 'dump_connections', 'int_br0'],
322                         ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]'],
323                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
324                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
325                         ['vswitch', 'del_switch', 'int_br0'],
326                      ]
327     },
328     {
329         "Name": "vswitch_vports_add_del_connection",
330         "Deployment": "clean",
331         "Description": "vSwitch - add and delete connection",
332         "Description": "vSwitch - configure switch with vports, add and delete connection",
333         "TestSteps": [
334                         ['vswitch', 'add_switch', 'int_br0'],
335                         ['vswitch', 'add_vport', 'int_br0'],
336                         ['vswitch', 'add_vport', 'int_br0'],
337                         ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]'],
338                         ['vswitch', 'dump_connections', 'int_br0'],
339                         ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]'],
340                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
341                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
342                         ['vswitch', 'del_switch', 'int_br0'],
343                      ]
344     },
345     {
346         "Name": "vswitch_add_del_connections",
347         "Deployment": "clean",
348         "Description": "vSwitch - add and delete connections",
349         "TestSteps": STEP_VSWITCH_P2P_CONNECTIONS_INIT +
350                      STEP_VSWITCH_P2P_CONNECTIONS_FINIT
351     },
352     {
353         "Name": "vswitch_add_del_flow",
354         "Deployment": "clean",
355         "Description": "OVS: vSwitch - add and delete flow",
356         "TestSteps": [
357                         ['vswitch', 'add_switch', 'int_br0'],
358                         ['vswitch', 'add_phy_port', 'int_br0'],
359                         ['vswitch', 'add_phy_port', 'int_br0'],
360                         ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
361                         ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
362                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
363                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
364                         ['vswitch', 'del_switch', 'int_br0'],
365                      ]
366     },
367     {
368         "Name": "vswitch_vports_add_del_flow",
369         "Deployment": "clean",
370         "Description": "OVS: vSwitch - configure switch with vports, add and delete flow",
371         "TestSteps": [
372                         ['vswitch', 'add_switch', 'int_br0'],
373                         ['vswitch', 'add_vport', 'int_br0'],
374                         ['vswitch', 'add_vport', 'int_br0'],
375                         ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
376                         ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
377                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
378                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
379                         ['vswitch', 'del_switch', 'int_br0'],
380                      ]
381     },
382     {
383         "Name": "vswitch_add_del_flows",
384         "Deployment": "clean",
385         "Description": "OVS: vSwitch - add and delete flows",
386         "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
387                      STEP_VSWITCH_P2P_FLOWS_FINIT
388     },
389     {
390         "Name": "vswitch_p2p_tput",
391         "Deployment": "clean",
392         "Description": "vSwitch - configure switch and execute RFC2544 throughput test",
393         "TestSteps": STEP_VSWITCH_P2P_CONNECTIONS_INIT +
394                      [
395                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
396                      ] +
397                      STEP_VSWITCH_P2P_CONNECTIONS_FINIT
398     },
399     {
400         "Name": "vswitch_p2p_back2back",
401         "Deployment": "clean",
402         "Description": "vSwitch - configure switch and execute RFC2544 back2back test",
403         "TestSteps": STEP_VSWITCH_P2P_CONNECTIONS_INIT +
404                      [
405                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
406                      ] +
407                      STEP_VSWITCH_P2P_CONNECTIONS_FINIT
408     },
409     {
410         "Name": "vswitch_p2p_cont",
411         "Deployment": "clean",
412         "Description": "vSwitch - configure switch and execute RFC2544 continuous stream test",
413         "TestSteps": STEP_VSWITCH_P2P_CONNECTIONS_INIT +
414                      [
415                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
416                      ] +
417                      STEP_VSWITCH_P2P_CONNECTIONS_FINIT
418     },
419     {
420         "Name": "vswitch_pvp",
421         "Deployment": "clean",
422         "Description": "vSwitch - configure switch and one vnf",
423         "TestSteps": STEP_VSWITCH_PVP_INIT +
424                      [
425                         ['vnf', 'start'],
426                         ['vnf', 'stop'],
427                      ] +
428                      STEP_VSWITCH_PVP_FINIT
429     },
430     {
431         "Name": "vswitch_vports_pvp",
432         "Deployment": "clean",
433         "Description": "vSwitch - configure switch with vports and one vnf",
434         "TestSteps": [
435                         ['vswitch', 'add_switch', 'int_br0'],
436                         ['vswitch', 'add_vport', 'int_br0'],
437                         ['vswitch', 'add_vport', 'int_br0'],
438                         ['vnf', 'start'],
439                         ['vnf', 'stop'],
440                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
441                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
442                         ['vswitch', 'del_switch', 'int_br0'],
443                      ]
444     },
445     {
446         "Name": "vswitch_pvp_tput",
447         "Deployment": "clean",
448         "Description": "vSwitch - configure switch, vnf and execute RFC2544 throughput test",
449         "TestSteps": STEP_VSWITCH_PVP_CONNECTIONS_INIT +
450                      [
451                         ['vnf', 'start'],
452                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
453                         ['vnf', 'stop'],
454                      ] +
455                      STEP_VSWITCH_PVP_CONNECTIONS_FINIT
456     },
457     {
458         "Name": "vswitch_pvp_back2back",
459         "Deployment": "clean",
460         "Description": "vSwitch - configure switch, vnf and execute RFC2544 back2back test",
461         "TestSteps": STEP_VSWITCH_PVP_CONNECTIONS_INIT +
462                      [
463                         ['vnf', 'start'],
464                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
465                         ['vnf', 'stop'],
466                      ] +
467                      STEP_VSWITCH_PVP_CONNECTIONS_FINIT
468     },
469     {
470         "Name": "vswitch_pvp_cont",
471         "Deployment": "clean",
472         "Description": "vSwitch - configure switch, vnf and execute RFC2544 continuous stream test",
473         "TestSteps": STEP_VSWITCH_PVP_CONNECTIONS_INIT +
474                      [
475                         ['vnf', 'start'],
476                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
477                         ['vnf', 'stop'],
478                      ] +
479                      STEP_VSWITCH_PVP_CONNECTIONS_FINIT
480     },
481     {
482         "Name": "vswitch_pvp_all",
483         "Deployment": "clean",
484         "Description": "vSwitch - configure switch, vnf and execute all test types",
485         "TestSteps": STEP_VSWITCH_PVP_CONNECTIONS_INIT +
486                      [
487                         ['vnf', 'start'],
488                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
489                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
490                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
491                         ['vnf', 'stop'],
492                      ] +
493                      STEP_VSWITCH_PVP_CONNECTIONS_FINIT
494     },
495     {
496         "Name": "vswitch_pvvp",
497         "Deployment": "clean",
498         "Description": "vSwitch - configure switch and two vnfs",
499         "TestSteps": STEP_VSWITCH_PVVP_INIT +
500                      [
501                         ['vnf1', 'start'],
502                         ['vnf2', 'start'],
503                         ['vnf1', 'stop'],
504                         ['vnf2', 'stop'],
505                      ] +
506                      STEP_VSWITCH_PVVP_FINIT
507     },
508     {
509         "Name": "vswitch_pvvp_tput",
510         "Deployment": "clean",
511         "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 throughput test",
512         "TestSteps": STEP_VSWITCH_PVVP_CONNECTIONS_INIT +
513                      [
514                         ['vnf1', 'start'],
515                         ['vnf2', 'start'],
516                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
517                         ['vnf1', 'stop'],
518                         ['vnf2', 'stop'],
519                      ] +
520                      STEP_VSWITCH_PVVP_CONNECTIONS_FINIT
521     },
522     {
523         "Name": "vswitch_pvvp_back2back",
524         "Deployment": "clean",
525         "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 back2back test",
526         "TestSteps": STEP_VSWITCH_PVVP_CONNECTIONS_INIT +
527                      [
528                         ['vnf1', 'start'],
529                         ['vnf2', 'start'],
530                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
531                         ['vnf1', 'stop'],
532                         ['vnf2', 'stop'],
533                      ] +
534                      STEP_VSWITCH_PVVP_CONNECTIONS_FINIT
535     },
536     {
537         "Name": "vswitch_pvvp_cont",
538         "Deployment": "clean",
539         "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 continuous stream test",
540         "TestSteps": STEP_VSWITCH_PVVP_CONNECTIONS_INIT +
541                      [
542                         ['vnf1', 'start'],
543                         ['vnf2', 'start'],
544                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
545                         ['vnf1', 'stop'],
546                         ['vnf2', 'stop'],
547                      ] +
548                      STEP_VSWITCH_PVVP_CONNECTIONS_FINIT
549     },
550     {
551         "Name": "vswitch_pvvp_all",
552         "Deployment": "clean",
553         "Description": "vSwitch - configure switch, two chained vnfs and execute all test types",
554         "TestSteps": STEP_VSWITCH_PVVP_CONNECTIONS_INIT +
555                      [
556                         ['vnf1', 'start'],
557                         ['vnf2', 'start'],
558                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
559                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
560                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
561                         ['vnf1', 'stop'],
562                         ['vnf2', 'stop'],
563                      ] +
564                      STEP_VSWITCH_PVVP_CONNECTIONS_FINIT
565     },
566     {
567         "Name": "vswitch_p4vp_tput",
568         "Description": "4 chained vnfs, execute RFC2544 throughput test, deployment pvvp4",
569         "Deployment": "pvvp4",
570         "Parameters" : {
571             "TRAFFIC" : {
572                 "traffic_type" : "rfc2544_throughput",
573             },
574         },
575     },
576     {
577         "Name": "vswitch_p4vp_back2back",
578         "Description": "4 chained vnfs, execute RFC2544 back2back test, deployment pvvp4",
579         "Deployment": "pvvp4",
580         "Parameters" : {
581             "TRAFFIC" : {
582                 "traffic_type" : "rfc2544_back2back",
583             },
584         },
585     },
586     {
587         "Name": "vswitch_p4vp_cont",
588         "Description": "4 chained vnfs, execute RFC2544 continuous stream test, deployment pvvp4",
589         "Deployment": "pvvp4",
590         "Parameters" : {
591             "TRAFFIC" : {
592                 "traffic_type" : "rfc2544_continuous",
593             },
594         },
595     },
596     {
597         "Name": "vswitch_p4vp_all",
598         "Description": "4 chained vnfs, execute RFC2544 throughput tests, deployment pvvp4",
599         "Deployment": "pvvp4",
600         "TestSteps":
601         [
602             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput'}],
603             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back'}],
604             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous'}],
605         ]
606     },
607     {
608       # Topology: 2 Parallel PVP connections
609       # To run a Linux bridge as a loopback in the Guest use:
610       #     --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 2pvp_udp_dest_flows
611       # or add "Parameters" option to the test definition:
612       #     "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
613         "Name": "2pvp_udp_dest_flows",
614         "Description": "RFC2544 Continuous TC with 2 Parallel VMs, flows on UDP Dest Port, deployment pvpv2",
615         "Deployment": "pvpv2",
616         "Parameters" : {
617             "TRAFFIC" : {
618                 "traffic_type" : "rfc2544_continuous",
619             },
620         },
621     },
622     {
623       # Topology: 4 Parallel PVP connections
624       # To run a Linux bridge as a loopback in the Guest use:
625       #     --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 4pvp_udp_dest_flows
626       # or add "Parameters" option to the test definition:
627       #     "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
628         "Name": "4pvp_udp_dest_flows",
629         "Description": "RFC2544 Continuous TC with 4 Parallel VMs, flows on UDP Dest Port, deployment pvpv4",
630         "Deployment": "pvpv4",
631         "Parameters" : {
632             "TRAFFIC" : {
633                 "traffic_type" : "rfc2544_continuous",
634             },
635         },
636     },
637     {
638       # Topology: 6 Parallel PVP connections
639       # To run a Linux bridge as a loopback in the Guest use:
640       #     --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 6pvp_udp_dest_flows
641       # or add "Parameters" option to the test definition:
642       #     "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
643         "Name": "6pvp_udp_dest_flows",
644         "Description": "RFC2544 Continuous TC with 6 Parallel VMs, flows on UDP Dest Port, deployment pvpv6",
645         "Deployment": "pvpv6",
646         "Parameters" : {
647             "TRAFFIC" : {
648                 "traffic_type" : "rfc2544_continuous",
649             },
650         },
651     },
652     {
653         # Testcase for verification of vHost User NUMA awareness feature
654         # introduced in DPDK v2.2. Test case will execute two VNFs, each
655         # pinned to different NUMA slot. After that it will verify that
656         # QEMU and PMD threads serving its interfaces are co-located
657         # at the same NUMA slot.
658         #
659         # Prerequisites:
660         #     * architecture with at least 2 NUMA slots
661         #     * OVS with DPDK support and DPDK v2.2 and newer
662         #     * OVS configuration utilizing both NUMA slots
663         #
664         #     Example of OVS configuration valid for DPDK v16.04 and cores
665         #     split between NUMA slots as follows:
666         #           node 0 cpus: 0 1 2 3 4 5 6 7 8 9
667         #           node 1 cpus: 10 11 12 13 14 15 16 17 18 19
668         #
669         #     VSWITCH_PMD_CPU_MASK = '1010'
670         #     VSWITCHD_DPDK_CONFIG = {
671         #         'dpdk-init' : 'true',
672         #         'dpdk-lcore-mask' : '0x4004',
673         #         'pmd-cpu-mask' : 'FF0FF',
674         #         'dpdk-socket-mem' : '1024,1024',
675         #     }
676         #
677         "Name": "vhost_numa_awareness",
678         "Deployment": "clean",
679         "Description": "vSwitch DPDK - verify that PMD threads are served "
680                        "by the same NUMA slot as QEMU instances",
681         "vSwitch" : "OvsDpdkVhost",
682         "TestSteps": STEP_VSWITCH_PVVP_INIT +                                       # STEP 0-6
683             [
684                 # check that at least 2 numa slots are available
685                 ['tools', 'exec_shell', 'numactl -H', 'available: ([0-9]+)'],       # STEP 7
686                 ['tools', 'assert', '#STEP[-1][0]>1'],                              # STEP 8
687                 # store last 2 cores from numa slot 0
688                 ['tools', 'exec_shell', 'numactl -H', 'node 0 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 9
689                 # store last 2 cores from numa slot 1
690                 ['tools', 'exec_shell', 'numactl -H', 'node 1 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 10
691                 # pin VNF1 to 1st NUMA slot and VNF2 to 2nd NUMA slot
692                 ['settings', 'setValue', 'GUEST_CORE_BINDING',                      # STEP 11
693                     [("#STEP[-2][0][0]", "#STEP[-2][0][1]"),
694                      ("#STEP[-1][0][0]", "#STEP[-1][0][1]")]
695                 ],
696                 # start 2 VNFs
697                 ['vnf1', 'start'],                                                  # STEP 12
698                 ['vnf2', 'start'],                                                  # STEP 13
699                 # read paths to ovs utilities
700                 ['settings', 'getValue', 'TOOLS'],                                  # STEP 14
701                 # check that PMD thread serving VNF1 runs at NUMA slot 0
702                 ## i.e. get numa slot ID serving dpdhvhostuser0...
703                 ['tools', 'exec_shell', "sudo #STEP[-1]['ovs-appctl'] "             # STEP 15
704                     "dpif-netdev/pmd-rxq-show | "
705                     "sed -e '/dpdkvhostuser0/,$d' | tac",
706                     'pmd thread numa_id ([0-9])+'
707                 ],
708                 ## ...and check that it is NUMA slot 0
709                 ['tools', 'assert', '#STEP[-1][0]==0'],                             # STEP 16
710                 # check that PMD thread serving VNF2 runs at NUMA slot 1
711                 ## i.e. get numa slot ID serving dpdhvhostuser2...
712                 ['tools', 'exec_shell', "sudo #STEP[-3]['ovs-appctl'] "             # STEP 17
713                     "dpif-netdev/pmd-rxq-show | "
714                     "sed -e '/dpdkvhostuser2/,$d' | tac",
715                     'pmd thread numa_id ([0-9])+'
716                 ],
717                 ## ...and check that it is NUMA slot 1
718                 ['tools', 'assert', '#STEP[-1][0]==1'],                             # STEP 18
719                 # clean up
720                 ['vnf2', 'stop'],                                                   # STEP 19
721                 ['vnf1', 'stop'],                                                   # STEP 20
722             ] +
723             STEP_VSWITCH_PVVP_FINIT                                                 # STEP 21...
724     },
725     {
726         # Testcase to demonstrate 1 port connection between DUT and IXIA traffic
727         # generator. Testcase will enforce IxNet trafficgen and it will configure
728         # both ports to the value of TRAFFICGEN_IXIA_PORT1 to indicate one port
729         # connection.
730         # Please note, that it is essential to ensure that TRAFFICGEN_IXIA_PORT1
731         # is physically connected to the first NIC from WHITELIST_NICS list.
732         "Name": "ixnet_pvp_tput_1nic",
733         "Deployment": "clean",
734         "Description": "PVP Scenario with 1 port towards IXIA",
735         "Parameters" : {
736             "TRAFFICGEN" : "IxNet",
737             "TRAFFIC" : {
738                 "traffic_type" : "rfc2544_throughput",
739                 # we are using one port, thus it's already a bidir connection
740                 "bidir" : "False",
741             },
742         },
743         "TestSteps": [
744             ['vswitch', 'add_switch', 'int_br0'],           # STEP 0
745             ['vswitch', 'add_phy_port', 'int_br0'],         # STEP 1
746             ['vswitch', 'add_vport', 'int_br0'],            # STEP 2
747             ['vswitch', 'add_vport', 'int_br0'],            # STEP 3
748             ['vswitch', 'add_flow', 'int_br0',
749              {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'],
750               'idle_timeout': '0'}],                        # STEP 4
751             ['vswitch', 'add_flow', 'int_br0',
752              {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'],
753               'idle_timeout': '0'}],                        # STEP 5
754             ['vnf', 'start'],                               # STEP 6
755             ['settings', 'getValue', 'TRAFFICGEN_IXIA_PORT1'], # STEP 7
756             ['settings', 'setValue', 'TRAFFICGEN_IXIA_PORT2', '#STEP[-1]'],
757             ['trafficgen', 'send_traffic', {}],
758             ['vswitch', 'dump_flows', 'int_br0'],
759             ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
760             ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
761             ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
762             ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
763             ['vswitch', 'del_port', 'int_br0', '#STEP[3][0]'],
764             ['vswitch', 'del_switch', 'int_br0'],
765         ]
766     },
767     #
768     # VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
769     #
770     {
771         "Name": "vswitch_version_vpp",
772         "Deployment": "clean",
773         "Description": "VPP: vSwitch - determine VPP version and fail if it is not possible.",
774         "vSwitch" : "VppDpdkVhost",
775         "TestSteps": [
776                         ['vswitch', 'run_vppctl', ['show', 'version', 'verbose'], '|Version:\s+(v\d+\.\d+)'],
777                         ['tools', 'assert', 'len(#STEP[-1][0])'],
778                      ]
779     },
780     #
781     # END of VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
782     #
783
784     #
785     # Examples of functional testcases with traffic capture validation
786     #
787     # Capture Example 1 - Traffic capture inside VM (PVP scenario)
788     # This TestCase will modify VLAN ID set by the traffic generator to the new value.
789     # Correct VLAN ID settings is verified by inspection of captured frames.
790     {
791         "Name": "capture_pvp_modify_vid",
792         "Deployment": "pvp",
793         "Description": "Test and verify VLAN ID modification by Open vSwitch",
794         "Parameters" : {
795             "VSWITCH" : "OvsDpdkVhost", # works also for Vanilla OVS
796             "TRAFFICGEN_DURATION" : 5,
797             "TRAFFIC" : {
798                 "traffic_type" : "rfc2544_continuous",
799                 "frame_rate" : 100,
800                 'vlan': {
801                     'enabled': True,
802                     'id': 8,
803                     'priority': 1,
804                     'cfi': 0,
805                 },
806             },
807             "GUEST_LOOPBACK" : ['linux_bridge'],
808         },
809         "TestSteps": [
810             # replace original flows with vlan ID modification
811             ['!vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '1', 'actions': ['mod_vlan_vid:4','output:3']}],
812             ['!vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '2', 'actions': ['mod_vlan_vid:4','output:4']}],
813             ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'],
814             # verify that received frames have modified vlan ID
815             ['VNF0', 'execute_and_wait', 'tcpdump -i eth0 -c 5 -w dump.pcap vlan 4 &'],
816             ['trafficgen', 'send_traffic',{}],
817             ['!VNF0', 'execute_and_wait', 'tcpdump -qer dump.pcap vlan 4 2>/dev/null | wc -l','|^(\d+)$'],
818             ['tools', 'assert', '#STEP[-1][0] == 5'],
819         ],
820     },
821 ]
822 # Capture Example 2 - Setup with 2 NICs, where traffic is captured after it is
823 # processed by NIC under the test (2nd NIC). See documentation for further details.
824 # This TestCase will strip VLAN headers from traffic sent by the traffic generator.
825 # The removal of VLAN headers is verified by inspection of captured frames.
826 #
827 # NOTE: This setup expects a DUT with two NICs with two ports each. First NIC is
828 # connected to the traffic generator (standard VSPERF setup). Ports of a second NIC
829 # are interconnected by a patch cable. PCI addresses of all four ports have to be
830 # properly configured in the WHITELIST_NICS parameter.
831 _CAPTURE_P2P2P_OVS_ACTION = ''
832 _CAPTURE_P2P2P_SETUP = [
833         # restore original NICS configuration, so we can refer to NICS elements
834         ['settings', 'resetValue', 'WHITELIST_NICS'],
835         ['settings', 'resetValue', 'NICS'],
836         # create and configure two bridges to forward traffic through NIC under
837         # the test and back to the traffic generator
838         # 1st bridge:
839         ['vswitch', 'add_switch', '$VSWITCH_BRIDGE_NAME'],
840         ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[0]["device"]'],
841         ['tools', 'exec_shell', 'sudo ip link set dev $NICS[0]["device"] up'],
842         ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port $VSWITCH_BRIDGE_NAME $NICS[0]["device"]'],
843         ['tools', 'exec_shell', 'sudo $TOOLS["bind-tool"] --bind igb_uio $NICS[3]["pci"]'],
844         ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port $VSWITCH_BRIDGE_NAME dpdk0 -- '
845                                 'set Interface dpdk0 type=dpdk options:dpdk-devargs=$NICS[3]["pci"]'],
846         ['tools', 'exec_shell', '$TOOLS["ovs-ofctl"] add-flow $VSWITCH_BRIDGE_NAME in_port=1,action='
847                                 '$_CAPTURE_P2P2P_OVS_ACTION,output:2'],
848         # 2nd bridge:
849         ['vswitch', 'add_switch', 'br1'],
850         ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[2]["device"]'],
851         ['tools', 'exec_shell', 'sudo ip link set dev $NICS[2]["device"] up'],
852         ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br1 $NICS[2]["device"]'],
853         ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[1]["device"]'],
854         ['tools', 'exec_shell', 'sudo ip link set dev $NICS[1]["device"] up'],
855         ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br1 $NICS[1]["device"]'],
856         ['vswitch', 'add_flow', 'br1', {'in_port': '1', 'actions': ['output:2']}],
857         # log flow details
858         ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'],
859         ['vswitch', 'dump_flows', 'br1'],
860 ]
861 INTEGRATION_TESTS += [
862     {
863         "Name": "capture_p2p2p_strip_vlan_ovs",
864         "Deployment": "clean",
865         "Description": "P2P Continuous Stream",
866         "Parameters" : {
867             "_CAPTURE_P2P2P_OVS_ACTION" : 'strip_vlan',
868             "TRAFFIC" : {
869                 "bidir" : "False",
870                 "traffic_type" : "rfc2544_continuous",
871                 "frame_rate" : 100,
872                 'l2': {
873                     'srcmac': "ca:fe:00:00:00:00",
874                     'dstmac': "00:00:00:00:00:01"
875                 },
876                 'vlan': {
877                     'enabled': True,
878                     'id': 8,
879                     'priority': 1,
880                     'cfi': 0,
881                 },
882             },
883             # suppress DPDK configuration, so physical interfaces are not bound to DPDK driver
884             'WHITELIST_NICS' : [],
885             'NICS' : [],
886         },
887         "TestSteps": _CAPTURE_P2P2P_SETUP + [
888             # capture traffic after processing by NIC under the test (after possible egress HW offloading)
889             ['tools', 'exec_shell_background', 'tcpdump -i $NICS[2]["device"] -c 5 -w capture.pcap '
890                                                'ether src $TRAFFIC["l2"]["srcmac"]'],
891             ['trafficgen', 'send_traffic', {}],
892             ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'],
893             ['vswitch', 'dump_flows', 'br1'],
894             # there must be 5 captured frames...
895             ['tools', 'exec_shell', 'tcpdump -r capture.pcap | wc -l', '|^(\d+)$'],
896             ['tools', 'assert', '#STEP[-1][0] == 5'],
897             # ...but no vlan headers
898             ['tools', 'exec_shell', 'tcpdump -r capture.pcap vlan | wc -l', '|^(\d+)$'],
899             ['tools', 'assert', '#STEP[-1][0] == 0'],
900         ],
901     },
902     # Capture Example 3 - Traffic capture by traffic generator.
903     # This TestCase uses OVS flow to add VLAN tag with given ID into every
904     # frame send by traffic generator. Correct frame modificaiton is verified by
905     # inspection of packet capture received by T-Rex.
906     {
907         "Name": "capture_p2p_add_vlan_ovs_trex",
908         "Deployment": "clean",
909         "Description": "OVS: Test VLAN tag modification and verify it by traffic capture",
910         "vSwitch" : "OvsDpdkVhost", # works also for Vanilla OVS
911         "Parameters" : {
912             "TRAFFICGEN" : "Trex",
913             "TRAFFICGEN_TREX_LEARNING_MODE" : True,
914             "TRAFFIC" : {
915                 "traffic_type" : "burst",
916                 "frame_rate" : 100,
917                 "burst_size" : 5,
918                 # enable capture of five RX frames
919                 'capture': {
920                     'enabled': True,
921                     'tx_ports' : [],
922                     'rx_ports' : [1],
923                     'count' : 5,
924                 },
925             },
926         },
927         "TestSteps" : STEP_VSWITCH_P2P_INIT + [
928             # replace standard L2 flows by flows, which will add VLAN tag with ID 3
929             ['!vswitch', 'add_flow', 'int_br0', {'in_port': '1', 'actions': ['mod_vlan_vid:3','output:2']}],
930             ['!vswitch', 'add_flow', 'int_br0', {'in_port': '2', 'actions': ['mod_vlan_vid:3','output:1']}],
931             ['vswitch', 'dump_flows', 'int_br0'],
932             ['trafficgen', 'send_traffic', {}],
933             ['trafficgen', 'get_results'],
934             # verify that captured frames have vlan tag with ID 3
935             ['tools', 'exec_shell', 'tcpdump -qer $RESULTS_PATH/#STEP[-1][0]["capture_rx"] vlan 3 '
936                                     '2>/dev/null | wc -l', '|^(\d+)$'],
937             # number of received frames with expected VLAN id must match the number of captured frames
938             ['tools', 'assert', '#STEP[-1][0] == 5'],
939         ] + STEP_VSWITCH_P2P_FINIT,
940     },
941     #
942     # End of examples of functional testcases with traffic capture validation
943     #
944 ]
945
946 # Example of TC definition with exact vSwitch, VNF and TRAFFICGEN values.
947 #    {
948 #        "Name": "ovs_vanilla_linux_bridge_pvp_cont",
949 #        "Deployment": "clean",
950 #        "Description": "vSwitch - configure OVS Vanilla, QemuVirtioNet with linux bridge and execute continuous stream test",
951 #        "vSwitch" : "OvsVanilla",
952 #        "VNF" : "QemuVirtioNet",
953 #        "Trafficgen": "IxNet",
954 #        "Parameters": {"GUEST_LOOPBACK" : ["linux_bridge"],},
955 #        "TestSteps": STEP_VSWITCH_PVP_CONNECTIONS_INIT +
956 #                     [
957 #                        ['vnf', 'start'],
958 #                        ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
959 #                        ['vnf', 'stop'],
960 #                     ] +
961 #                     STEP_VSWITCH_PVP_CONNECTIONS_FINIT
962 #    },