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