Aligning FUNC/PERF keywords - Data driven
[csit.git] / resources / libraries / robot / shared / default.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 | Variables | resources/libraries/python/topology.py
16 | Variables | resources/libraries/python/PapiHistory.py
17 | Variables | resources/libraries/python/Constants.py
18 | ...
19 | Library | Collections
20 | Library | OperatingSystem
21 | Library | String
22 | ...
23 | Library | resources.libraries.python.CoreDumpUtil
24 | Library | resources.libraries.python.CpuUtils
25 | Library | resources.libraries.python.DUTSetup
26 | Library | resources.libraries.python.L2Util
27 | Library | resources.libraries.python.Namespaces
28 | Library | resources.libraries.python.SchedUtils
29 | Library | resources.libraries.python.Tap
30 | Library | resources.libraries.python.TGSetup
31 | Library | resources.libraries.python.PapiHistory
32 | Library | resources.libraries.python.VppCounters
33 | Library | resources.libraries.python.VPPUtil
34 | Library | resources.libraries.python.Trace
35 | Library | resources.libraries.python.topology.Topology
36 | ...
37 | Resource | resources/libraries/robot/crypto/ipsec.robot
38 | Resource | resources/libraries/robot/performance/performance_configuration.robot
39 | Resource | resources/libraries/robot/performance/performance_limits.robot
40 | Resource | resources/libraries/robot/performance/performance_utils.robot
41 | Resource | resources/libraries/robot/shared/container.robot
42 | Resource | resources/libraries/robot/shared/qemu.robot
43 | Resource | resources/libraries/robot/shared/suite_teardown.robot
44 | Resource | resources/libraries/robot/shared/suite_setup.robot
45 | Resource | resources/libraries/robot/shared/test_teardown.robot
46 | Resource | resources/libraries/robot/shared/test_setup.robot
47 | Resource | resources/libraries/robot/shared/traffic.robot
48
49 *** Keywords ***
50 | Show Vpp Errors On All DUTs
51 | | [Documentation] | Show VPP errors verbose on all DUTs.
52 | | ...
53 | | ${duts}= | Get Matches | ${nodes} | DUT*
54 | | :FOR | ${dut} | IN | @{duts}
55 | | | Vpp Show Errors | ${nodes['${dut}']}
56
57 | Show Bridge Domain Data On All DUTs
58 | | [Documentation] | Show Bridge Domain data on all DUTs.
59 | | ...
60 | | ${duts}= | Get Matches | ${nodes} | DUT*
61 | | :FOR | ${dut} | IN | @{duts}
62 | | | Vpp Get Bridge Domain Data | ${nodes['${dut}']}
63
64 | Configure crypto device on all DUTs
65 | | [Documentation] | Verify if Crypto QAT device virtual functions are
66 | | ... | initialized on all DUTs. If parameter force_init is set to True, then
67 | | ... | try to initialize/disable.
68 | | ...
69 | | ... | *Arguments:*
70 | | ... | - crypto_type - Crypto device type - HW_DH895xcc or HW_C3xxx.
71 | | ... | Type: string, default value: HW_DH895xcc
72 | | ... | - numvfs - Number of VFs to initialize, 0 - disable the VFs
73 | | ... | Type: integer, default value: ${32}
74 | | ... | - force_init - Force to initialize. Type: boolean
75 | | ...
76 | | ... | *Example:*
77 | | ...
78 | | ... | \| Configure crypto device on all DUTs \| HW_DH895xcc \| ${32} \|
79 | | ...
80 | | [Arguments] | ${crypto_type} | ${numvfs} | ${force_init}=${False}
81 | | ...
82 | | :FOR | ${dut} | IN | @{duts}
83 | | | Crypto Device Verify | ${nodes['${dut}']} | ${crypto_type}
84 | | | ... | ${numvfs} | force_init=${force_init}
85
86 | Configure kernel module on all DUTs
87 | | [Documentation] | Verify if specific kernel module is loaded on all DUTs.
88 | | ... | If parameter force_load is set to True, then try to load.
89 | | ...
90 | | ... | *Arguments:*
91 | | ... | - module - Module to verify. Type: string
92 | | ... | - force_load - Try to load module. Type: boolean
93 | | ...
94 | | ... | *Example:*
95 | | ...
96 | | ... | \| Configure kernel module on all DUTs \| ${True} \|
97 | | ...
98 | | [Arguments] | ${module} | ${force_load}=${False}
99 | | ...
100 | | Verify Kernel Module on All DUTs | ${nodes} | ${module}
101 | | ... | force_load=${force_load}
102
103 | Create base startup configuration of VPP on all DUTs
104 | | [Documentation] | Create base startup configuration of VPP to all DUTs.
105 | | ...
106 | | :FOR | ${dut} | IN | @{duts}
107 | | | Import Library | resources.libraries.python.VppConfigGenerator
108 | | | ... | WITH NAME | ${dut}
109 | | | Run keyword | ${dut}.Set Node |  ${nodes['${dut}']}
110 | | | Run keyword | ${dut}.Add Unix Log
111 | | | Run keyword | ${dut}.Add Unix CLI Listen
112 | | | Run keyword | ${dut}.Add Unix Nodaemon
113 | | | Run keyword | ${dut}.Add Unix Coredump
114 | | | Run keyword | ${dut}.Add DPDK No Tx Checksum Offload
115 | | | Run keyword | ${dut}.Add DPDK Log Level | debug
116 | | | Run keyword | ${dut}.Add DPDK Uio Driver
117 | | | Run keyword | ${dut}.Add Heapsize | 4G
118 | | | Run keyword | ${dut}.Add Statseg size | 4G
119 | | | Run keyword | ${dut}.Add Statseg Per Node Counters | on
120 | | | Run keyword | ${dut}.Add Plugin | disable | default
121 | | | Run keyword | ${dut}.Add Plugin | enable | @{plugins_to_enable}
122 | | | Run keyword | ${dut}.Add IP6 Hash Buckets | 2000000
123 | | | Run keyword | ${dut}.Add IP6 Heap Size | 4G
124 | | | Run keyword | ${dut}.Add IP Heap Size | 4G
125
126 | Add worker threads and rxqueues to all DUTs
127 | | [Documentation] | Setup worker threads and rxqueues in vpp startup
128 | | ... | configuration on all DUTs. Based on the SMT configuration of DUT if
129 | | ... | enabled keyword will automatically map also the sibling logical cores.
130 | | ... | Keyword will automatically set the appropriate test TAGs in format
131 | | ... | mTnC, where m=logical_core_count and n=physical_core_count.
132 | | ...
133 | | ... | *Arguments:*
134 | | ... | - phy_cores - Number of physical cores to use. Type: integer
135 | | ... | - rx_queues - Number of RX queues. Type: integer
136 | | ...
137 | | ... | *Example:*
138 | | ...
139 | | ... | \| Add worker threads and rxqueues to all DUTs \| ${1} \| ${1} \|
140 | | ...
141 | | [Arguments] | ${phy_cores} | ${rx_queues}=${None}
142 | | ...
143 | | ${cpu_count_int} | Convert to Integer | ${phy_cores}
144 | | ${thr_count_int} | Convert to Integer | ${phy_cores}
145 | | :FOR | ${dut} | IN | @{duts}
146 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
147 | | | ... | Variable Should Exist | ${${dut}_if1}
148 | | | @{if_list}= | Run Keyword If | '${if1_status}' == 'PASS'
149 | | | ... | Create List | ${${dut}_if1}
150 | | | ... | ELSE | Create List | ${${dut}_if1_1} | ${${dut}_if1_2}
151 | | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
152 | | | ... | Variable Should Exist | ${${dut}_if2}
153 | | | Run Keyword If | '${if2_status}' == 'PASS'
154 | | | ... | Append To List | ${if_list} | ${${dut}_if2}
155 | | | ... | ELSE
156 | | | ... | Append To List | ${if_list} | ${${dut}_if2_1} | ${${dut}_if2_2}
157 | | | ${numa}= | Get interfaces numa node | ${nodes['${dut}']} | @{if_list}
158 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
159 | | | ${skip_cnt}= | Set variable | ${CPU_CNT_SYSTEM}
160 | | | ${cpu_main}= | Cpu list per node str | ${nodes['${dut}']} | ${numa}
161 | | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${CPU_CNT_MAIN}
162 | | | ${skip_cnt}= | Evaluate | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN}
163 | | | ${cpu_wt}= | Run keyword if | ${cpu_count_int} > 0 |
164 | | | ... | Cpu list per node str | ${nodes['${dut}']} | ${numa}
165 | | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${cpu_count_int}
166 | | | ... | smt_used=${smt_used}
167 | | | ${thr_count_int}= | Run keyword if | ${smt_used}
168 | | | ... | Evaluate | int(${cpu_count_int}*2)
169 | | | ... | ELSE | Set variable | ${thr_count_int}
170 | | | ${rxq_count_int}= | Run keyword if | ${rx_queues}
171 | | | ... | Set variable | ${rx_queues}
172 | | | ... | ELSE | Evaluate | int(${thr_count_int}/2)
173 | | | ${rxq_count_int}= | Run keyword if | ${rxq_count_int} == 0
174 | | | ... | Set variable | ${1}
175 | | | ... | ELSE | Set variable | ${rxq_count_int}
176 | | | Run keyword if | ${cpu_count_int} > 0
177 | | | ... | ${dut}.Add CPU Main Core | ${cpu_main}
178 | | | Run keyword if | ${cpu_count_int} > 0
179 | | | ... | ${dut}.Add CPU Corelist Workers | ${cpu_wt}
180 | | | Run keyword
181 | | | ... | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
182 # For now there is no way to easily predict the number of buffers. Statically
183 # doing maximum amount of buffers allowed by DPDK.
184 | | | Run keyword if | ${smt_used}
185 | | | ... | Run keyword | ${dut}.Add Buffers Per Numa | ${215040} | ELSE
186 | | | ... | Run keyword | ${dut}.Add Buffers Per Numa | ${107520}
187 | | | Run keyword if | ${thr_count_int} > 1
188 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
189 | | | Set Tags | ${thr_count_int}T${cpu_count_int}C
190 | | Set Test Variable | ${smt_used}
191 | | Set Test Variable | ${thr_count_int}
192 | | Set Test Variable | ${cpu_count_int}
193 | | Set Test Variable | ${rxq_count_int}
194
195 | Create Kubernetes VSWITCH startup config on all DUTs
196 | | [Documentation] | Create base startup configuration of VSWITCH in Kubernetes
197 | | ... | deploy to all DUTs.
198 | | ...
199 | | ... | *Arguments:*
200 | | ... | - ${jumbo} - Jumbo packet. Type: boolean
201 | | ... | - ${phy_cores} - Physical cores. Type: integer
202 | | ... | - ${rxq} - RX queues. Type: integer
203 | | ...
204 | | ... | *Example:*
205 | | ...
206 | | ... | \| Create Kubernetes VSWITCH startup config on all DUTs \| ${True} \
207 | | ... | \| ${1} \| ${1}
208 | | ...
209 | | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${jumbo}=${False}
210 | | ...
211 | | ${cpu_count_int} | Convert to Integer | ${phy_cores}
212 | | ${thr_count_int} | Convert to Integer | ${phy_cores}
213 | | :FOR | ${dut} | IN | @{duts}
214 | | | ${numa}= | Get interfaces numa node | ${nodes['${dut}']}
215 | | | ... | ${${dut}_if1} | ${${dut}_if2}
216 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
217 | | | ${if1_pci}= | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1}
218 | | | ${if2_pci}= | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2}
219 | | | ${thr_count_int}= | Run keyword if | ${smt_used}
220 | | | ... | Evaluate | int(${cpu_count_int}*2)
221 | | | ... | ELSE | Set variable | ${thr_count_int}
222 | | | ${rxq_count_int}= | Run keyword if | ${rx_queues}
223 | | | ... | Set variable | ${rx_queues}
224 | | | ... | ELSE | Evaluate | int(${thr_count_int}/2)
225 | | | ${rxq_count_int}= | Run keyword if | ${rxq_count_int} == 0
226 | | | ... | Set variable | ${1}
227 | | | ... | ELSE | Set variable | ${rxq_count_int}
228 | | | ${config}= | Run keyword | Create Kubernetes VSWITCH startup config
229 | | | ... | node=${nodes['${dut}']} | phy_cores=${phy_cores}
230 | | | ... | cpu_node=${numa} | jumbo=${jumbo} | rxq_count_int=${rxq_count_int}
231 | | | ... | buffers_per_numa=${215040}
232 | | | ... | filename=/tmp/vswitch.conf | if1=${if1_pci} | if2=${if2_pci}
233 | | | Run keyword if | ${thr_count_int} > 1
234 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
235 | | | Set Tags | ${thr_count_int}T${cpu_count_int}C
236 | | Set Test Variable | ${smt_used}
237 | | Set Test Variable | ${thr_count_int}
238 | | Set Test Variable | ${cpu_count_int}
239 | | Set Test Variable | ${rxq_count_int}
240
241 | Create Kubernetes VNF'${i}' startup config on all DUTs
242 | | [Documentation] | Create base startup configuration of VNF in Kubernetes
243 | | ... | deploy to all DUTs.
244 | | ...
245 | | ${i_int}= | Convert To Integer | ${i}
246 | | ${cpu_skip}= | Evaluate | ${vswitch_cpus}+${system_cpus}
247 | | ${dut1_numa}= | Get interfaces numa node | ${dut1}
248 | | ... | ${dut1_if1} | ${dut1_if2}
249 | | ${dut2_numa}= | Get interfaces numa node | ${dut2}
250 | | ... | ${dut2_if1} | ${dut2_if2}
251 | | ${config}= | Run keyword | Create Kubernetes VNF startup config
252 | | ... | node=${dut1} | phy_cores=${vnf_cpus} | cpu_node=${dut1_numa}
253 | | ... | cpu_skip=${cpu_skip} | filename=/tmp/vnf${i}.conf
254 | | ... | i=${i_int}
255 | | ${config}= | Run keyword | Create Kubernetes VNF startup config
256 | | ... | node=${dut2} | phy_cores=${vnf_cpus} | cpu_node=${dut2_numa}
257 | | ... | cpu_skip=${cpu_skip} | filename=/tmp/vnf${i}.conf
258 | | ... | i=${i_int}
259
260 | Add PCI devices to all DUTs
261 | | [Documentation]
262 | | ... | Add PCI devices to VPP configuration file.
263 | | ...
264 | | :FOR | ${dut} | IN | @{duts}
265 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
266 | | | ... | Variable Should Exist | ${${dut}_if1}
267 | | | ${if1_pci}= | Run Keyword If | '${if1_status}' == 'PASS'
268 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1}
269 | | | ${if1_1_pci}= | Run Keyword Unless | '${if1_status}' == 'PASS'
270 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1_1}
271 | | | ${if1_2_pci}= | Run Keyword Unless | '${if1_status}' == 'PASS'
272 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1_2}
273 | | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
274 | | | ... | Variable Should Exist | ${${dut}_if2}
275 | | | ${if2_pci}= | Run Keyword If | '${if2_status}' == 'PASS'
276 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2}
277 | | | ${if2_1_pci}= | Run Keyword Unless | '${if2_status}' == 'PASS'
278 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2_1}
279 | | | ${if2_2_pci}= | Run Keyword Unless | '${if2_status}' == 'PASS'
280 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2_2}
281 | | | @{pci_devs}= | Run Keyword If | '${if1_status}' == 'PASS'
282 | | | ... | Create List | ${if1_pci}
283 | | | ... | ELSE
284 | | | ... | Create List | ${if1_1_pci} | ${if1_2_pci}
285 | | | Run Keyword If | '${if2_status}' == 'PASS'
286 | | | ... | Append To List | ${pci_devs} | ${if2_pci}
287 | | | ... | ELSE
288 | | | ... | Append To List | ${pci_devs} | ${if2_1_pci} | ${if2_2_pci}
289 | | | Run keyword | ${dut}.Add DPDK Dev | @{pci_devs}
290 | | | Run Keyword If | '${if1_status}' == 'PASS'
291 | | | ... | Set Test Variable | ${${dut}_if1_pci} | ${if1_pci}
292 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
293 | | | ... | Set Test Variable | ${${dut}_if1_1_pci} | ${if1_1_pci}
294 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
295 | | | ... | Set Test Variable | ${${dut}_if1_2_pci} | ${if1_2_pci}
296 | | | Run Keyword If | '${if2_status}' == 'PASS'
297 | | | ... | Set Test Variable | ${${dut}_if2_pci} | ${if2_pci}
298 | | | Run Keyword Unless | '${if2_status}' == 'PASS'
299 | | | ... | Set Test Variable | ${${dut}_if2_1_pci} | ${if2_1_pci}
300 | | | Run Keyword Unless | '${if2_status}' == 'PASS'
301 | | | ... | Set Test Variable | ${${dut}_if2_2_pci} | ${if2_2_pci}
302
303 | Add single PCI device to all DUTs
304 | | [Documentation]
305 | | ... | Add single (first) PCI device on DUT1 and single (last) PCI device on
306 | | ... | DUT2 to VPP configuration file.
307 | | ...
308 | | :FOR | ${dut} | IN | @{duts}
309 | | | ${if1_pci}= | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1}
310 | | | Run keyword | ${dut}.Add DPDK Dev | ${if1_pci}
311 | | | Set Test Variable | ${${dut}_if1_pci} | ${if1_pci}
312
313 | Add no multi seg to all DUTs
314 | | [Documentation] | Add No Multi Seg to VPP startup configuration to all DUTs.
315 | | ...
316 | | :FOR | ${dut} | IN | @{duts}
317 | | | Run keyword | ${dut}.Add DPDK No Multi Seg
318
319 | Add DPDK no PCI to all DUTs
320 | | [Documentation] | Add DPDK no-pci to VPP startup configuration to all DUTs.
321 | | ...
322 | | :FOR | ${dut} | IN | @{duts}
323 | | | Run keyword | ${dut}.Add DPDK no PCI
324
325 | Add DPDK dev default RXD to all DUTs
326 | | [Documentation] | Add DPDK num-rx-desc to VPP startup configuration to all
327 | | ... | DUTs.
328 | | ...
329 | | ... | *Arguments:*
330 | | ... | - rxd - Number of RX descriptors. Type: string
331 | | ...
332 | | ... | *Example:*
333 | | ...
334 | | ... | \| Add DPDK dev default RXD to all DUTs \| ${rxd} \|
335 | | ...
336 | | [Arguments] | ${rxd}
337 | | ...
338 | | :FOR | ${dut} | IN | @{duts}
339 | | | Run keyword | ${dut}.Add DPDK Dev Default RXD | ${rxd}
340
341 | Add DPDK dev default TXD to all DUTs
342 | | [Documentation] | Add DPDK num-tx-desc to VPP startup configuration to all
343 | | ... | DUTs.
344 | | ...
345 | | ... | *Arguments:*
346 | | ... | - txd - Number of TX descriptors. Type: string
347 | | ...
348 | | ... | *Example:*
349 | | ...
350 | | ... | \| Add DPDK dev default TXD to all DUTs \| ${txd} \|
351 | | ...
352 | | [Arguments] | ${txd}
353 | | ...
354 | | :FOR | ${dut} | IN | @{duts}
355 | | | Run keyword | ${dut}.Add DPDK Dev Default TXD | ${txd}
356
357 | Add DPDK Uio Driver on all DUTs
358 | | [Documentation] | Add DPDK uio driver to VPP startup configuration on all
359 | | ... | DUTs.
360 | | ...
361 | | ... | *Arguments:*
362 | | ... | - uio_driver - Required uio driver. Type: string
363 | | ...
364 | | ... | *Example:*
365 | | ...
366 | | ... | \| Add DPDK Uio Driver on all DUTs \| igb_uio \|
367 | | ...
368 | | [Arguments] | ${uio_driver}
369 | | ...
370 | | :FOR | ${dut} | IN | @{duts}
371 | | | Run keyword | ${dut}.Add DPDK Uio Driver | ${uio_driver}
372
373 | Add NAT to all DUTs
374 | | [Documentation] | Add NAT configuration to all DUTs.
375 | | ...
376 | | :FOR | ${dut} | IN | @{duts}
377 | | | Run keyword | ${dut}.Add NAT
378
379 | Add cryptodev to all DUTs
380 | | [Documentation] | Add Cryptodev to VPP startup configuration to all DUTs.
381 | | ...
382 | | ... | *Arguments:*
383 | | ... | - count - Number of QAT devices. Type: integer
384 | | ...
385 | | ... | *Example:*
386 | | ...
387 | | ... | \| Add cryptodev to all DUTs \| ${4} \|
388 | | ...
389 | | [Arguments] | ${count}
390 | | ...
391 | | :FOR | ${dut} | IN | @{duts}
392 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
393 | | | ${thr_count_int}= | Run keyword if | ${smt_used}
394 | | | ... | Evaluate | int(${count}*2)
395 | | | ... | ELSE | Set variable | ${count}
396 | | | Run keyword | ${dut}.Add DPDK Cryptodev | ${thr_count_int}
397
398 | Add DPDK SW cryptodev on DUTs in 3-node single-link circular topology
399 | | [Documentation] | Add required number of SW crypto devices of given type
400 | | ... | to VPP startup configuration on all DUTs in 3-node single-link
401 | | ... | circular topology.
402 | | ...
403 | | ... | *Arguments:*
404 | | ... | - sw_pmd_type - PMD type of SW crypto device. Type: string
405 | | ... | - count - Number of SW crypto devices. Type: string
406 | | ...
407 | | ... | *Example:*
408 | | ...
409 | | ... | \| Add DPDK SW cryptodev on DUTs in 3-node single-link circular\
410 | | ... | topology \| aesni-mb \| ${2} \|
411 | | ...
412 | | [Arguments] | ${sw_pmd_type} | ${count}
413 | | ${smt_used}= | Is SMT enabled | ${nodes['DUT1']['cpuinfo']}
414 | | ${thr_count_int}= | Run keyword if | ${smt_used}
415 | | ... | Evaluate | int(${count}*2)
416 | | ... | ELSE | Set variable | ${count}
417 | | ${socket_id}= | Get Interface Numa Node | ${nodes['DUT1']} | ${dut1_if2}
418 | | Run keyword | DUT1.Add DPDK SW Cryptodev | ${sw_pmd_type} | ${socket_id}
419 | | ... | ${thr_count_int}
420 | | ${smt_used}= | Is SMT enabled | ${nodes['DUT2']['cpuinfo']}
421 | | ${thr_count_int}= | Run keyword if | ${smt_used}
422 | | ... | Evaluate | int(${count}*2)
423 | | ... | ELSE | Set variable | ${count}
424 | | ${socket_id}= | Get Interface Numa Node | ${nodes['DUT2']} | ${dut2_if1}
425 | | Run keyword | DUT2.Add DPDK SW Cryptodev | ${sw_pmd_type} | ${socket_id}
426 | | ... | ${thr_count_int}
427
428 | Write startup configuration on all VPP DUTs
429 | | [Documentation] | Write VPP startup configuration on all DUTs.
430 | | ...
431 | | :FOR | ${dut} | IN | @{duts}
432 | | | Run keyword | ${dut}.Write Config
433
434 | Apply startup configuration on all VPP DUTs
435 | | [Documentation] | Write VPP startup configuration and restart VPP on all
436 | | ... | DUTs.
437 | | ...
438 | | ... | *Arguments:*
439 | | ... | - with_trace - Enable packet trace after VPP restart Type: boolean
440 | | ...
441 | | ... | *Example:*
442 | | ...
443 | | ... | \| Apply startup configuration on all VPP DUTs \| False \|
444 | | ...
445 | | [Arguments] | ${with_trace}=${False}
446 | | ...
447 | | :FOR | ${dut} | IN | @{duts}
448 | | | Run keyword | ${dut}.Apply Config
449 | | Save VPP PIDs
450 | | Enable Coredump Limit VPP on All DUTs | ${nodes}
451 | | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${True}
452 | | Run keyword If | ${with_trace} | VPP Enable Traces On All Duts | ${nodes}
453
454 | Save VPP PIDs
455 | | [Documentation] | Get PIDs of VPP processes from all DUTs in topology and\
456 | | ... | set it as a test variable. The PIDs are stored as dictionary items\
457 | | ... | where the key is the host and the value is the PID.
458 | | ...
459 | | ${setup_vpp_pids}= | Get VPP PIDs | ${nodes}
460 | | ${keys}= | Get Dictionary Keys | ${setup_vpp_pids}
461 | | ${duts}= | Get Matches | ${nodes} | DUT*
462 | | :FOR | ${key} | IN | @{keys}
463 | | | ${pid}= | Get From Dictionary | ${setup_vpp_pids} | ${key}
464 | | | Run Keyword If | $pid is None | FAIL | No VPP PID found on node ${key}
465 | | Set Test Variable | ${setup_vpp_pids}
466
467 | Verify VPP PID in Teardown
468 | | [Documentation] | Check if the VPP PIDs on all DUTs are the same at the end\
469 | | ... | of test as they were at the begining. If they are not, only a message\
470 | | ... | is printed on console and to log. The test will not fail.
471 | | ...
472 | | ${teardown_vpp_pids}= | Get VPP PIDs | ${nodes}
473 | | ${err_msg}= | Catenate | ${SUITE NAME} - ${TEST NAME}
474 | | ... | \nThe VPP PIDs are not equal!\nTest Setup VPP PIDs:
475 | | ... | ${setup_vpp_pids}\nTest Teardown VPP PIDs: ${teardown_vpp_pids}
476 | | ${rc} | ${msg}= | Run keyword and ignore error
477 | | ... | Dictionaries Should Be Equal
478 | | ... | ${setup_vpp_pids} | ${teardown_vpp_pids}
479 | | Run Keyword And Return If | '${rc}'=='FAIL' | Log | ${err_msg}
480 | | ... | console=yes | level=WARN
481
482 | Set up functional test
483 | | [Documentation] | Common test setup for functional tests.
484 | | ...
485 | | Restart Vpp Service On All Duts | ${nodes}
486 | | Verify Vpp On All Duts | ${nodes}
487 | | VPP Enable Traces On All Duts | ${nodes}
488 | | Save VPP PIDs
489 | | All TGs Set Interface Default Driver | ${nodes}
490 | | Update All Interface Data On All Nodes | ${nodes}
491 | | Reset PAPI History On All DUTs | ${nodes}
492
493 | Tear down functional test
494 | | [Documentation] | Common test teardown for functional tests.
495 | | ...
496 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
497 | | Show Packet Trace on All DUTs | ${nodes}
498 | | Show PAPI History On All DUTs | ${nodes}
499 | | Vpp Show Errors On All DUTs | ${nodes}
500 | | Verify VPP PID in Teardown
501
502 | Tear down LISP functional test
503 | | [Documentation] | Common test teardown for functional tests with LISP.
504 | | ...
505 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
506 | | Show Packet Trace on All DUTs | ${nodes}
507 | | Show PAPI History On All DUTs | ${nodes}
508 | | Show Vpp Settings | ${nodes['DUT1']}
509 | | Show Vpp Settings | ${nodes['DUT2']}
510 | | Vpp Show Errors On All DUTs | ${nodes}
511 | | Verify VPP PID in Teardown
512
513 | Stop VPP Service on DUT
514 | | [Documentation] | Stop the VPP service on the specified node.
515 | | ...
516 | | ... | *Arguments:*
517 | | ... | - node - information about a DUT node. Type: dictionary
518 | | ...
519 | | ... | *Example:*
520 | | ...
521 | | ... | \| Stop VPP Service on DUT \| ${nodes['DUT1']} \|
522 | | ...
523 | | [Arguments] | ${node}
524 | | Stop VPP Service | ${node}