11ce560fd6771dbee58bbe1c937f3c9c5f63ff7f
[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 | | ... | - traffic_profile - Profile name 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] | ${traffic_profile} | ${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} | ${traffic_profile}
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 | | ... | - traffic_profile - Profile name 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] | ${traffic_profile} | ${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} | ${traffic_profile}
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 | | ... | - traffic_profile - Profile name 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] | ${traffic_profile} | ${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} | ${traffic_profile}
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 | | ... | - traffic_profile - Profile name 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] | ${traffic_profile} | ${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} | ${traffic_profile}
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 | | ... | - traffic_profile - Profile name 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] | ${traffic_profile} | ${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} | ${traffic_profile}
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 | | ... | - traffic_profile - Profile name 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] | ${traffic_profile} | ${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} | ${traffic_profile}
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 | | ... | - traffic_profile - Profile name 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] | ${traffic_profile} | ${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 | | ... | traffic_profile=${traffic_profile}
405 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
406 | | ... | ${dut1} | ${dut1_if1_vf0} | ${dut1} | ${dut1_if2_vf0}
407 | | ... | ${traffic_profile}
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 | | ... | - traffic_profile - Profile name 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] | ${traffic_profile} | ${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 | | ... | traffic_profile=${traffic_profile}
436 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
437 | | ... | ${dut1} | ${dut1_if1_vf0} | ${dut2} | ${dut2_if2_vf0}
438 | | ... | ${traffic_profile}
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 | | ... | - traffic_profile - Profile name 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] | ${traffic_profile} | ${nic_name} | ${crypto_type}=HW_DH895xcc
462 | | ...
463 | | Set up 3-node performance topology with DUT's NIC model
464 | | ... | ${traffic_profile} | ${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 3-node performance topology with wrk and DUT's NIC model
530 | | [Documentation]
531 | | ... | Suite preparation phase that sets the default startup configuration of
532 | | ... | VPP on all DUTs. Updates interfaces on all nodes and sets the global
533 | | ... | variables used in test cases based on interface model provided as an
534 | | ... | argument. Installs the traffic generator.
535 | | ...
536 | | ... | *Arguments:*
537 | | ... | - iface_model - Interface model. Type: string
538 | | ...
539 | | ... | *Example:*
540 | | ...
541 | | ... | \| Set up 3-node performance topology with wrk and DUT's NIC model\
542 | | ... | \| Intel-X520-DA2 \|
543 | | ...
544 | | [Arguments] | ${iface_model}
545 | | ...
546 | | Set variables in 3-node circular topology with DUT interface model
547 | | ... | ${iface_model}
548 | | Iface update numa node | ${tg}
549 # Make sure TRex is stopped
550 | | ${running}= | Is TRex running | ${tg}
551 | | Run keyword if | ${running}==${True} | Teardown traffic generator | ${tg}
552 | | ${curr_driver}= | Get PCI dev driver | ${tg}
553 | | ... | ${tg['interfaces']['${tg_if1}']['pci_address']}
554 | | Run keyword if | '${curr_driver}'!='${None}'
555 | | ... | PCI Driver Unbind | ${tg} |
556 | | ... | ${tg['interfaces']['${tg_if1}']['pci_address']}
557 # Bind tg_if1 to driver specified in the topology
558 | | ${driver}= | Get Variable Value | ${tg['interfaces']['${tg_if1}']['driver']}
559 | | PCI Driver Bind | ${tg}
560 | | ... | ${tg['interfaces']['${tg_if1}']['pci_address']} | ${driver}
561 # Set IP on tg_if1
562 | | ${intf_name}= | Get Linux interface name | ${tg}
563 | | ... | ${tg['interfaces']['${tg_if1}']['pci_address']}
564 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.10.1 | 24
565 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.20.1 | 24
566 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.30.1 | 24
567 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.40.1 | 24
568 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.50.1 | 24
569 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.60.1 | 24
570 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.70.1 | 24
571 | | Set Linux interface IP | ${tg} | ${intf_name} | 192.168.80.1 | 24
572 | | Set Linux interface up | ${tg} | ${intf_name}
573 | | Install wrk | ${tg}
574
575 # Suite teardowns
576
577 | Tear down 2-node performance topology
578 | | [Documentation]
579 | | ... | Suite teardown phase with traffic generator teardown.
580 | | ...
581 | | Teardown traffic generator | ${tg}
582
583 | Tear down 3-node performance topology
584 | | [Documentation]
585 | | ... | Suite teardown phase with traffic generator teardown.
586 | | ...
587 | | Teardown traffic generator | ${tg}
588
589 # Tests setups
590
591 | Set up performance test
592 | | [Documentation] | Common test setup for performance tests.
593 | | ...
594 | | Reset PAPI History On All DUTs | ${nodes}
595 | | Create base startup configuration of VPP on all DUTs
596
597 | Set up tcp performance test
598 | | [Documentation] | Common test setup for TCP performance tests.
599 | | ...
600 | | Reset PAPI History On All DUTs | ${nodes}
601 | | Create base startup configuration of VPP for TCP tests on all DUTs
602
603 | Set up performance test with Ligato Kubernetes
604 | | [Documentation] | Common test setup for performance tests with Ligato \
605 | | ... | Kubernetes.
606 | | ...
607 | | Apply Kubernetes resource on all duts | ${nodes} | namespaces/csit.yaml
608 | | Apply Kubernetes resource on all duts | ${nodes} | pods/kafka.yaml
609 | | Apply Kubernetes resource on all duts | ${nodes} | pods/etcdv3.yaml
610 | | Apply Kubernetes resource on all duts | ${nodes}
611 | | ... | configmaps/vswitch-agent-cfg.yaml
612 | | Apply Kubernetes resource on all duts | ${nodes}
613 | | ... | configmaps/vnf-agent-cfg.yaml
614 | | Apply Kubernetes resource on all duts | ${nodes}
615 | | ... | pods/contiv-sfc-controller.yaml
616 | | Apply Kubernetes resource on all duts | ${nodes}
617 | | ... | pods/contiv-vswitch.yaml
618
619 | Set up performance test with containers
620 | | [Documentation]
621 | | ... | Common test setup for performance tests with containers
622 | | ...
623 | | ... | *Arguments:*
624 | | ... | - chains: Total number of chains. Type: integer
625 | | ... | - nodeness: Total number of nodes per chain. Type: integer
626 | | ... | - auto_scale - If True, use same amount of Dataplane threads for
627 | | ... |   network function as DUT, otherwise use single physical core for
628 | | ... |   every network function. Type: boolean
629 | | ...
630 | | ... | *Example:*
631 | | ...
632 | | ... | \| Set up performance test with containers \| 1 \| 1 \|
633 | | ...
634 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
635 | | ...
636 | | Set Test Variable | @{container_groups} | @{EMPTY}
637 | | Set Test Variable | ${container_group} | CNF
638 | | Set Test Variable | ${nf_nodes}
639 | | Import Library | resources.libraries.python.ContainerUtils.ContainerManager
640 | | ... | engine=${container_engine} | WITH NAME | ${container_group}
641 | | Construct chains of containers on all DUTs | ${nf_chains} | ${nf_nodes}
642 | | ... | auto_scale=${auto_scale}
643 | | Acquire all '${container_group}' containers
644 | | Create all '${container_group}' containers
645 | | Configure VPP in all '${container_group}' containers
646 | | Stop VPP service on all DUTs | ${nodes}
647 | | Start VPP in all '${container_group}' containers
648 | | Start VPP service on all DUTs | ${nodes}
649 | | Append To List | ${container_groups} | ${container_group}
650
651 # Tests teardowns
652
653 | Tear down performance test
654 | | [Documentation] | Common test teardown for performance tests.
655 | | ...
656 | | ... | TODO: Rename to "Tear down VPP performance test"?
657 | | ... |       most steps do not apply to DPDK nor other vswitch solutions.
658 | | ... | TODO: Document at least some steps this keyword takes.
659 | | ...
660 | | ... | To save space in suites, this keyword does not accept
661 | | ... | any explicit arguments. Instead, it requires few variables
662 | | ... | to be defined in at least test scope.
663 | | ...
664 | | ... | *Test Variables needed:*
665 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
666 | | ... | - traffic_profile - Profile name to initialize TG with. Type: string
667 | | ... | - nodes - Parsed information object. Type: dict
668 | | ...
669 | | ... | *Example:*
670 | | ...
671 | | ... | \| Set Test Variable \| \${frame_size} \| 64 \|
672 | | ... | \| Tear down performance test \|
673 | | ...
674 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
675 | | Show PAPI History On All DUTs | ${nodes}
676 | | Get Core Files on All Nodes | ${nodes}
677 | | Set Test Variable | ${pkt_trace} | ${True}
678 | | Show statistics on all DUTs | ${nodes}
679 | | Run Keyword If Test Failed
680 | | ... | Traffic should pass with no loss | ${perf_trial_duration} | 10000pps
681 | | ... | ${frame_size} | ${traffic_profile} | fail_on_loss=${False}
682
683 | Tear down performance test with container
684 | | [Documentation]
685 | | ... | Common test teardown for performance tests which uses containers.
686 | | ...
687 | | ... | TODO: Call Tear down performance test?
688 | | ...
689 | | :FOR | ${container_group} | IN | @{container_groups}
690 | | | Destroy all '${container_group}' containers
691
692 | Tear down performance test with vhost
693 | | [Documentation] | Common test teardown for performance tests which use
694 | | ... | vhost(s) and VM(s).
695 | | ...
696 | | Tear down performance test
697 | | Show VPP vhost on all DUTs | ${nodes}
698 | | Tear down guest VM
699
700 | Tear down performance test with vhost and VM with dpdk-testpmd
701 | | [Documentation] | Common test teardown for performance tests which use
702 | | ... | vhost(s) and VM(s) with dpdk-testpmd.
703 | | ...
704 | | ... | *Test Variables needed:*
705 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
706 | | ... | - traffic_profile - Profile name to initialize TG with. Type: string
707 | | ...
708 | | ... | *Arguments:*
709 | | ... | - dut1_node - Node where to clean qemu. Type: dictionary
710 | | ... | - dut1_vm_refs - VM references on node. Type: dictionary
711 | | ... | - dut2_node - Node where to clean qemu. Type: dictionary
712 | | ... | - dut2_vm_refs - VM references on node. Type: dictionary
713 | | ...
714 | | ... | *Example:*
715 | | ...
716 | | ... | \| Tear down performance test with vhost and VM with dpdk-testpmd \
717 | | ... | \| ${node['DUT1']} \| ${dut_vm_refs} \
718 | | ... | \| ${node['DUT2']} \| ${dut_vm_refs} \|
719 | | ...
720 | | [Arguments] | ${dut1_node}=${None} | ${dut1_vm_refs}=${None}
721 | | ... | ${dut2_node}=${None} | ${dut2_vm_refs}=${None}
722 | | ...
723 | | Tear down performance test
724 | | Show VPP vhost on all DUTs | ${nodes}
725 | | Run keyword unless | ${dut1_node}==${None}
726 | | ... | Tear down guest VM with dpdk-testpmd | ${dut1} | ${dut1_vm_refs}
727 | | Run keyword unless | ${dut2_node}==${None}
728 | | ... | Tear down guest VM with dpdk-testpmd | ${dut2} | ${dut2_vm_refs}
729
730 | Tear down performance test with vhost and VM with dpdk-testpmd and ACL
731 | | [Documentation] | Common test teardown for performance tests which use
732 | | ... | vhost(s) and VM(s) with ACL and dpdk-testpmd.
733 | | ...
734 | | ... | *Test Variables needed:*
735 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
736 | | ... | - traffic_profile - Profile name to initialize TG with. Type: string
737 | | ...
738 | | ... | *Arguments:*
739 | | ... | - dut1_node - Node where to clean qemu. Type: dictionary
740 | | ... | - dut1_vm_refs - VM references on node. Type: dictionary
741 | | ... | - dut2_node - Node where to clean qemu. Type: dictionary
742 | | ... | - dut2_vm_refs - VM references on node. Type: dictionary
743 | | ...
744 | | [Arguments] | ${dut1_node}=${None} | ${dut1_vm_refs}=${None}
745 | | ... | ${dut2_node}=${None} | ${dut2_vm_refs}=${None}
746 | | ...
747 | | Tear down performance test with vhost and VM with dpdk-testpmd
748 | | ... | ${dut1_node} | ${dut1_vm_refs}
749 | | ... | ${dut2_node} | ${dut2_vm_refs}
750 | | Run Keyword If Test Failed | Vpp Log Plugin Acl Settings | ${dut1}
751 | | Run Keyword If Test Failed | Run Keyword And Ignore Error
752 | | ... | Vpp Log Plugin Acl Interface Assignment | ${dut1}
753
754 | Tear down DPDK 2-node performance topology
755 | | [Documentation]
756 | | ... | Suite teardown phase with traffic generator teardown.
757 | | ... | Cleanup DPDK test environment.
758 | | ...
759 | | ... | TODO: Add "Traffic should pass with no loss" with min rate
760 | | ... | on failure, as in the VPP test teardown?
761 | | ...
762 | | Teardown traffic generator | ${tg}
763 | | Cleanup DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2}
764
765 | Tear down DPDK 3-node performance topology
766 | | [Documentation]
767 | | ... | Suite teardown phase with traffic generator teardown.
768 | | ... | Cleanup DPDK test environment.
769 | | ...
770 | | ... | TODO: Add "Traffic should pass with no loss" with min rate
771 | | ... | on failure, as in the VPP test teardown?
772 | | ...
773 | | Teardown traffic generator | ${tg}
774 | | Cleanup DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2}
775 | | Cleanup DPDK Environment | ${dut2} | ${dut2_if1} | ${dut2_if2}
776
777 | Tear down performance test with NAT
778 | | [Documentation] | Common test teardown for performance \
779 | | ... | tests with NAT feature used.
780 | | ...
781 | | ... | *Test Variables needed:*
782 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
783 | | ... | - traffic_profile - Profile name to initialize TG with. Type: string
784 | | ...
785 | | ... | *Example:*
786 | | ...
787 | | ... | \| Tear down performance test with NAT \|
788 | | ...
789 | | Tear down performance test
790 | | Show NAT verbose | ${dut1}
791 | | Show NAT verbose | ${dut2}
792
793 | Tear down performance test with ACL
794 | | [Documentation] | Common test teardown for performance \
795 | | ... | tests with ACL feature used.
796 | | ...
797 | | ... | *Test Variables needed:*
798 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
799 | | ... | - traffic_profile - Profile name to initialize TG with. Type: string
800 | | ...
801 | | ... | *Example:*
802 | | ...
803 | | ... | \| Tear down performance test with ACL \|
804 | | ...
805 | | Tear down performance test
806 | | Run Keyword If Test Failed | Vpp Log Plugin Acl Settings | ${dut1}
807 | | Run Keyword If Test Failed | Run Keyword And Ignore Error
808 | | ... | Vpp Log Plugin Acl Interface Assignment | ${dut1}
809
810 | Tear down performance test with MACIP ACL
811 | | [Documentation] | Common test teardown for performance \
812 | | ... | tests with MACIP ACL feature used.
813 | | ...
814 | | ... | *Test Variables needed:*
815 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
816 | | ... | - traffic_profile - Profile name to initialize TG with. Type: string
817 | | ...
818 | | ... | *Example:*
819 | | ...
820 | | ... | \| Tear down performance test with MACIP ACL \|
821 | | ...
822 | | Tear down performance test
823 | | Run Keyword If Test Failed | Run Keyword And Ignore Error
824 | | ... | Vpp Log Macip Acl Settings | ${dut1}
825 | | Run Keyword And Ignore Error
826 | | ... | Vpp Log Macip Acl Interface Assignment | ${dut1}
827
828 | Tear down performance test with Ligato Kubernetes
829 | | [Documentation] | Common test teardown for performance \
830 | | ... | tests with Ligato Kubernetes.
831 | | ...
832 | | ... | TODO: Call Tear down performance test?
833 | | ...
834 | | Run Keyword If Test Failed
835 | | ... | Get Kubernetes logs on all DUTs | ${nodes} | csit
836 | | Run Keyword If Test Failed
837 | | ... | Describe Kubernetes resource on all DUTs | ${nodes} | csit
838 | | Delete Kubernetes resource on all DUTs | ${nodes} | csit
839
840 | Tear down performance test with SRv6 with encapsulation
841 | | [Documentation] | Common test teardown for performance \
842 | | ... | tests with SRv6 with encapsulation feature used.
843 | | ...
844 | | ... | *Test Variables needed:*
845 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
846 | | ... | - traffic_profile - Profile name to initialize TG with. Type: string
847 | | ...
848 | | ... | *Example:*
849 | | ...
850 | | ... | \| Tear down performance test with SRv6 with encapsulation \|
851 | | ...
852 | | Tear down performance test
853 | | Run Keyword If Test Failed | Show SR Policies on all DUTs | ${nodes}
854 | | Run Keyword If Test Failed
855 | | ... | Show SR Steering Policies on all DUTs | ${nodes}
856 | | Run Keyword If Test Failed | Show SR LocalSIDs on all DUTs | ${nodes}