Merge "docs: Update step driven test documentation"
[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 STEP_VSWITCH_P4VP_INIT = STEP_VSWITCH_PVVP_INIT + [
118     ['vswitch', 'add_vport', 'int_br0'],            # STEP 7    vm3 ports
119     ['vswitch', 'add_vport', 'int_br0'],            # STEP 8
120     ['vswitch', 'add_vport', 'int_br0'],            # STEP 9    vm4 ports
121     ['vswitch', 'add_vport', 'int_br0'],            # STEP 10
122 ]
123
124 STEP_VSWITCH_P4VP_FINIT = [
125     ['vswitch', 'del_port', 'int_br0', '#STEP[7][0]'],  # vm3 ports
126     ['vswitch', 'del_port', 'int_br0', '#STEP[8][0]'],
127     ['vswitch', 'del_port', 'int_br0', '#STEP[9][0]'],  # vm4 ports
128     ['vswitch', 'del_port', 'int_br0', '#STEP[10][0]'],
129 ] + STEP_VSWITCH_PVVP_FINIT
130
131 STEP_VSWITCH_P4VP_FLOWS_INIT = STEP_VSWITCH_P4VP_INIT + [
132             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
133                 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
134             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
135                 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
136             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
137                 'actions': ['output:#STEP[7][1]'], 'idle_timeout': '0'}],
138             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[8][1]', \
139                 'actions': ['output:#STEP[9][1]'], 'idle_timeout': '0'}],
140             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[10][1]', \
141                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
142             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', \
143                 'actions': ['output:#STEP[10][1]'], 'idle_timeout': '0'}],
144             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[9][1]', \
145                 'actions': ['output:#STEP[8][1]'], 'idle_timeout': '0'}],
146             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[7][1]', \
147                 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
148             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[5][1]', \
149                 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
150             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', \
151                 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
152 ]
153
154 STEP_VSWITCH_P4VP_FLOWS_FINIT = [
155     ['vswitch', 'dump_flows', 'int_br0'],
156     ['vswitch', 'del_flow', 'int_br0'],
157 ] + STEP_VSWITCH_P4VP_FINIT
158
159 STEP_VSWITCH_2PHY_2VM_INIT = STEP_VSWITCH_PVVP_INIT
160
161 STEP_VSWITCH_2PHY_2VM_FINIT = STEP_VSWITCH_PVVP_FINIT
162
163 STEP_VSWITCH_2_PARALLEL_VM_FLOWS_INIT  = [
164             # Setup Flows to reply ICMPv6 and similar packets, so to
165             # avoid flooding the internal port with their re-transmissions
166             ['vswitch', 'add_flow', 'int_br0', \
167                 {'priority': '1', 'dl_src': '00:00:00:00:00:01', \
168                 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
169             ['vswitch', 'add_flow', 'int_br0', \
170                 {'priority': '1', 'dl_src': '00:00:00:00:00:02', \
171                 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
172             ['vswitch', 'add_flow', 'int_br0', \
173                 {'priority': '1', 'dl_src': '00:00:00:00:00:03', \
174                 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
175             ['vswitch', 'add_flow', 'int_br0', \
176                 {'priority': '1', 'dl_src': '00:00:00:00:00:04', \
177                 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
178             # Forward UDP packets depending on dest port
179             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
180                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '0', \
181                 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
182             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
183                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '1', \
184                 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
185             # Send VM outputs to phy port #2
186             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
187                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
188             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
189                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
190 ]
191
192 STEP_VSWITCH_2PHY_4VM_INIT = STEP_VSWITCH_2PHY_2VM_INIT + [
193     ['vswitch', 'add_vport', 'int_br0'],            # STEP 7    vm3 ports
194     ['vswitch', 'add_vport', 'int_br0'],            # STEP 8
195     ['vswitch', 'add_vport', 'int_br0'],            # STEP 9    vm4 ports
196     ['vswitch', 'add_vport', 'int_br0'],            # STEP 10
197 ]
198
199 STEP_VSWITCH_2PHY_4VM_FINIT = [
200     ['vswitch', 'del_port', 'int_br0', '#STEP[7][0]'],  # vm3 ports
201     ['vswitch', 'del_port', 'int_br0', '#STEP[8][0]'],
202     ['vswitch', 'del_port', 'int_br0', '#STEP[9][0]'],  # vm4 ports
203     ['vswitch', 'del_port', 'int_br0', '#STEP[10][0]'],
204 ] + STEP_VSWITCH_2PHY_2VM_FINIT
205
206 STEP_VSWITCH_FLOWS_FINIT = [
207     ['vswitch', 'dump_flows', 'int_br0'],
208     ['vswitch', 'del_flow', 'int_br0'],
209 ]
210
211 STEP_VSWITCH_4_PARALLEL_VM_FLOWS_INIT = [
212             # Setup Flows to reply ICMPv6 and similar packets, so to
213             # avoid flooding the internal port with their re-transmissions
214             ['vswitch', 'add_flow', 'int_br0', \
215                 {'priority': '1', 'dl_src': '00:00:00:00:00:01', \
216                 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
217             ['vswitch', 'add_flow', 'int_br0', \
218                 {'priority': '1', 'dl_src': '00:00:00:00:00:02', \
219                 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
220             ['vswitch', 'add_flow', 'int_br0', \
221                 {'priority': '1', 'dl_src': '00:00:00:00:00:03', \
222                 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
223             ['vswitch', 'add_flow', 'int_br0', \
224                 {'priority': '1', 'dl_src': '00:00:00:00:00:04', \
225                 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
226             ['vswitch', 'add_flow', 'int_br0', \
227                 {'priority': '1', 'dl_src': '00:00:00:00:00:05', \
228                 'actions': ['output:#STEP[7][1]'], 'idle_timeout': '0'}],
229             ['vswitch', 'add_flow', 'int_br0', \
230                 {'priority': '1', 'dl_src': '00:00:00:00:00:06', \
231                 'actions': ['output:#STEP[8][1]'], 'idle_timeout': '0'}],
232             ['vswitch', 'add_flow', 'int_br0', \
233                 {'priority': '1', 'dl_src': '00:00:00:00:00:07', \
234                 'actions': ['output:#STEP[9][1]'], 'idle_timeout': '0'}],
235             ['vswitch', 'add_flow', 'int_br0', \
236                 {'priority': '1', 'dl_src': '00:00:00:00:00:08', \
237                 'actions': ['output:#STEP[10][1]'], 'idle_timeout': '0'}],
238             # Forward UDP packets depending on dest port
239             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
240                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '0', \
241                 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
242             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
243                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '1', \
244                 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
245             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
246                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '2', \
247                 'actions': ['output:#STEP[7][1]'], 'idle_timeout': '0'}],
248             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
249                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '3', \
250                 'actions': ['output:#STEP[9][1]'], 'idle_timeout': '0'}],
251             # Send VM outputs to phy port #2
252             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
253                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
254             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
255                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
256             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[8][1]', \
257                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
258             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[10][1]', \
259                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
260 ]
261
262 STEP_VSWITCH_2PHY_6VM_INIT = STEP_VSWITCH_2PHY_4VM_INIT + [
263             ['vswitch', 'add_vport', 'int_br0'],        # STEP 11   vm5    vhu8
264             ['vswitch', 'add_vport', 'int_br0'],        # STEP 12          vhu9
265             ['vswitch', 'add_vport', 'int_br0'],        # STEP 13   vm6    vhu10
266             ['vswitch', 'add_vport', 'int_br0'],        # STEP 14          vhu11
267 ]
268
269 STEP_VSWITCH_6_PARALLEL_VM_FLOWS_INIT = STEP_VSWITCH_4_PARALLEL_VM_FLOWS_INIT + [
270             ['vswitch', 'add_flow', 'int_br0', \
271                 {'priority': '1', 'dl_src': '00:00:00:00:00:09', \
272                 'actions': ['output:#STEP[11][1]'], 'idle_timeout': '0'}],
273             ['vswitch', 'add_flow', 'int_br0', \
274                 {'priority': '1', 'dl_src': '00:00:00:00:00:0a', \
275                 'actions': ['output:#STEP[12][1]'], 'idle_timeout': '0'}],
276             ['vswitch', 'add_flow', 'int_br0', \
277                 {'priority': '1', 'dl_src': '00:00:00:00:00:0b', \
278                 'actions': ['output:#STEP[13][1]'], 'idle_timeout': '0'}],
279             ['vswitch', 'add_flow', 'int_br0', \
280                 {'priority': '1', 'dl_src': '00:00:00:00:00:0c', \
281                 'actions': ['output:#STEP[14][1]'], 'idle_timeout': '0'}],
282             # Forward UDP packets depending on dest port
283             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
284                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '4', \
285                 'actions': ['output:#STEP[11][1]'], 'idle_timeout': '0'}],
286             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
287                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '5', \
288                 'actions': ['output:#STEP[13][1]'], 'idle_timeout': '0'}],
289             # Send VM outputs to phy port #2
290             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[12][1]', \
291                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
292             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[14][1]', \
293                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
294 ]
295
296 STEP_VSWITCH_2PHY_6VM_FINIT = [
297             ['vswitch', 'del_port', 'int_br0', '#STEP[11][0]'],  # vm5 ports
298             ['vswitch', 'del_port', 'int_br0', '#STEP[12][0]'],
299             ['vswitch', 'del_port', 'int_br0', '#STEP[13][0]'],  # vm6 ports
300             ['vswitch', 'del_port', 'int_br0', '#STEP[14][0]'],
301 ] + STEP_VSWITCH_2PHY_4VM_FINIT
302
303 #
304 # Definition of integration tests
305 #
306 INTEGRATION_TESTS = [
307     {
308         "Name": "overlay_p2p_mod_tput",
309         "Deployment": "ptunp",
310         "Tunnel Type": "vxlan",
311         "Description": ("Tunneling Throughput RFC2544 Test."
312                        "The encap and decap are performed inside the "
313                        "virtual switch itself in each direction to avoid "
314                        "the need of ingress overlay traffic."),
315         "Parameters": {
316             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
317             "TRAFFIC" : {
318                 "traffic_type" : "rfc2544_throughput",
319                 "bidir" : "False",
320             },
321         },
322     },
323     {
324         "Name": "overlay_p2p_tput",
325         "Deployment": "op2p",
326         "Tunnel Operation": "encapsulation",
327         "Description": "Overlay Encapsulation Throughput RFC2544 Test",
328         "Parameters": {
329             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
330             "TRAFFIC" : {
331                 "traffic_type" : "rfc2544_throughput",
332                 "bidir" : "False",
333             },
334         },
335     },
336     {
337         "Name": "overlay_p2p_cont",
338         "Deployment": "op2p",
339         "Tunnel Operation": "encapsulation",
340         "Description": "Overlay Encapsulation RFC2544 Continuous Stream",
341         "Parameters": {
342             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
343             "TRAFFIC" : {
344                 "traffic_type" : "rfc2544_continuous",
345                 "bidir" : "False",
346             },
347         },
348     },
349     {
350         "Name": "overlay_p2p_decap_tput",
351         "Deployment": "op2p",
352         "Tunnel Operation": "decapsulation",
353         "Description": "Overlay Decapsulation Throughput RFC2544 Test",
354         "Parameters": {
355             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
356             "TRAFFIC" : {
357                 "traffic_type" : "rfc2544_throughput",
358                 "bidir" : "False",
359             },
360         },
361     },
362     {
363         "Name": "overlay_p2p_decap_cont",
364         "Deployment": "op2p",
365         "Tunnel Operation": "decapsulation",
366         "Description": "Overlay Decapsulation RFC2544 Continuous Stream",
367         "Parameters": {
368             "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
369             "TRAFFIC" : {
370                 "traffic_type" : "rfc2544_continuous",
371                 "bidir" : "False",
372             },
373         },
374     },
375     {
376         "Name": "vswitch_add_del_bridge",
377         "Deployment": "clean",
378         "Description": "vSwitch - add and delete bridge",
379         "TestSteps": [
380                         ['vswitch', 'add_switch', 'int_br0'],
381                         ['vswitch', 'del_switch', 'int_br0'],
382                      ]
383     },
384     {
385         "Name": "vswitch_add_del_bridges",
386         "Deployment": "clean",
387         "Description": "vSwitch - add and delete bridges",
388         "TestSteps": [
389                         ['vswitch', 'add_switch', 'int_br0'],
390                         ['vswitch', 'add_switch', 'int_br1'],
391                         ['vswitch', 'del_switch', 'int_br0'],
392                         ['vswitch', 'del_switch', 'int_br1'],
393                      ]
394     },
395     {
396         "Name": "vswitch_add_del_phy_port",
397         "Deployment": "clean",
398         "Description": "vSwitch - add and delete physical port",
399         "TestSteps": [
400                         ['vswitch', 'add_switch', 'int_br0'],
401                         ['vswitch', 'add_phy_port', 'int_br0'],
402                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
403                         ['vswitch', 'del_switch', 'int_br0'],
404                      ]
405     },
406     {
407         "Name": "vswitch_add_del_phy_ports",
408         "Deployment": "clean",
409         "Description": "vSwitch - add and delete physical ports",
410         "TestSteps": [
411                         ['vswitch', 'add_switch', 'int_br0'],
412                         ['vswitch', 'add_phy_port', 'int_br0'],
413                         ['vswitch', 'add_phy_port', 'int_br0'],
414                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
415                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
416                         ['vswitch', 'del_switch', 'int_br0'],
417                      ]
418     },
419     {
420         "Name": "vswitch_add_del_vport",
421         "Deployment": "clean",
422         "Description": "vSwitch - add and delete virtual port",
423         "TestSteps": [
424                         ['vswitch', 'add_switch', 'int_br0'],
425                         ['vswitch', 'add_vport', 'int_br0'],
426                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
427                         ['vswitch', 'del_switch', 'int_br0'],
428                      ]
429     },
430     {
431         "Name": "vswitch_add_del_vports",
432         "Deployment": "clean",
433         "Description": "vSwitch - add and delete virtual ports",
434         "TestSteps": [
435                         ['vswitch', 'add_switch', 'int_br0'],
436                         ['vswitch', 'add_vport', 'int_br0'],
437                         ['vswitch', 'add_vport', 'int_br0'],
438                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
439                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
440                         ['vswitch', 'del_switch', 'int_br0'],
441                      ]
442     },
443     {
444         "Name": "vswitch_add_del_flow",
445         "Deployment": "clean",
446         "Description": "vSwitch - add and delete flow",
447         "TestSteps": [
448                         ['vswitch', 'add_switch', 'int_br0'],
449                         ['vswitch', 'add_phy_port', 'int_br0'],
450                         ['vswitch', 'add_phy_port', 'int_br0'],
451                         ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
452                         ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
453                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
454                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
455                         ['vswitch', 'del_switch', 'int_br0'],
456                      ]
457     },
458     {
459         "Name": "vswitch_vports_add_del_flow",
460         "Deployment": "clean",
461         "Description": "vSwitch - configure switch with vports, add and delete flow",
462         "TestSteps": [
463                         ['vswitch', 'add_switch', 'int_br0'],
464                         ['vswitch', 'add_vport', 'int_br0'],
465                         ['vswitch', 'add_vport', 'int_br0'],
466                         ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
467                         ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
468                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
469                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
470                         ['vswitch', 'del_switch', 'int_br0'],
471                      ]
472     },
473     {
474         "Name": "vswitch_add_del_flows",
475         "Deployment": "clean",
476         "Description": "vSwitch - add and delete flows",
477         "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
478                      STEP_VSWITCH_P2P_FLOWS_FINIT
479     },
480     {
481         "Name": "vswitch_p2p_tput",
482         "Deployment": "clean",
483         "Description": "vSwitch - configure switch and execute RFC2544 throughput test",
484         "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
485                      [
486                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
487                      ] +
488                      STEP_VSWITCH_P2P_FLOWS_FINIT
489     },
490     {
491         "Name": "vswitch_p2p_back2back",
492         "Deployment": "clean",
493         "Description": "vSwitch - configure switch and execute RFC2544 back2back test",
494         "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
495                      [
496                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
497                      ] +
498                      STEP_VSWITCH_P2P_FLOWS_FINIT
499     },
500     {
501         "Name": "vswitch_p2p_cont",
502         "Deployment": "clean",
503         "Description": "vSwitch - configure switch and execute RFC2544 continuous stream test",
504         "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
505                      [
506                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
507                      ] +
508                      STEP_VSWITCH_P2P_FLOWS_FINIT
509     },
510     {
511         "Name": "vswitch_pvp",
512         "Deployment": "clean",
513         "Description": "vSwitch - configure switch and one vnf",
514         "TestSteps": STEP_VSWITCH_PVP_INIT +
515                      [
516                         ['vnf', 'start'],
517                         ['vnf', 'stop'],
518                      ] +
519                      STEP_VSWITCH_PVP_FINIT
520     },
521     {
522         "Name": "vswitch_vports_pvp",
523         "Deployment": "clean",
524         "Description": "vSwitch - configure switch with vports and one vnf",
525         "TestSteps": [
526                         ['vswitch', 'add_switch', 'int_br0'],
527                         ['vswitch', 'add_vport', 'int_br0'],
528                         ['vswitch', 'add_vport', 'int_br0'],
529                         ['vnf', 'start'],
530                         ['vnf', 'stop'],
531                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
532                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
533                         ['vswitch', 'del_switch', 'int_br0'],
534                      ]
535     },
536     {
537         "Name": "vswitch_pvp_tput",
538         "Deployment": "clean",
539         "Description": "vSwitch - configure switch, vnf and execute RFC2544 throughput test",
540         "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
541                      [
542                         ['vnf', 'start'],
543                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
544                         ['vnf', 'stop'],
545                      ] +
546                      STEP_VSWITCH_PVP_FLOWS_FINIT
547     },
548     {
549         "Name": "vswitch_pvp_back2back",
550         "Deployment": "clean",
551         "Description": "vSwitch - configure switch, vnf and execute RFC2544 back2back test",
552         "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
553                      [
554                         ['vnf', 'start'],
555                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
556                         ['vnf', 'stop'],
557                      ] +
558                      STEP_VSWITCH_PVP_FLOWS_FINIT
559     },
560     {
561         "Name": "vswitch_pvp_cont",
562         "Deployment": "clean",
563         "Description": "vSwitch - configure switch, vnf and execute RFC2544 continuous stream test",
564         "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
565                      [
566                         ['vnf', 'start'],
567                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
568                         ['vnf', 'stop'],
569                      ] +
570                      STEP_VSWITCH_PVP_FLOWS_FINIT
571     },
572     {
573         "Name": "vswitch_pvp_all",
574         "Deployment": "clean",
575         "Description": "vSwitch - configure switch, vnf and execute all test types",
576         "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
577                      [
578                         ['vnf', 'start'],
579                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
580                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
581                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
582                         ['vnf', 'stop'],
583                      ] +
584                      STEP_VSWITCH_PVP_FLOWS_FINIT
585     },
586     {
587         "Name": "vswitch_pvvp",
588         "Deployment": "clean",
589         "Description": "vSwitch - configure switch and two vnfs",
590         "TestSteps": STEP_VSWITCH_PVVP_INIT +
591                      [
592                         ['vnf1', 'start'],
593                         ['vnf2', 'start'],
594                         ['vnf1', 'stop'],
595                         ['vnf2', 'stop'],
596                      ] +
597                      STEP_VSWITCH_PVVP_FINIT
598     },
599     {
600         "Name": "vswitch_pvvp_tput",
601         "Deployment": "clean",
602         "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 throughput test",
603         "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
604                      [
605                         ['vnf1', 'start'],
606                         ['vnf2', 'start'],
607                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
608                         ['vnf1', 'stop'],
609                         ['vnf2', 'stop'],
610                      ] +
611                      STEP_VSWITCH_PVVP_FLOWS_FINIT
612     },
613     {
614         "Name": "vswitch_pvvp_back2back",
615         "Deployment": "clean",
616         "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 back2back test",
617         "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
618                      [
619                         ['vnf1', 'start'],
620                         ['vnf2', 'start'],
621                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
622                         ['vnf1', 'stop'],
623                         ['vnf2', 'stop'],
624                      ] +
625                      STEP_VSWITCH_PVVP_FLOWS_FINIT
626     },
627     {
628         "Name": "vswitch_pvvp_cont",
629         "Deployment": "clean",
630         "Description": "vSwitch - configure switch, two chained vnfs and execute RFC2544 continuous stream test",
631         "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
632                      [
633                         ['vnf1', 'start'],
634                         ['vnf2', 'start'],
635                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
636                         ['vnf1', 'stop'],
637                         ['vnf2', 'stop'],
638                      ] +
639                      STEP_VSWITCH_PVVP_FLOWS_FINIT
640     },
641     {
642         "Name": "vswitch_pvvp_all",
643         "Deployment": "clean",
644         "Description": "vSwitch - configure switch, two chained vnfs and execute all test types",
645         "TestSteps": STEP_VSWITCH_PVVP_FLOWS_INIT +
646                      [
647                         ['vnf1', 'start'],
648                         ['vnf2', 'start'],
649                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', 'bidir' : 'True'}],
650                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', 'bidir' : 'True'}],
651                         ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
652                         ['vnf1', 'stop'],
653                         ['vnf2', 'stop'],
654                      ] +
655                      STEP_VSWITCH_PVVP_FLOWS_FINIT
656     },
657     {
658         "Name": "vswitch_p4vp",
659         "Description": "Just configure 4 chained vnfs",
660         "Deployment": "clean",
661         "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
662         [
663             ['vnf1', 'start'],
664             ['vnf2', 'start'],
665             ['vnf3', 'start'],
666             ['vnf4', 'start'],
667             ['vnf1', 'stop'],
668             ['vnf2', 'stop'],
669             ['vnf3', 'stop'],
670             ['vnf4', 'stop'],
671         ] +
672         STEP_VSWITCH_P4VP_FLOWS_FINIT
673     },
674     {
675         "Name": "vswitch_p4vp_tput",
676         "Description": "4 chained vnfs, execute RFC2544 throughput test",
677         "Deployment": "clean",
678         "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
679         [
680             ['vnf1', 'start'],
681             ['vnf2', 'start'],
682             ['vnf3', 'start'],
683             ['vnf4', 'start'],
684             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', \
685                 'bidir' : 'True'}],
686             ['vnf1', 'stop'],
687             ['vnf2', 'stop'],
688             ['vnf3', 'stop'],
689             ['vnf4', 'stop'],
690         ] +
691         STEP_VSWITCH_P4VP_FLOWS_FINIT
692     },
693     {
694         "Name": "vswitch_p4vp_back2back",
695         "Description": "4 chained vnfs, execute RFC2544 back2back test",
696         "Deployment": "clean",
697         "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
698         [
699             ['vnf1', 'start'],
700             ['vnf2', 'start'],
701             ['vnf3', 'start'],
702             ['vnf4', 'start'],
703             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', \
704                 'bidir' : 'True'}],
705             ['vnf1', 'stop'],
706             ['vnf2', 'stop'],
707             ['vnf3', 'stop'],
708             ['vnf4', 'stop'],
709         ] +
710         STEP_VSWITCH_P4VP_FLOWS_FINIT
711     },
712     {
713         "Name": "vswitch_p4vp_cont",
714         "Description": "4 chained vnfs, execute RFC2544 continuous stream test",
715         "Deployment": "clean",
716         "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
717         [
718             ['vnf1', 'start'],
719             ['vnf2', 'start'],
720             ['vnf3', 'start'],
721             ['vnf4', 'start'],
722             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', \
723                 'bidir' : 'True'}],
724             ['vnf1', 'stop'],
725             ['vnf2', 'stop'],
726             ['vnf3', 'stop'],
727             ['vnf4', 'stop'],
728         ] +
729         STEP_VSWITCH_P4VP_FLOWS_FINIT
730     },
731     {
732         "Name": "vswitch_p4vp_all",
733         "Description": "4 chained vnfs, execute RFC2544 throughput test",
734         "Deployment": "clean",
735         "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
736         [
737             ['vnf1', 'start'],
738             ['vnf2', 'start'],
739             ['vnf3', 'start'],
740             ['vnf4', 'start'],
741             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_throughput', \
742                 'bidir' : 'True'}],
743             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_back2back', \
744                 'bidir' : 'True'}],
745             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', \
746                 'bidir' : 'True'}],
747             ['vnf1', 'stop'],
748             ['vnf2', 'stop'],
749             ['vnf3', 'stop'],
750             ['vnf4', 'stop'],
751         ] +
752         STEP_VSWITCH_P4VP_FLOWS_FINIT
753     },
754     {
755       # Topology: 2 Parallel PVP connections
756       # To run a Linux bridge as a loopback in the Guest use:
757       #     --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 2pvp_udp_dest_flows
758       # or add "Parameters" option to the test definition:
759       #     "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
760         "Name": "2pvp_udp_dest_flows",
761         "Description": "RFC2544 Continuous TC with 2 Parallel VMs, flows on UDP Dest Port",
762         "Deployment": "clean",
763         "Parameters" : {
764             "TRAFFIC" : {
765                 "multistream" : 2,
766                 "stream_type" : "L4",
767             },
768         },
769         "TestSteps": STEP_VSWITCH_2PHY_2VM_INIT +
770             STEP_VSWITCH_2_PARALLEL_VM_FLOWS_INIT + [
771             # Start 2 VMs
772             ['vnf1', 'start'],
773             ['vnf2', 'start'],
774             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'False'}],
775             ['vnf1', 'stop'],
776             ['vnf2', 'stop'],
777             # Clean up
778         ] + STEP_VSWITCH_FLOWS_FINIT +
779             STEP_VSWITCH_2PHY_2VM_FINIT
780     },
781     {
782       # Topology: 4 Parallel PVP connections
783       # To run a Linux bridge as a loopback in the Guest use:
784       #     --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 4pvp_udp_dest_flows
785       # or add "Parameters" option to the test definition:
786       #     "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
787         "Name": "4pvp_udp_dest_flows",
788         "Description": "RFC2544 Continuous TC with 4 Parallel VMs, flows on UDP Dest Port",
789         "Deployment": "clean",
790         "Parameters" : {
791             "TRAFFIC" : {
792                 "multistream" : 4,
793                 "stream_type" : "L4",
794             },
795         },
796         "TestSteps": STEP_VSWITCH_2PHY_4VM_INIT +
797             STEP_VSWITCH_4_PARALLEL_VM_FLOWS_INIT + [
798             # Start 4 VMs
799             ['vnf1', 'start'],
800             ['vnf2', 'start'],
801             ['vnf3', 'start'],
802             ['vnf4', 'start'],
803             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'False'}],
804             ['vnf1', 'stop'],
805             ['vnf2', 'stop'],
806             ['vnf3', 'stop'],
807             ['vnf4', 'stop'],
808             # Clean up
809         ] + STEP_VSWITCH_FLOWS_FINIT +
810             STEP_VSWITCH_2PHY_4VM_FINIT
811     },
812     {
813       # Topology: 6 Parallel PVP connections
814       # To run a Linux bridge as a loopback in the Guest use:
815       #     --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 6pvp_udp_dest_flows
816       # or add "Parameters" option to the test definition:
817       #     "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
818         "Name": "6pvp_udp_dest_flows",
819         "Description": "RFC2544 Continuous TC with 6 Parallel VMs, flows on UDP Dest Port",
820         "Deployment": "clean",
821         "Parameters" : {
822             "TRAFFIC" : {
823                 "multistream" : 6,
824                 "stream_type" : "L4",
825             },
826         },
827         "TestSteps": STEP_VSWITCH_2PHY_6VM_INIT +
828             STEP_VSWITCH_6_PARALLEL_VM_FLOWS_INIT + [
829             # Start VMs
830             ['vnf1', 'start'],
831             ['vnf2', 'start'],
832             ['vnf3', 'start'],
833             ['vnf4', 'start'],
834             ['vnf5', 'start'],
835             ['vnf6', 'start'],
836             ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'False'}],
837             ['vnf1', 'stop'],
838             ['vnf2', 'stop'],
839             ['vnf3', 'stop'],
840             ['vnf4', 'stop'],
841             ['vnf5', 'stop'],
842             ['vnf6', 'stop'],
843         ] + STEP_VSWITCH_FLOWS_FINIT +
844         STEP_VSWITCH_2PHY_6VM_FINIT
845     },
846     {
847         # Testcase for verification of vHost User NUMA awareness feature
848         # introduced in DPDK v2.2. Test case will execute two VNFs, each
849         # pinned to different NUMA slot. After that it will verify that
850         # QEMU and PMD threads serving its interfaces are co-located
851         # at the same NUMA slot.
852         #
853         # Prerequisites:
854         #     * architecture with at least 2 NUMA slots
855         #     * OVS with DPDK support and DPDK v2.2 and newer
856         #     * OVS configuration utilizing both NUMA slots
857         #
858         #     Example of OVS configuration valid for DPDK v16.04 and cores
859         #     split between NUMA slots as follows:
860         #           node 0 cpus: 0 1 2 3 4 5 6 7 8 9
861         #           node 1 cpus: 10 11 12 13 14 15 16 17 18 19
862         #
863         #     VSWITCH_PMD_CPU_MASK = '1010'
864         #     VSWITCHD_DPDK_CONFIG = {
865         #         'dpdk-init' : 'true',
866         #         'dpdk-lcore-mask' : '0x4004',
867         #         'pmd-cpu-mask' : 'FF0FF',
868         #         'dpdk-socket-mem' : '1024,1024',
869         #     }
870         #
871         "Name": "vhost_numa_awareness",
872         "Deployment": "clean",
873         "Description": "vSwitch DPDK - verify that PMD threads are served "
874                        "by the same NUMA slot as QEMU instances",
875         "vSwitch" : "OvsDpdkVhost",
876         "TestSteps": STEP_VSWITCH_PVVP_INIT +                                       # STEP 0-6
877             [
878                 # check that at least 2 numa slots are available
879                 ['tools', 'exec_shell', 'numactl -H', 'available: ([0-9]+)'],       # STEP 7
880                 ['tools', 'assert', '#STEP[-1][0]>1'],                              # STEP 8
881                 # store last 2 cores from numa slot 0
882                 ['tools', 'exec_shell', 'numactl -H', 'node 0 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 9
883                 # store last 2 cores from numa slot 1
884                 ['tools', 'exec_shell', 'numactl -H', 'node 1 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 10
885                 # pin VNF1 to 1st NUMA slot and VNF2 to 2nd NUMA slot
886                 ['settings', 'setValue', 'GUEST_CORE_BINDING',                      # STEP 11
887                     [("#STEP[-2][0][0]", "#STEP[-2][0][1]"),
888                      ("#STEP[-1][0][0]", "#STEP[-1][0][1]")]
889                 ],
890                 # start 2 VNFs
891                 ['vnf1', 'start'],                                                  # STEP 12
892                 ['vnf2', 'start'],                                                  # STEP 13
893                 # read paths to ovs utilities
894                 ['settings', 'getValue', 'TOOLS'],                                  # STEP 14
895                 # check that PMD thread serving VNF1 runs at NUMA slot 0
896                 ## i.e. get numa slot ID serving dpdhvhostuser0...
897                 ['tools', 'exec_shell', "sudo #STEP[-1]['ovs-appctl'] "             # STEP 15
898                     "dpif-netdev/pmd-rxq-show | "
899                     "sed -e '/dpdkvhostuser0/,$d' | tac",
900                     'pmd thread numa_id ([0-9])+'
901                 ],
902                 ## ...and check that it is NUMA slot 0
903                 ['tools', 'assert', '#STEP[-1][0]==0'],                             # STEP 16
904                 # check that PMD thread serving VNF2 runs at NUMA slot 1
905                 ## i.e. get numa slot ID serving dpdhvhostuser2...
906                 ['tools', 'exec_shell', "sudo #STEP[-3]['ovs-appctl'] "             # STEP 17
907                     "dpif-netdev/pmd-rxq-show | "
908                     "sed -e '/dpdkvhostuser2/,$d' | tac",
909                     'pmd thread numa_id ([0-9])+'
910                 ],
911                 ## ...and check that it is NUMA slot 1
912                 ['tools', 'assert', '#STEP[-1][0]==1'],                             # STEP 18
913                 # clean up
914                 ['vnf2', 'stop'],                                                   # STEP 19
915                 ['vnf1', 'stop'],                                                   # STEP 20
916             ] +
917             STEP_VSWITCH_PVVP_FINIT                                                 # STEP 21...
918     },
919     {
920         # Testcase to demonstrate 1 port connection between DUT and IXIA traffic
921         # generator. Testcase will enforce IxNet trafficgen and it will configure
922         # both ports to the value of TRAFFICGEN_IXIA_PORT1 to indicate one port
923         # connection.
924         # Please note, that it is essential to ensure that TRAFFICGEN_IXIA_PORT1
925         # is physically connected to the first NIC from WHITELIST_NICS list.
926         "Name": "ixnet_pvp_tput_1nic",
927         "Deployment": "clean",
928         "Description": "PVP Scenario with 1 port towards IXIA",
929         "Parameters" : {
930             "TRAFFICGEN" : "IxNet",
931             "TRAFFIC" : {
932                 "traffic_type" : "rfc2544_throughput",
933                 # we are using one port, thus it's already a bidir connection
934                 "bidir" : "False",
935             },
936         },
937         "TestSteps": [
938             ['vswitch', 'add_switch', 'int_br0'],           # STEP 0
939             ['vswitch', 'add_phy_port', 'int_br0'],         # STEP 1
940             ['vswitch', 'add_vport', 'int_br0'],            # STEP 2
941             ['vswitch', 'add_vport', 'int_br0'],            # STEP 3
942             ['vswitch', 'add_flow', 'int_br0',
943              {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'],
944               'idle_timeout': '0'}],                        # STEP 4
945             ['vswitch', 'add_flow', 'int_br0',
946              {'in_port': '#STEP[3][1]', 'actions': ['output:#STEP[1][1]'],
947               'idle_timeout': '0'}],                        # STEP 5
948             ['vnf', 'start'],                               # STEP 6
949             ['settings', 'getValue', 'TRAFFICGEN_IXIA_PORT1'], # STEP 7
950             ['settings', 'setValue', 'TRAFFICGEN_IXIA_PORT2', '#STEP[-1]'],
951             ['trafficgen', 'send_traffic', {}],
952             ['vswitch', 'dump_flows', 'int_br0'],
953             ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
954             ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
955             ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
956             ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
957             ['vswitch', 'del_port', 'int_br0', '#STEP[3][0]'],
958             ['vswitch', 'del_switch', 'int_br0'],
959         ]
960     },
961     #
962     # VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
963     #
964     {
965         "Name": "vswitch_version_vpp",
966         "Deployment": "clean",
967         "Description": "VPP: vSwitch - determine VPP version and fail if it is not possible.",
968         "vSwitch" : "VppDpdkVhost",
969         "TestSteps": [
970                         ['vswitch', 'run_vppctl', ['show', 'version', 'verbose'], '|Version:\s+(v\d+\.\d+)'],
971                         ['tools', 'assert', 'len(#STEP[-1][0])'],
972                      ]
973     },
974     {
975         "Name": "vswitch_vports_add_del_connection_vpp",
976         "Deployment": "clean",
977         "Description": "VPP: vSwitch - configure switch with vports, add and delete connection",
978         "vSwitch" : "VppDpdkVhost",
979         "TestSteps": [
980                         ['vswitch', 'add_switch', 'int_br0'],
981                         ['vswitch', 'add_vport', 'int_br0'],
982                         ['vswitch', 'add_vport', 'int_br0'],
983                         ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]', True],
984                         ['vswitch', 'dump_connections', 'int_br0'],
985                         ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]', True],
986                         ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
987                         ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
988                         ['vswitch', 'del_switch', 'int_br0'],
989                      ]
990     },
991     #
992     # END of VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
993     #
994
995     #
996     # Examples of functional testcases with traffic capture validation
997     #
998     # Capture Example 1 - Traffic capture inside VM (PVP scenario)
999     # This TestCase will modify VLAN ID set by the traffic generator to the new value.
1000     # Correct VLAN ID settings is verified by inspection of captured frames.
1001     {
1002         "Name": "capture_pvp_modify_vid",
1003         "Deployment": "pvp",
1004         "Description": "Test and verify VLAN ID modification by Open vSwitch",
1005         "Parameters" : {
1006             "VSWITCH" : "OvsDpdkVhost", # works also for Vanilla OVS
1007             "TRAFFICGEN_DURATION" : 5,
1008             "TRAFFIC" : {
1009                 "traffic_type" : "rfc2544_continuous",
1010                 "frame_rate" : 100,
1011                 'vlan': {
1012                     'enabled': True,
1013                     'id': 8,
1014                     'priority': 1,
1015                     'cfi': 0,
1016                 },
1017             },
1018             "GUEST_LOOPBACK" : ['linux_bridge'],
1019         },
1020         "TestSteps": [
1021             # replace original flows with vlan ID modification
1022             ['!vswitch', 'add_flow', 'br0', {'in_port': '1', 'actions': ['mod_vlan_vid:4','output:3']}],
1023             ['!vswitch', 'add_flow', 'br0', {'in_port': '2', 'actions': ['mod_vlan_vid:4','output:4']}],
1024             ['vswitch', 'dump_flows', 'br0'],
1025             # verify that received frames have modified vlan ID
1026             ['VNF0', 'execute_and_wait', 'tcpdump -i eth0 -c 5 -w dump.pcap vlan 4 &'],
1027             ['trafficgen', 'send_traffic',{}],
1028             ['!VNF0', 'execute_and_wait', 'tcpdump -qer dump.pcap vlan 4 2>/dev/null | wc -l','|^(\d+)$'],
1029             ['tools', 'assert', '#STEP[-1][0] == 5'],
1030         ],
1031     },
1032 ]
1033 # Capture Example 2 - Setup with 2 NICs, where traffic is captured after it is
1034 # processed by NIC under the test (2nd NIC). See documentation for further details.
1035 # This TestCase will strip VLAN headers from traffic sent by the traffic generator.
1036 # The removal of VLAN headers is verified by inspection of captured frames.
1037 #
1038 # NOTE: This setup expects a DUT with two NICs with two ports each. First NIC is
1039 # connected to the traffic generator (standard VSPERF setup). Ports of a second NIC
1040 # are interconnected by a patch cable. PCI addresses of all four ports have to be
1041 # properly configured in the WHITELIST_NICS parameter.
1042 _CAPTURE_P2P2P_OVS_ACTION = ''
1043 _CAPTURE_P2P2P_SETUP = [
1044         # restore original NICS configuration, so we can refer to NICS elements
1045         ['settings', 'resetValue', 'WHITELIST_NICS'],
1046         ['settings', 'resetValue', 'NICS'],
1047         # create and configure two bridges to forward traffic through NIC under
1048         # the test and back to the traffic generator
1049         # 1st bridge:
1050         ['vswitch', 'add_switch', 'br0'],
1051         ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[0]["device"]'],
1052         ['tools', 'exec_shell', 'sudo ip link set dev $NICS[0]["device"] up'],
1053         ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br0 $NICS[0]["device"]'],
1054         ['tools', 'exec_shell', 'sudo $TOOLS["bind-tool"] --bind igb_uio $NICS[3]["pci"]'],
1055         ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br0 dpdk0 -- '
1056                                 'set Interface dpdk0 type=dpdk options:dpdk-devargs=$NICS[3]["pci"]'],
1057         ['tools', 'exec_shell', '$TOOLS["ovs-ofctl"] add-flow br0 in_port=1,action='
1058                                 '$_CAPTURE_P2P2P_OVS_ACTION,output:2'],
1059         # 2nd bridge:
1060         ['vswitch', 'add_switch', 'br1'],
1061         ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[2]["device"]'],
1062         ['tools', 'exec_shell', 'sudo ip link set dev $NICS[2]["device"] up'],
1063         ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br1 $NICS[2]["device"]'],
1064         ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[1]["device"]'],
1065         ['tools', 'exec_shell', 'sudo ip link set dev $NICS[1]["device"] up'],
1066         ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br1 $NICS[1]["device"]'],
1067         ['vswitch', 'add_flow', 'br1', {'in_port': '1', 'actions': ['output:2']}],
1068         # log flow details
1069         ['vswitch', 'dump_flows', 'br0'],
1070         ['vswitch', 'dump_flows', 'br1'],
1071 ]
1072 INTEGRATION_TESTS += [
1073     {
1074         "Name": "capture_p2p2p_strip_vlan_ovs",
1075         "Deployment": "clean",
1076         "Description": "P2P Continuous Stream",
1077         "Parameters" : {
1078             "_CAPTURE_P2P2P_OVS_ACTION" : 'strip_vlan',
1079             "TRAFFIC" : {
1080                 "bidir" : "False",
1081                 "traffic_type" : "rfc2544_continuous",
1082                 "frame_rate" : 100,
1083                 'l2': {
1084                     'srcmac': "ca:fe:00:00:00:00",
1085                     'dstmac': "00:00:00:00:00:01"
1086                 },
1087                 'vlan': {
1088                     'enabled': True,
1089                     'id': 8,
1090                     'priority': 1,
1091                     'cfi': 0,
1092                 },
1093             },
1094             # suppress DPDK configuration, so physical interfaces are not bound to DPDK driver
1095             'WHITELIST_NICS' : [],
1096             'NICS' : [],
1097         },
1098         "TestSteps": _CAPTURE_P2P2P_SETUP + [
1099             # capture traffic after processing by NIC under the test (after possible egress HW offloading)
1100             ['tools', 'exec_shell_background', 'tcpdump -i $NICS[2]["device"] -c 5 -w capture.pcap '
1101                                                'ether src $TRAFFIC["l2"]["srcmac"]'],
1102             ['trafficgen', 'send_traffic', {}],
1103             ['vswitch', 'dump_flows', 'br0'],
1104             ['vswitch', 'dump_flows', 'br1'],
1105             # there must be 5 captured frames...
1106             ['tools', 'exec_shell', 'tcpdump -r capture.pcap | wc -l', '|^(\d+)$'],
1107             ['tools', 'assert', '#STEP[-1][0] == 5'],
1108             # ...but no vlan headers
1109             ['tools', 'exec_shell', 'tcpdump -r capture.pcap vlan | wc -l', '|^(\d+)$'],
1110             ['tools', 'assert', '#STEP[-1][0] == 0'],
1111         ],
1112     },
1113     # Capture Example 3 - Traffic capture by traffic generator.
1114     # This TestCase uses OVS flow to add VLAN tag with given ID into every
1115     # frame send by traffic generator. Correct frame modificaiton is verified by
1116     # inspection of packet capture received by T-Rex.
1117     {
1118         "Name": "capture_p2p_add_vlan_ovs_trex",
1119         "Deployment": "clean",
1120         "Description": "OVS: Test VLAN tag modification and verify it by traffic capture",
1121         "vSwitch" : "OvsDpdkVhost", # works also for Vanilla OVS
1122         "Parameters" : {
1123             "TRAFFICGEN" : "Trex",
1124             "TRAFFICGEN_TREX_LEARNING_MODE" : True,
1125             "TRAFFIC" : {
1126                 "traffic_type" : "burst",
1127                 "frame_rate" : 100,
1128                 "burst_size" : 5,
1129                 # enable capture of five RX frames
1130                 'capture': {
1131                     'enabled': True,
1132                     'tx_ports' : [],
1133                     'rx_ports' : [1],
1134                     'count' : 5,
1135                 },
1136             },
1137         },
1138         "TestSteps" : STEP_VSWITCH_P2P_INIT + [
1139             # replace standard L2 flows by flows, which will add VLAN tag with ID 3
1140             ['!vswitch', 'add_flow', 'int_br0', {'in_port': '1', 'actions': ['mod_vlan_vid:3','output:2']}],
1141             ['!vswitch', 'add_flow', 'int_br0', {'in_port': '2', 'actions': ['mod_vlan_vid:3','output:1']}],
1142             ['vswitch', 'dump_flows', 'int_br0'],
1143             ['trafficgen', 'send_traffic', {}],
1144             ['trafficgen', 'get_results'],
1145             # verify that captured frames have vlan tag with ID 3
1146             ['tools', 'exec_shell', 'tcpdump -qer $RESULTS_PATH/#STEP[-1][0]["capture_rx"] vlan 3 '
1147                                     '2>/dev/null | wc -l', '|^(\d+)$'],
1148             # number of received frames with expected VLAN id must match the number of captured frames
1149             ['tools', 'assert', '#STEP[-1][0] == 5'],
1150         ] + STEP_VSWITCH_P2P_FINIT,
1151     },
1152     #
1153     # End of examples of functional testcases with traffic capture validation
1154     #
1155 ]
1156
1157 # Example of TC definition with exact vSwitch, VNF and TRAFFICGEN values.
1158 #    {
1159 #        "Name": "ovs_vanilla_linux_bridge_pvp_cont",
1160 #        "Deployment": "clean",
1161 #        "Description": "vSwitch - configure OVS Vanilla, QemuVirtioNet with linux bridge and execute continuous stream test",
1162 #        "vSwitch" : "OvsVanilla",
1163 #        "VNF" : "QemuVirtioNet",
1164 #        "Trafficgen": "IxNet",
1165 #        "Parameters": {"GUEST_LOOPBACK" : ["linux_bridge"],},
1166 #        "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
1167 #                     [
1168 #                        ['vnf', 'start'],
1169 #                        ['trafficgen', 'send_traffic', {'traffic_type' : 'rfc2544_continuous', 'bidir' : 'True'}],
1170 #                        ['vnf', 'stop'],
1171 #                     ] +
1172 #                     STEP_VSWITCH_PVP_FLOWS_FINIT
1173 #    },