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