FIX: Crypto tests
[csit.git] / resources / libraries / robot / performance / performance_setup.robot
1 # Copyright (c) 2019 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Library | resources.libraries.python.DUTSetup
16 | Library | resources.tools.wrk.wrk
17 | Resource | resources/libraries/robot/performance/performance_configuration.robot
18 | Resource | resources/libraries/robot/performance/performance_limits.robot
19 | Resource | resources/libraries/robot/performance/performance_utils.robot
20 | Resource | resources/libraries/robot/tcp/tcp_setup.robot
21 | Documentation | Performance suite keywords - Suite and test setups and
22 | ... | teardowns.
23
24 *** Keywords ***
25
26 # Keywords used in setups and teardowns
27
28 | Set variables in 2-node circular topology with DUT interface model
29 | | [Documentation]
30 | | ... | Compute path for testing on two given nodes in circular topology
31 | | ... | based on interface model provided as an argument and set
32 | | ... | corresponding suite variables.
33 | | ...
34 | | ... | *Arguments:*
35 | | ... | - iface_model - Interface model. Type: string
36 | | ...
37 | | ... | _NOTE:_ This KW sets following suite variables:
38 | | ... | - tg - TG node
39 | | ... | - tg_if1 - 1st TG interface towards DUT.
40 | | ... | - tg_if1 - 1st TG interface MAC address.
41 | | ... | - tg_if2 - 2nd TG interface towards DUT.
42 | | ... | - tg_if2 - 2nd TG interface MAC address.
43 | | ... | - dut1 - DUT1 node
44 | | ... | - dut1_if1 - 1st DUT interface towards TG.
45 | | ... | - dut1_if2 - 2nd DUT interface towards TG.
46 | | ...
47 | | ... | *Example:*
48 | | ...
49 | | ... | \| Set variables in 2-node circular topology with DUT interface model\
50 | | ... | \| Intel-X520-DA2 \|
51 | | ...
52 | | [Arguments] | ${iface_model}
53 | | ...
54 | | ${iface_model_list}= | Create list | ${iface_model}
55 | | Append Node | ${nodes['TG']}
56 | | Append Node | ${nodes['DUT1']} | filter_list=${iface_model_list}
57 | | Append Node | ${nodes['TG']}
58 | | Compute Path | always_same_link=${FALSE}
59 | | ${tg_if1} | ${tg}= | First Interface
60 | | ${dut1_if1} | ${dut1}= | First Ingress Interface
61 | | ${dut1_if2} | ${dut1}= | Last Egress Interface
62 | | ${tg_if2} | ${tg}= | Last Interface
63 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
64 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
65 | | Set Suite Variable | ${tg}
66 | | Set Suite Variable | ${tg_if1}
67 | | Set Suite Variable | ${tg_if1_mac}
68 | | Set Suite Variable | ${tg_if2}
69 | | Set Suite Variable | ${tg_if2_mac}
70 | | Set Suite Variable | ${dut1}
71 | | Set Suite Variable | ${dut1_if1}
72 | | Set Suite Variable | ${dut1_if2}
73
74 | Set variables in 3-node circular topology with DUT interface model
75 | | [Documentation]
76 | | ... | Compute path for testing on three given nodes in circular topology
77 | | ... | based on interface model provided as an argument and set
78 | | ... | corresponding suite variables.
79 | | ...
80 | | ... | *Arguments:*
81 | | ... | - iface_model - Interface model. Type: string
82 | | ...
83 | | ... | _NOTE:_ This KW sets following suite variables:
84 | | ... | - tg - TG node
85 | | ... | - tg_if1 - 1st TG interface towards DUT.
86 | | ... | - tg_if1 - 1st TG interface MAC address.
87 | | ... | - tg_if2 - 2nd TG interface towards DUT.
88 | | ... | - tg_if2 - 2nd TG interface MAC address.
89 | | ... | - dut1 - DUT1 node
90 | | ... | - dut1_if1 - DUT1 interface towards TG.
91 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
92 | | ... | - dut2 - DUT2 node
93 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
94 | | ... | - dut2_if2 - DUT2 interface towards TG.
95 | | ...
96 | | ... | *Example:*
97 | | ...
98 | | ... | \| Set variables in 3-node circular topology with DUT interface model\
99 | | ... | \| Intel-X520-DA2 \|
100 | | ...
101 | | [Arguments] | ${iface_model}
102 | | ...
103 | | ${iface_model_list}= | Create list | ${iface_model}
104 | | Append Node | ${nodes['TG']}
105 | | Append Node | ${nodes['DUT1']} | filter_list=${iface_model_list}
106 | | Append Node | ${nodes['DUT2']} | filter_list=${iface_model_list}
107 | | Append Node | ${nodes['TG']}
108 | | Compute Path
109 | | ${tg_if1} | ${tg}= | Next Interface
110 | | ${dut1_if1} | ${dut1}= | Next Interface
111 | | ${dut1_if2} | ${dut1}= | Next Interface
112 | | ${dut2_if1} | ${dut2}= | Next Interface
113 | | ${dut2_if2} | ${dut2}= | Next Interface
114 | | ${tg_if2} | ${tg}= | Next Interface
115 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
116 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
117 | | Set Suite Variable | ${tg}
118 | | Set Suite Variable | ${tg_if1}
119 | | Set Suite Variable | ${tg_if1_mac}
120 | | Set Suite Variable | ${tg_if2}
121 | | Set Suite Variable | ${tg_if2_mac}
122 | | Set Suite Variable | ${dut1}
123 | | Set Suite Variable | ${dut1_if1}
124 | | Set Suite Variable | ${dut1_if2}
125 | | Set Suite Variable | ${dut2}
126 | | Set Suite Variable | ${dut2_if1}
127 | | Set Suite Variable | ${dut2_if2}
128
129 | Set variables in 3-node circular topology with DUT interface model with double link between DUTs
130 | | [Documentation]
131 | | ... | Compute path for testing on three given nodes in circular topology
132 | | ... | with double link between DUTs based on interface model provided as an
133 | | ... | argument and set corresponding suite variables.
134 | | ...
135 | | ... | *Arguments:*
136 | | ... | - iface_model - Interface model. Type: string
137 | | ...
138 | | ... | _NOTE:_ This KW sets following suite variables:
139 | | ... | - tg - TG node
140 | | ... | - tg_if1 - 1st TG interface towards DUT.
141 | | ... | - tg_if1 - 1st TG interface MAC address.
142 | | ... | - tg_if2 - 2nd TG interface towards DUT.
143 | | ... | - tg_if2 - 2nd TG interface MAC address.
144 | | ... | - dut1 - DUT1 node
145 | | ... | - dut1_if1 - DUT1 interface towards TG.
146 | | ... | - dut1_if2_1 - DUT1 interface 1 towards DUT2.
147 | | ... | - dut1_if2_2 - DUT1 interface 2 towards DUT2.
148 | | ... | - dut2 - DUT2 node
149 | | ... | - dut2_if1_1 - DUT2 interface 1 towards DUT1.
150 | | ... | - dut2_if1_2 - DUT2 interface 2 towards DUT1.
151 | | ... | - dut2_if2 - DUT2 interface towards TG.
152 | | ...
153 | | ... | *Example:*
154 | | ...
155 | | ... | \| Set variables in 3-node circular topology with DUT interface model\
156 | | ... | with double link between DUTs \| Intel-X520-DA2 \|
157 | | ...
158 | | [Arguments] | ${iface_model}
159 | | ...
160 | | ${iface_model_list}= | Create list | ${iface_model}
161 | | # Compute path TG - DUT1 with single link in between
162 | | Append Node | ${nodes['TG']}
163 | | Append Node | ${nodes['DUT1']} | filter_list=${iface_model_list}
164 | | Append Node | ${nodes['TG']}
165 | | Compute Path
166 | | ${tg_if1} | ${tg}= | Next Interface
167 | | ${dut1_if1} | ${dut1}= | Next Interface
168 | | # Compute path TG - DUT2 with single link in between
169 | | Clear Path
170 | | Append Node | ${nodes['TG']}
171 | | Append Node | ${nodes['DUT2']} | filter_list=${iface_model_list}
172 | | Append Node | ${nodes['TG']}
173 | | Compute Path
174 | | ${tg_if2} | ${tg}= | Next Interface
175 | | ${dut2_if2} | ${dut2}= | Next Interface
176 | | # Compute path DUT1 - DUT2 with double link in between
177 | | Clear Path
178 | | Append Node | ${nodes['DUT1']} | filter_list=${iface_model_list}
179 | | Append Node | ${nodes['DUT2']} | filter_list=${iface_model_list}
180 | | Append Node | ${nodes['DUT1']} | filter_list=${iface_model_list}
181 | | Compute Path | always_same_link=${FALSE}
182 | | ${dut1_if2_1} | ${dut1}= | First Interface
183 | | ${dut1_if2_2} | ${dut1}= | Last Interface
184 | | ${dut2_if1_1} | ${dut2}= | First Ingress Interface
185 | | ${dut2_if1_2} | ${dut2}= | Last Egress Interface
186 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
187 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
188 | | # Set suite variables
189 | | Set Suite Variable | ${tg}
190 | | Set Suite Variable | ${tg_if1}
191 | | Set Suite Variable | ${tg_if1_mac}
192 | | Set Suite Variable | ${tg_if2}
193 | | Set Suite Variable | ${tg_if2_mac}
194 | | Set Suite Variable | ${dut1}
195 | | Set Suite Variable | ${dut1_if1}
196 | | Set Suite Variable | ${dut1_if2_1}
197 | | Set Suite Variable | ${dut1_if2_2}
198 | | Set Suite Variable | ${dut2}
199 | | Set Suite Variable | ${dut2_if1_1}
200 | | Set Suite Variable | ${dut2_if1_2}
201 | | Set Suite Variable | ${dut2_if2}
202
203 | Tear down guest VM
204 | | [Documentation]
205 | | ... | Stop all qemu processes running on nodes.
206 | | ...
207 | | Run Keyword | vnf_manager.Kill All VMs
208
209 | Tear down guest VM with dpdk-testpmd
210 | | [Documentation]
211 | | ... | Stop all qemu processes with dpdk-testpmd running on ${dut_node}.
212 | | ... | Argument is dictionary of all qemu nodes running with its names.
213 | | ... | Dpdk-testpmd is stopped gracefully with printing stats.
214 | | ...
215 | | ... | *Arguments:*
216 | | ... | - dut_node - Node where to clean qemu. Type: dictionary
217 | | ... | - dut_vm_refs - VM references on node. Type: dictionary
218 | | ...
219 | | ... | *Example:*
220 | | ...
221 | | ... | \| Tear down guest VM with dpdk-testpmd \| ${node['DUT1']} \
222 | | ... | \| ${dut_vm_refs} \|
223 | | ...
224 | | [Arguments] | ${dut_node} | ${dut_vm_refs}
225 | | ${vms_number}= | Get Length | ${dut_vm_refs}
226 | | ${index}= | Set Variable | ${0}
227 | | :FOR | ${vm_name} | IN | @{dut_vm_refs}
228 | | | ${vm}= | Get From Dictionary | ${dut_vm_refs} | ${vm_name}
229 | | | ${index}= | Evaluate | ${index} + 1
230 | | | Dpdk Testpmd Stop | ${vm}
231 | | | Run Keyword If | '${index}' == '${vms_number}' | ${vm_name}.Qemu Kill All
232
233 # Suite setups
234
235 | Set up 2-node performance topology with DUT's NIC model
236 | | [Documentation]
237 | | ... | Suite preparation phase that sets the default startup configuration of
238 | | ... | VPP on all DUTs. Updates interfaces on all nodes and sets the global
239 | | ... | variables used in test cases based on interface model provided as an
240 | | ... | argument. Initializes traffic generator.
241 | | ...
242 | | ... | *Arguments:*
243 | | ... | - osi_layer - OSI Layer type to initialize TG with. Type: string
244 | | ... | - nic_name - Interface model. Type: string
245 | | ...
246 | | ... | *Example:*
247 | | ...
248 | | ... | \| 2-node Performance Suite Setup \| L2 \| Intel-X520-DA2 \|
249 | | ...
250 | | [Arguments] | ${osi_layer} | ${nic_name}
251 | | ...
252 | | Set variables in 2-node circular topology with DUT interface model
253 | | ... | ${nic_name}
254 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
255 | | ... | ${dut1} | ${dut1_if1} | ${dut1} | ${dut1_if2} | ${osi_layer}
256
257 | Set up 2-node-switched performance topology with DUT's NIC model
258 | | [Documentation]
259 | | ... | Suite preparation phase that sets the default startup configuration of
260 | | ... | VPP on all DUTs. Updates interfaces on all nodes and sets the global
261 | | ... | variables used in test cases based on interface model provided as an
262 | | ... | argument. Initializes traffic generator.
263 | | ...
264 | | ... | *Arguments:*
265 | | ... | - osi_layer - OSI Layer type to initialize TG with. Type: string
266 | | ... | - nic_name - Interface model. Type: string
267 | | ... | - tg_if1_dest_mac - Interface 1 destination MAC address. Type: string
268 | | ... | - tg_if2_dest_mac - Interface 2 destination MAC address. Type: string
269 | | ...
270 | | ... | *Example:*
271 | | ...
272 | | ... | \| 2-node Performance Suite Setup \| L2 \| Intel-X520-DA2 \
273 | | ... | \| 22:22:33:44:55:66 \| 22:22:33:44:55:55 \|
274 | | ...
275 | | [Arguments] | ${osi_layer} | ${nic_name} | ${tg_if1_dest_mac}
276 | | ... | ${tg_if2_dest_mac}
277 | | ...
278 | | Set variables in 2-node circular topology with DUT interface model
279 | | ... | ${nic_name}
280 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
281 | | ... | ${dut1} | ${dut1_if1} | ${dut1} | ${dut1_if2} | ${osi_layer}
282 | | ... | ${tg_if1_dest_mac} | ${tg_if2_dest_mac}
283
284 | Set up 3-node performance topology with DUT's NIC model
285 | | [Documentation]
286 | | ... | Suite preparation phase that sets the default startup configuration of
287 | | ... | VPP on all DUTs. Updates interfaces on all nodes and sets the global
288 | | ... | variables used in test cases based on interface model provided as an
289 | | ... | argument. Initializes traffic generator.
290 | | ...
291 | | ... | *Arguments:*
292 | | ... | - osi_layer - OSI Layer type to initialize TG with. Type: string
293 | | ... | - nic_name - Interface model. Type: string
294 | | ...
295 | | ... | *Example:*
296 | | ...
297 | | ... | \| Set up 3-node performance topology with DUT's NIC model \| L2 \
298 | | ... | \| Intel-X520-DA2 \|
299 | | ...
300 | | [Arguments] | ${osi_layer} | ${nic_name}
301 | | ...
302 | | Set variables in 3-node circular topology with DUT interface model
303 | | ... | ${nic_name}
304 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
305 | | ... | ${dut1} | ${dut1_if1} | ${dut2} | ${dut2_if2} | ${osi_layer}
306
307 | Set up 3-node performance topology with DUT's NIC model with double link between DUTs
308 | | [Documentation]
309 | | ... | Suite preparation phase that sets the default startup configuration of
310 | | ... | VPP on all DUTs. Updates interfaces on all nodes and sets the global
311 | | ... | variables used in test cases based on interface model provided as an
312 | | ... | argument. Initializes traffic generator.
313 | | ...
314 | | ... | *Arguments:*
315 | | ... | - osi_layer - OSI Layer type to initialize TG with. Type: string
316 | | ... | - nic_name - Interface model. Type: string
317 | | ...
318 | | ... | *Example:*
319 | | ...
320 | | ... | \| Set up 3-node performance topology with DUT's NIC model with \
321 | | ... | double link between DUTs \| L2 \| Intel-X520-DA2 \|
322 | | ...
323 | | [Arguments] | ${osi_layer} | ${nic_name}
324 | | ...
325 | | Set variables in 3-node circular topology with DUT interface model with double link between DUTs
326 | | ... | ${nic_name}
327 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
328 | | ... | ${dut1} | ${dut1_if1} | ${dut2} | ${dut2_if2} | ${osi_layer}
329
330 | Set up DPDK 2-node performance topology with DUT's NIC model
331 | | [Documentation]
332 | | ... | Updates interfaces on all nodes and sets the global
333 | | ... | variables used in test cases based on interface model provided as an
334 | | ... | argument. Initializes traffic generator. Initializes DPDK test
335 | | ... | environment.
336 | | ...
337 | | ... | *Arguments:*
338 | | ... | - osi_layer - OSI Layer type to initialize TG with. Type: string
339 | | ... | - nic_name - Interface model. Type: string
340 | | ...
341 | | ... | *Example:*
342 | | ...
343 | | ... | \| Set up DPDK 2-node performance topology with DUT's NIC model \
344 | | ... | \| L2 \| Intel-X520-DA2 \|
345 | | ...
346 | | [Arguments] | ${osi_layer} | ${nic_name}
347 | | ...
348 | | Set variables in 2-node circular topology with DUT interface model
349 | | ... | ${nic_name}
350 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
351 | | ... | ${dut1} | ${dut1_if1} | ${dut1} | ${dut1_if2} | ${osi_layer}
352 | | Initialize DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2}
353
354 | Set up DPDK 3-node performance topology with DUT's NIC model
355 | | [Documentation]
356 | | ... | Updates interfaces on all nodes and sets the global
357 | | ... | variables used in test cases based on interface model provided as an
358 | | ... | argument. Initializes traffic generator. Initializes DPDK test
359 | | ... | environment.
360 | | ...
361 | | ... | *Arguments:*
362 | | ... | - osi_layer - OSI Layer type to initialize TG with. Type: string
363 | | ... | - nic_name - Interface model. Type: string
364 | | ...
365 | | ... | *Example:*
366 | | ...
367 | | ... | \| 3-node Performance Suite Setup \| L2 \| Intel-X520-DA2 \|
368 | | ...
369 | | [Arguments] | ${osi_layer} | ${nic_name}
370 | | ...
371 | | Set variables in 3-node circular topology with DUT interface model
372 | | ... | ${nic_name}
373 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
374 | | ... | ${dut1} | ${dut1_if1} | ${dut2} | ${dut2_if2} | ${osi_layer}
375 | | Initialize DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2}
376 | | Initialize DPDK Environment | ${dut2} | ${dut2_if1} | ${dut2_if2}
377
378 | Set up SRIOV 2-node performance topology with DUT's NIC model
379 | | [Documentation]
380 | | ... | Suite preparation phase that sets default startup configuration of
381 | | ... | VPP on all DUTs. Updates interfaces on all nodes and sets global
382 | | ... | variables used in test cases based on interface model provided as an
383 | | ... | argument. Initializes traffic generator.
384 | | ... | It configures PCI device with VFs on all DUTs.
385 | | ...
386 | | ... | *Arguments:*
387 | | ... | - osi_layer - OSI Layer type to initialize TG with. Type: string
388 | | ... | - nic_name - Interface model. Type: string
389 | | ... | - vf_driver - Virtual function driver. Type: string
390 | | ... | - numvfs - Number of VFs. Type: integer
391 | | ...
392 | | ... | *Example:*
393 | | ...
394 | | ... | \| Set up SRIOV 2-node performance topology with DUT's NIC model \
395 | | ... | \| L2 \| Intel-X520-DA2 \| AVF \|
396 | | ...
397 | | [Arguments] | ${osi_layer} | ${nic_name} | ${vf_driver}
398 | | ... | ${numvfs}=${1}
399 | | ...
400 | | Set variables in 2-node circular topology with DUT interface model
401 | | ... | ${nic_name}
402 | | Run Keyword If | '${vf_driver}' == 'AVF'
403 | | ... | Configure AVF interfaces on all DUTs | numvfs=${numvfs}
404 | | ... | osi_layer=${osi_layer}
405 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
406 | | ... | ${dut1} | ${dut1_if1_vf0} | ${dut1} | ${dut1_if2_vf0}
407 | | ... | ${osi_layer}
408
409 | Set up SRIOV 3-node performance topology with DUT's NIC model
410 | | [Documentation]
411 | | ... | Suite preparation phase that sets default startup configuration of
412 | | ... | VPP on all DUTs. Updates interfaces on all nodes and sets global
413 | | ... | variables used in test cases based on interface model provided as an
414 | | ... | argument. Initializes traffic generator.
415 | | ... | It configures PCI device with VFs on all DUTs.
416 | | ...
417 | | ... | *Arguments:*
418 | | ... | - osi_layer - OSI Layer type to initialize TG with. Type: string
419 | | ... | - nic_name - Interface model. Type: string
420 | | ... | - vf_driver - Virtual function driver. Type: string
421 | | ... | - numvfs - Number of VFs. Type: integer
422 | | ...
423 | | ... | *Example:*
424 | | ...
425 | | ... | \| Set up SRIOV 3-node performance topology with DUT's NIC model \
426 | | ... | \| L2 \| Intel-X520-DA2 \| AVF \|
427 | | ...
428 | | [Arguments] | ${osi_layer} | ${nic_name} | ${vf_driver}
429 | | ... | ${numvfs}=${1}
430 | | ...
431 | | Set variables in 3-node circular topology with DUT interface model
432 | | ... | ${nic_name}
433 | | Run Keyword If | '${vf_driver}' == 'AVF'
434 | | ... | Configure AVF interfaces on all DUTs | numvfs=${numvfs}
435 | | ... | osi_layer=${osi_layer}
436 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
437 | | ... | ${dut1} | ${dut1_if1_vf0} | ${dut2} | ${dut2_if2_vf0}
438 | | ... | ${osi_layer}
439
440 | Set up IPSec performance test suite
441 | | [Documentation]
442 | | ... | Suite preparation phase that sets default startup configuration of
443 | | ... | VPP on all DUTs. Updates interfaces on all nodes and sets global
444 | | ... | variables used in test cases based on interface model provided as an
445 | | ... | argument. Initializes traffic generator.
446 | | ... | Then it configures crypto device and kernel module on all DUTs.
447 | | ...
448 | | ... | TODO CSIT-1481: Crypto HW should be read from topology file instead.
449 | | ...
450 | | ... | *Arguments:*
451 | | ... | - osi_layer - OSI Layer type to initialize TG with. Type: string
452 | | ... | - nic_name - Interface model. Type: string
453 | | ... | - crypto_type - Crypto device type - HW_DH895xcc or HW_C3xxx or
454 | | ... |   SW_cryptodev. Type: string, default value: HW_DH895xcc
455 | | ...
456 | | ... | *Example:*
457 | | ...
458 | | ... | \| Set up IPSec performance test suite \| L2 \
459 | | ... | \| Intel-X520-DA2 \| HW_DH895xcc \|
460 | | ...
461 | | [Arguments] | ${osi_layer} | ${nic_name} | ${crypto_type}=HW_DH895xcc
462 | | ...
463 | | Set up 3-node performance topology with DUT's NIC model
464 | | ... | ${osi_layer} | ${nic_name}
465 | | Return From Keyword If | '${crypto_type}' == 'SW_cryptodev'
466 | | ${numvfs}= | Set Variable If
467 | | ... | '${crypto_type}' == 'HW_DH895xcc' | ${32}
468 | | ... | '${crypto_type}' == 'HW_C3xxx' | ${16}
469 | | Configure crypto device on all DUTs | ${crypto_type} | numvfs=${numvfs}
470 | | ... | force_init=${True}
471 | | Configure kernel module on all DUTs | vfio_pci | force_load=${True}
472
473 | Set up performance test suite with MEMIF
474 | | [Documentation]
475 | | ... | Append memif_plugin.so to the list of enabled plugins.
476 | | ...
477 | | Set Suite Variable | @{plugins_to_enable}
478 | | Append To List | ${plugins_to_enable} | memif_plugin.so
479
480 | Set up performance test suite with NAT
481 | | [Documentation]
482 | | ... | Append nat_plugin.so to the list of enabled plugins.
483 | | ...
484 | | Set Suite Variable | @{plugins_to_enable}
485 | | Append To List | ${plugins_to_enable} | nat_plugin.so
486
487 | Set up performance test suite with ACL
488 | | [Documentation]
489 | | ... | Append acl_plugin.so to the list of enabled plugins.
490 | | ...
491 | | Set Suite Variable | @{plugins_to_enable}
492 | | Append To List | ${plugins_to_enable} | acl_plugin.so
493
494 | Set up performance test suite with AVF driver
495 | | [Documentation]
496 | | ... | Append avf_plugin.so to the list of enabled plugins.
497 | | ...
498 | | Set Suite Variable | @{plugins_to_enable}
499 | | Append To List | ${plugins_to_enable} | avf_plugin.so
500
501 | Set up performance test suite with Static SRv6 proxy
502 | | [Documentation]
503 | | ... | Append srv6as_plugin.so to the list of enabled plugins.
504 | | ...
505 | | Set Suite Variable | @{plugins_to_enable}
506 | | Append To List | ${plugins_to_enable} | srv6as_plugin.so
507
508 | Set up performance test suite with Dynamic SRv6 proxy
509 | | [Documentation]
510 | | ... | Append srv6ad_plugin.so to the list of enabled plugins.
511 | | ...
512 | | Set Suite Variable | @{plugins_to_enable}
513 | | Append To List | ${plugins_to_enable} | srv6ad_plugin.so
514
515 | Set up performance test suite with Masquerading SRv6 proxy
516 | | [Documentation]
517 | | ... | Append srv6am_plugin.so to the list of enabled plugins.
518 | | ...
519 | | Set Suite Variable | @{plugins_to_enable}
520 | | Append To List | ${plugins_to_enable} | srv6am_plugin.so
521
522 | Set up performance test suite with LACP mode link bonding
523 | | [Documentation]
524 | | ... | Append lacp_plugin.so to the list of enabled plugins.
525 | | ...
526 | | Set Suite Variable | @{plugins_to_enable}
527 | | Append To List | ${plugins_to_enable} | lacp_plugin.so
528
529 | Set up performance test suite with crypto ipsecmb
530 | | [Documentation]
531 | | ... | Append crypto_ipsecmb_plugin.so to the list of enabled plugins.
532 | | ...
533 | | Set Suite Variable | @{plugins_to_enable}
534 | | Append To List | ${plugins_to_enable} | crypto_ia32_plugin.so
535 | | Append To List | ${plugins_to_enable} | crypto_ipsecmb_plugin.so
536 | | Append To List | ${plugins_to_enable} | crypto_openssl_plugin.so
537
538 | Set up 3-node performance topology with wrk and DUT's NIC model
539 | | [Documentation]
540 | | ... | Suite preparation phase that sets the default startup configuration of
541 | | ... | VPP on all DUTs. Updates interfaces on all nodes and sets the global
542 | | ... | variables used in test cases based on interface model provided as an
543 | | ... | argument. Installs the traffic generator.
544 | | ...
545 | | ... | *Arguments:*
546 | | ... | - iface_model - Interface model. Type: string
547 | | ...
548 | | ... | *Example:*
549 | | ...
550 | | ... | \| Set up 3-node performance topology with wrk and DUT's NIC model\
551 | | ... | \| Intel-X520-DA2 \|
552 | | ...
553 | | [Arguments] | ${iface_model}
554 | | ...
555 | | Set variables in 3-node circular topology with DUT interface model
556 | | ... | ${iface_model}
557 | | Iface update numa node | ${tg}
558 # Make sure TRex is stopped
559 | | ${running}= | Is TRex running | ${tg}
560 | | Run keyword if | ${running}==${True} | Teardown traffic generator | ${tg}
561 | | ${curr_driver}= | Get PCI dev driver | ${tg}
562 | | ... | ${tg['interfaces']['${tg_if1}']['pci_address']}
563 | | Run keyword if | '${curr_driver}'!='${None}'
564 | | ... | PCI Driver Unbind | ${tg} |
565 | | ... | ${tg['interfaces']['${tg_if1}']['pci_address']}
566 # Bind tg_if1 to driver specified in the topology
567 | | ${driver}= | Get Variable Value | ${tg['interfaces']['${tg_if1}']['driver']}
568 | | PCI Driver Bind | ${tg}
569 | | ... | ${tg['interfaces']['${tg_if1}']['pci_address']} | ${driver}
570 # Set IP on tg_if1
571 | | ${intf_name}= | Get Linux interface name | ${tg}
572 | | ... | ${tg['interfaces']['${tg_if1}']['pci_address']}
573 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.10.1 | 24
574 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.20.1 | 24
575 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.30.1 | 24
576 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.40.1 | 24
577 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.50.1 | 24
578 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.60.1 | 24
579 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.70.1 | 24
580 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.80.1 | 24
581 | | Set Linux interface up | ${tg} | ${intf_name}
582 | | Install wrk | ${tg}
583
584 # Suite teardowns
585
586 | Tear down 2-node performance topology
587 | | [Documentation]
588 | | ... | Suite teardown phase with traffic generator teardown.
589 | | ...
590 | | Teardown traffic generator | ${tg}
591
592 | Tear down 3-node performance topology
593 | | [Documentation]
594 | | ... | Suite teardown phase with traffic generator teardown.
595 | | ...
596 | | Teardown traffic generator | ${tg}
597
598 # Tests setups
599
600 | Set up performance test
601 | | [Documentation] | Common test setup for performance tests.
602 | | ...
603 | | Reset PAPI History On All DUTs | ${nodes}
604 | | Create base startup configuration of VPP on all DUTs
605
606 | Set up tcp performance test
607 | | [Documentation] | Common test setup for TCP performance tests.
608 | | ...
609 | | Reset PAPI History On All DUTs | ${nodes}
610 | | Create base startup configuration of VPP for TCP tests on all DUTs
611
612 | Set up performance test with Ligato Kubernetes
613 | | [Documentation] | Common test setup for performance tests with Ligato \
614 | | ... | Kubernetes.
615 | | ...
616 | | Apply Kubernetes resource on all duts | ${nodes} | namespaces/csit.yaml
617 | | Apply Kubernetes resource on all duts | ${nodes} | pods/kafka.yaml
618 | | Apply Kubernetes resource on all duts | ${nodes} | pods/etcdv3.yaml
619 | | Apply Kubernetes resource on all duts | ${nodes}
620 | | ... | configmaps/vswitch-agent-cfg.yaml
621 | | Apply Kubernetes resource on all duts | ${nodes}
622 | | ... | configmaps/vnf-agent-cfg.yaml
623 | | Apply Kubernetes resource on all duts | ${nodes}
624 | | ... | pods/contiv-sfc-controller.yaml
625 | | Apply Kubernetes resource on all duts | ${nodes}
626 | | ... | pods/contiv-vswitch.yaml
627
628 | Set up performance test with containers
629 | | [Documentation]
630 | | ... | Common test setup for performance tests with containers
631 | | ...
632 | | ... | *Arguments:*
633 | | ... | - chains: Total number of chains. Type: integer
634 | | ... | - nodeness: Total number of nodes per chain. Type: integer
635 | | ... | - auto_scale - If True, use same amount of Dataplane threads for
636 | | ... |   network function as DUT, otherwise use single physical core for
637 | | ... |   every network function. Type: boolean
638 | | ...
639 | | ... | *Example:*
640 | | ...
641 | | ... | \| Set up performance test with containers \| 1 \| 1 \|
642 | | ...
643 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
644 | | ...
645 | | Set Test Variable | @{container_groups} | @{EMPTY}
646 | | Set Test Variable | ${container_group} | CNF
647 | | Set Test Variable | ${nf_nodes}
648 | | Import Library | resources.libraries.python.ContainerUtils.ContainerManager
649 | | ... | engine=${container_engine} | WITH NAME | ${container_group}
650 | | Construct chains of containers on all DUTs | ${nf_chains} | ${nf_nodes}
651 | | ... | auto_scale=${auto_scale}
652 | | Acquire all '${container_group}' containers
653 | | Create all '${container_group}' containers
654 | | Configure VPP in all '${container_group}' containers
655 | | Stop VPP service on all DUTs | ${nodes}
656 | | Start VPP in all '${container_group}' containers
657 | | Start VPP service on all DUTs | ${nodes}
658 | | Append To List | ${container_groups} | ${container_group}
659
660 # Tests teardowns
661
662 | Tear down performance test
663 | | [Documentation] | Common test teardown for performance tests.
664 | | ...
665 | | ... | TODO: Rename to "Tear down VPP performance test"?
666 | | ... |       most steps do not apply to DPDK nor other vswitch solutions.
667 | | ... | TODO: Document at least some steps this keyword takes.
668 | | ...
669 | | ... | To save space in suites, this keyword does not accept
670 | | ... | any explicit arguments. Instead, it requires few variables
671 | | ... | to be defined in at least test scope.
672 | | ...
673 | | ... | *Test Variables needed:*
674 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
675 | | ... | - traffic_profile - Profile name to run debug trial with. Type: string
676 | | ... | - nodes - Parsed information object. Type: dict
677 | | ...
678 | | ... | *Example:*
679 | | ...
680 | | ... | \| Set Test Variable \| \${frame_size} \| 64 \|
681 | | ... | \| Tear down performance test \|
682 | | ...
683 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
684 | | Show PAPI History On All DUTs | ${nodes}
685 | | Get Core Files on All Nodes | ${nodes}
686 | | Set Test Variable | ${pkt_trace} | ${True}
687 | | Show statistics on all DUTs | ${nodes}
688 | | Run Keyword If Test Failed
689 | | ... | Traffic should pass with no loss | ${perf_trial_duration} | 10000pps
690 | | ... | ${frame_size} | ${traffic_profile} | fail_on_loss=${False}
691
692 | Tear down performance test with container
693 | | [Documentation]
694 | | ... | Common test teardown for performance tests which uses containers.
695 | | ...
696 | | ... | TODO: Call Tear down performance test?
697 | | ...
698 | | :FOR | ${container_group} | IN | @{container_groups}
699 | | | Destroy all '${container_group}' containers
700
701 | Tear down performance test with vhost
702 | | [Documentation] | Common test teardown for performance tests which use
703 | | ... | vhost(s) and VM(s).
704 | | ...
705 | | Tear down performance test
706 | | Show VPP vhost on all DUTs | ${nodes}
707 | | Tear down guest VM
708
709 | Tear down performance test with vhost and VM with dpdk-testpmd
710 | | [Documentation] | Common test teardown for performance tests which use
711 | | ... | vhost(s) and VM(s) with dpdk-testpmd.
712 | | ...
713 | | ... | *Test Variables needed:*
714 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
715 | | ... | - traffic_profile - Profile name to run debug trial with. Type: string
716 | | ...
717 | | ... | *Arguments:*
718 | | ... | - dut1_node - Node where to clean qemu. Type: dictionary
719 | | ... | - dut1_vm_refs - VM references on node. Type: dictionary
720 | | ... | - dut2_node - Node where to clean qemu. Type: dictionary
721 | | ... | - dut2_vm_refs - VM references on node. Type: dictionary
722 | | ...
723 | | ... | *Example:*
724 | | ...
725 | | ... | \| Tear down performance test with vhost and VM with dpdk-testpmd \
726 | | ... | \| ${node['DUT1']} \| ${dut_vm_refs} \
727 | | ... | \| ${node['DUT2']} \| ${dut_vm_refs} \|
728 | | ...
729 | | [Arguments] | ${dut1_node}=${None} | ${dut1_vm_refs}=${None}
730 | | ... | ${dut2_node}=${None} | ${dut2_vm_refs}=${None}
731 | | ...
732 | | Tear down performance test
733 | | Show VPP vhost on all DUTs | ${nodes}
734 | | Run keyword unless | ${dut1_node}==${None}
735 | | ... | Tear down guest VM with dpdk-testpmd | ${dut1} | ${dut1_vm_refs}
736 | | Run keyword unless | ${dut2_node}==${None}
737 | | ... | Tear down guest VM with dpdk-testpmd | ${dut2} | ${dut2_vm_refs}
738
739 | Tear down performance test with vhost and VM with dpdk-testpmd and ACL
740 | | [Documentation] | Common test teardown for performance tests which use
741 | | ... | vhost(s) and VM(s) with ACL and dpdk-testpmd.
742 | | ...
743 | | ... | *Test Variables needed:*
744 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
745 | | ... | - traffic_profile - Profile name to run debug trial with. Type: string
746 | | ...
747 | | ... | *Arguments:*
748 | | ... | - dut1_node - Node where to clean qemu. Type: dictionary
749 | | ... | - dut1_vm_refs - VM references on node. Type: dictionary
750 | | ... | - dut2_node - Node where to clean qemu. Type: dictionary
751 | | ... | - dut2_vm_refs - VM references on node. Type: dictionary
752 | | ...
753 | | [Arguments] | ${dut1_node}=${None} | ${dut1_vm_refs}=${None}
754 | | ... | ${dut2_node}=${None} | ${dut2_vm_refs}=${None}
755 | | ...
756 | | Tear down performance test with vhost and VM with dpdk-testpmd
757 | | ... | ${dut1_node} | ${dut1_vm_refs}
758 | | ... | ${dut2_node} | ${dut2_vm_refs}
759 | | Run Keyword If Test Failed | Vpp Log Plugin Acl Settings | ${dut1}
760 | | Run Keyword If Test Failed | Run Keyword And Ignore Error
761 | | ... | Vpp Log Plugin Acl Interface Assignment | ${dut1}
762
763 | Tear down DPDK 2-node performance topology
764 | | [Documentation]
765 | | ... | Suite teardown phase with traffic generator teardown.
766 | | ... | Cleanup DPDK test environment.
767 | | ...
768 | | ... | TODO: Add "Traffic should pass with no loss" with min rate
769 | | ... | on failure, as in the VPP test teardown?
770 | | ...
771 | | Teardown traffic generator | ${tg}
772 | | Cleanup DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2}
773
774 | Tear down DPDK 3-node performance topology
775 | | [Documentation]
776 | | ... | Suite teardown phase with traffic generator teardown.
777 | | ... | Cleanup DPDK test environment.
778 | | ...
779 | | ... | TODO: Add "Traffic should pass with no loss" with min rate
780 | | ... | on failure, as in the VPP test teardown?
781 | | ...
782 | | Teardown traffic generator | ${tg}
783 | | Cleanup DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2}
784 | | Cleanup DPDK Environment | ${dut2} | ${dut2_if1} | ${dut2_if2}
785
786 | Tear down performance test with NAT
787 | | [Documentation] | Common test teardown for performance \
788 | | ... | tests with NAT feature used.
789 | | ...
790 | | ... | *Test Variables needed:*
791 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
792 | | ... | - traffic_profile - Profile name to run debug trial with. Type: string
793 | | ...
794 | | ... | *Example:*
795 | | ...
796 | | ... | \| Tear down performance test with NAT \|
797 | | ...
798 | | Tear down performance test
799 | | Show NAT verbose | ${dut1}
800 | | Show NAT verbose | ${dut2}
801
802 | Tear down performance test with ACL
803 | | [Documentation] | Common test teardown for performance \
804 | | ... | tests with ACL feature used.
805 | | ...
806 | | ... | *Test Variables needed:*
807 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
808 | | ... | - traffic_profile - Profile name to run debug trial with. Type: string
809 | | ...
810 | | ... | *Example:*
811 | | ...
812 | | ... | \| Tear down performance test with ACL \|
813 | | ...
814 | | Tear down performance test
815 | | Run Keyword If Test Failed | Vpp Log Plugin Acl Settings | ${dut1}
816 | | Run Keyword If Test Failed | Run Keyword And Ignore Error
817 | | ... | Vpp Log Plugin Acl Interface Assignment | ${dut1}
818
819 | Tear down performance test with MACIP ACL
820 | | [Documentation] | Common test teardown for performance \
821 | | ... | tests with MACIP ACL feature used.
822 | | ...
823 | | ... | *Test Variables needed:*
824 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
825 | | ... | - traffic_profile - Profile name to run debug trial with. Type: string
826 | | ...
827 | | ... | *Example:*
828 | | ...
829 | | ... | \| Tear down performance test with MACIP ACL \|
830 | | ...
831 | | Tear down performance test
832 | | Run Keyword If Test Failed | Run Keyword And Ignore Error
833 | | ... | Vpp Log Macip Acl Settings | ${dut1}
834 | | Run Keyword And Ignore Error
835 | | ... | Vpp Log Macip Acl Interface Assignment | ${dut1}
836
837 | Tear down performance test with Ligato Kubernetes
838 | | [Documentation] | Common test teardown for performance \
839 | | ... | tests with Ligato Kubernetes.
840 | | ...
841 | | ... | TODO: Call Tear down performance test?
842 | | ...
843 | | Run Keyword If Test Failed
844 | | ... | Get Kubernetes logs on all DUTs | ${nodes} | csit
845 | | Run Keyword If Test Failed
846 | | ... | Describe Kubernetes resource on all DUTs | ${nodes} | csit
847 | | Delete Kubernetes resource on all DUTs | ${nodes} | csit
848
849 | Tear down performance test with SRv6 with encapsulation
850 | | [Documentation] | Common test teardown for performance \
851 | | ... | tests with SRv6 with encapsulation feature used.
852 | | ...
853 | | ... | *Test Variables needed:*
854 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
855 | | ... | - traffic_profile - Profile name to run debug trial with. Type: string
856 | | ...
857 | | ... | *Example:*
858 | | ...
859 | | ... | \| Tear down performance test with SRv6 with encapsulation \|
860 | | ...
861 | | Tear down performance test
862 | | Run Keyword If Test Failed | Show SR Policies on all DUTs | ${nodes}
863 | | Run Keyword If Test Failed
864 | | ... | Show SR Steering Policies on all DUTs | ${nodes}
865 | | Run Keyword If Test Failed | Show SR LocalSIDs on all DUTs | ${nodes}