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