86e124ad62d0cf1d952c43ce9c756af09936e581
[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}= | Cpu list per node str | ${nodes['${dut}']} | ${numa}
164 | | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${cpu_count_int}
165 | | | ... | smt_used=${smt_used}
166 | | | ${thr_count_int}= | Run keyword if | ${smt_used}
167 | | | ... | Evaluate | int(${cpu_count_int}*2)
168 | | | ... | ELSE | Set variable | ${thr_count_int}
169 | | | ${rxq_count_int}= | Run keyword if | ${rx_queues}
170 | | | ... | Set variable | ${rx_queues}
171 | | | ... | ELSE | Evaluate | int(${thr_count_int}/2)
172 | | | ${rxq_count_int}= | Run keyword if | ${rxq_count_int} == 0
173 | | | ... | Set variable | ${1}
174 | | | ... | ELSE | Set variable | ${rxq_count_int}
175 | | | Run keyword | ${dut}.Add CPU Main Core | ${cpu_main}
176 | | | Run keyword | ${dut}.Add CPU Corelist Workers | ${cpu_wt}
177 | | | Run keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
178 # For now there is no way to easily predict the number of buffers. Statically
179 # doing maximum amount of buffers allowed by DPDK.
180 | | | Run keyword if | ${smt_used}
181 | | | ... | Run keyword | ${dut}.Add Buffers Per Numa | ${215040} | ELSE
182 | | | ... | Run keyword | ${dut}.Add Buffers Per Numa | ${107520}
183 | | | Run keyword if | ${thr_count_int} > 1
184 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
185 | | | Set Tags | ${thr_count_int}T${cpu_count_int}C
186 | | Set Test Variable | ${smt_used}
187 | | Set Test Variable | ${thr_count_int}
188 | | Set Test Variable | ${cpu_count_int}
189 | | Set Test Variable | ${rxq_count_int}
190
191 | Create Kubernetes VSWITCH startup config on all DUTs
192 | | [Documentation] | Create base startup configuration of VSWITCH in Kubernetes
193 | | ... | deploy to all DUTs.
194 | | ...
195 | | ... | *Arguments:*
196 | | ... | - ${jumbo} - Jumbo packet. Type: boolean
197 | | ... | - ${phy_cores} - Physical cores. Type: integer
198 | | ... | - ${rxq} - RX queues. Type: integer
199 | | ...
200 | | ... | *Example:*
201 | | ...
202 | | ... | \| Create Kubernetes VSWITCH startup config on all DUTs \| ${True} \
203 | | ... | \| ${1} \| ${1}
204 | | ...
205 | | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${jumbo}=${False}
206 | | ...
207 | | ${cpu_count_int} | Convert to Integer | ${phy_cores}
208 | | ${thr_count_int} | Convert to Integer | ${phy_cores}
209 | | :FOR | ${dut} | IN | @{duts}
210 | | | ${numa}= | Get interfaces numa node | ${nodes['${dut}']}
211 | | | ... | ${${dut}_if1} | ${${dut}_if2}
212 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
213 | | | ${if1_pci}= | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1}
214 | | | ${if2_pci}= | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2}
215 | | | ${thr_count_int}= | Run keyword if | ${smt_used}
216 | | | ... | Evaluate | int(${cpu_count_int}*2)
217 | | | ... | ELSE | Set variable | ${thr_count_int}
218 | | | ${rxq_count_int}= | Run keyword if | ${rx_queues}
219 | | | ... | Set variable | ${rx_queues}
220 | | | ... | ELSE | Evaluate | int(${thr_count_int}/2)
221 | | | ${rxq_count_int}= | Run keyword if | ${rxq_count_int} == 0
222 | | | ... | Set variable | ${1}
223 | | | ... | ELSE | Set variable | ${rxq_count_int}
224 | | | ${config}= | Run keyword | Create Kubernetes VSWITCH startup config
225 | | | ... | node=${nodes['${dut}']} | phy_cores=${phy_cores}
226 | | | ... | cpu_node=${numa} | jumbo=${jumbo} | rxq_count_int=${rxq_count_int}
227 | | | ... | buffers_per_numa=${215040}
228 | | | ... | filename=/tmp/vswitch.conf | if1=${if1_pci} | if2=${if2_pci}
229 | | | Run keyword if | ${thr_count_int} > 1
230 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
231 | | | Set Tags | ${thr_count_int}T${cpu_count_int}C
232 | | Set Test Variable | ${smt_used}
233 | | Set Test Variable | ${thr_count_int}
234 | | Set Test Variable | ${cpu_count_int}
235 | | Set Test Variable | ${rxq_count_int}
236
237 | Create Kubernetes VNF'${i}' startup config on all DUTs
238 | | [Documentation] | Create base startup configuration of VNF in Kubernetes
239 | | ... | deploy to all DUTs.
240 | | ...
241 | | ${i_int}= | Convert To Integer | ${i}
242 | | ${cpu_skip}= | Evaluate | ${vswitch_cpus}+${system_cpus}
243 | | ${dut1_numa}= | Get interfaces numa node | ${dut1}
244 | | ... | ${dut1_if1} | ${dut1_if2}
245 | | ${dut2_numa}= | Get interfaces numa node | ${dut2}
246 | | ... | ${dut2_if1} | ${dut2_if2}
247 | | ${config}= | Run keyword | Create Kubernetes VNF startup config
248 | | ... | node=${dut1} | phy_cores=${vnf_cpus} | cpu_node=${dut1_numa}
249 | | ... | cpu_skip=${cpu_skip} | filename=/tmp/vnf${i}.conf
250 | | ... | i=${i_int}
251 | | ${config}= | Run keyword | Create Kubernetes VNF startup config
252 | | ... | node=${dut2} | phy_cores=${vnf_cpus} | cpu_node=${dut2_numa}
253 | | ... | cpu_skip=${cpu_skip} | filename=/tmp/vnf${i}.conf
254 | | ... | i=${i_int}
255
256 | Add PCI devices to all DUTs
257 | | [Documentation]
258 | | ... | Add PCI devices to VPP configuration file.
259 | | ...
260 | | :FOR | ${dut} | IN | @{duts}
261 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
262 | | | ... | Variable Should Exist | ${${dut}_if1}
263 | | | ${if1_pci}= | Run Keyword If | '${if1_status}' == 'PASS'
264 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1}
265 | | | ${if1_1_pci}= | Run Keyword Unless | '${if1_status}' == 'PASS'
266 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1_1}
267 | | | ${if1_2_pci}= | Run Keyword Unless | '${if1_status}' == 'PASS'
268 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1_2}
269 | | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
270 | | | ... | Variable Should Exist | ${${dut}_if2}
271 | | | ${if2_pci}= | Run Keyword If | '${if2_status}' == 'PASS'
272 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2}
273 | | | ${if2_1_pci}= | Run Keyword Unless | '${if2_status}' == 'PASS'
274 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2_1}
275 | | | ${if2_2_pci}= | Run Keyword Unless | '${if2_status}' == 'PASS'
276 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2_2}
277 | | | @{pci_devs}= | Run Keyword If | '${if1_status}' == 'PASS'
278 | | | ... | Create List | ${if1_pci}
279 | | | ... | ELSE
280 | | | ... | Create List | ${if1_1_pci} | ${if1_2_pci}
281 | | | Run Keyword If | '${if2_status}' == 'PASS'
282 | | | ... | Append To List | ${pci_devs} | ${if2_pci}
283 | | | ... | ELSE
284 | | | ... | Append To List | ${pci_devs} | ${if2_1_pci} | ${if2_2_pci}
285 | | | Run keyword | ${dut}.Add DPDK Dev | @{pci_devs}
286 | | | Run Keyword If | '${if1_status}' == 'PASS'
287 | | | ... | Set Test Variable | ${${dut}_if1_pci} | ${if1_pci}
288 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
289 | | | ... | Set Test Variable | ${${dut}_if1_1_pci} | ${if1_1_pci}
290 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
291 | | | ... | Set Test Variable | ${${dut}_if1_2_pci} | ${if1_2_pci}
292 | | | Run Keyword If | '${if2_status}' == 'PASS'
293 | | | ... | Set Test Variable | ${${dut}_if2_pci} | ${if2_pci}
294 | | | Run Keyword Unless | '${if2_status}' == 'PASS'
295 | | | ... | Set Test Variable | ${${dut}_if2_1_pci} | ${if2_1_pci}
296 | | | Run Keyword Unless | '${if2_status}' == 'PASS'
297 | | | ... | Set Test Variable | ${${dut}_if2_2_pci} | ${if2_2_pci}
298
299 | Add single PCI device to all DUTs
300 | | [Documentation]
301 | | ... | Add single (first) PCI device on DUT1 and single (last) PCI device on
302 | | ... | DUT2 to VPP configuration file.
303 | | ...
304 | | :FOR | ${dut} | IN | @{duts}
305 | | | ${if1_pci}= | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1}
306 | | | Run keyword | ${dut}.Add DPDK Dev | ${if1_pci}
307 | | | Set Test Variable | ${${dut}_if1_pci} | ${if1_pci}
308
309 | Add no multi seg to all DUTs
310 | | [Documentation] | Add No Multi Seg to VPP startup configuration to all DUTs.
311 | | ...
312 | | :FOR | ${dut} | IN | @{duts}
313 | | | Run keyword | ${dut}.Add DPDK No Multi Seg
314
315 | Add DPDK no PCI to all DUTs
316 | | [Documentation] | Add DPDK no-pci to VPP startup configuration to all DUTs.
317 | | ...
318 | | :FOR | ${dut} | IN | @{duts}
319 | | | Run keyword | ${dut}.Add DPDK no PCI
320
321 | Add DPDK dev default RXD to all DUTs
322 | | [Documentation] | Add DPDK num-rx-desc to VPP startup configuration to all
323 | | ... | DUTs.
324 | | ...
325 | | ... | *Arguments:*
326 | | ... | - rxd - Number of RX descriptors. Type: string
327 | | ...
328 | | ... | *Example:*
329 | | ...
330 | | ... | \| Add DPDK dev default RXD to all DUTs \| ${rxd} \|
331 | | ...
332 | | [Arguments] | ${rxd}
333 | | ...
334 | | :FOR | ${dut} | IN | @{duts}
335 | | | Run keyword | ${dut}.Add DPDK Dev Default RXD | ${rxd}
336
337 | Add DPDK dev default TXD to all DUTs
338 | | [Documentation] | Add DPDK num-tx-desc to VPP startup configuration to all
339 | | ... | DUTs.
340 | | ...
341 | | ... | *Arguments:*
342 | | ... | - txd - Number of TX descriptors. Type: string
343 | | ...
344 | | ... | *Example:*
345 | | ...
346 | | ... | \| Add DPDK dev default TXD to all DUTs \| ${txd} \|
347 | | ...
348 | | [Arguments] | ${txd}
349 | | ...
350 | | :FOR | ${dut} | IN | @{duts}
351 | | | Run keyword | ${dut}.Add DPDK Dev Default TXD | ${txd}
352
353 | Add DPDK Uio Driver on all DUTs
354 | | [Documentation] | Add DPDK uio driver to VPP startup configuration on all
355 | | ... | DUTs.
356 | | ...
357 | | ... | *Arguments:*
358 | | ... | - uio_driver - Required uio driver. Type: string
359 | | ...
360 | | ... | *Example:*
361 | | ...
362 | | ... | \| Add DPDK Uio Driver on all DUTs \| igb_uio \|
363 | | ...
364 | | [Arguments] | ${uio_driver}
365 | | ...
366 | | :FOR | ${dut} | IN | @{duts}
367 | | | Run keyword | ${dut}.Add DPDK Uio Driver | ${uio_driver}
368
369 | Add NAT to all DUTs
370 | | [Documentation] | Add NAT configuration to all DUTs.
371 | | ...
372 | | :FOR | ${dut} | IN | @{duts}
373 | | | Run keyword | ${dut}.Add NAT
374
375 | Add cryptodev to all DUTs
376 | | [Documentation] | Add Cryptodev to VPP startup configuration to all DUTs.
377 | | ...
378 | | ... | *Arguments:*
379 | | ... | - count - Number of QAT devices. Type: integer
380 | | ...
381 | | ... | *Example:*
382 | | ...
383 | | ... | \| Add cryptodev to all DUTs \| ${4} \|
384 | | ...
385 | | [Arguments] | ${count}
386 | | ...
387 | | :FOR | ${dut} | IN | @{duts}
388 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
389 | | | ${thr_count_int}= | Run keyword if | ${smt_used}
390 | | | ... | Evaluate | int(${count}*2)
391 | | | ... | ELSE | Set variable | ${count}
392 | | | Run keyword | ${dut}.Add DPDK Cryptodev | ${thr_count_int}
393
394 | Add DPDK SW cryptodev on DUTs in 3-node single-link circular topology
395 | | [Documentation] | Add required number of SW crypto devices of given type
396 | | ... | to VPP startup configuration on all DUTs in 3-node single-link
397 | | ... | circular topology.
398 | | ...
399 | | ... | *Arguments:*
400 | | ... | - sw_pmd_type - PMD type of SW crypto device. Type: string
401 | | ... | - count - Number of SW crypto devices. Type: string
402 | | ...
403 | | ... | *Example:*
404 | | ...
405 | | ... | \| Add DPDK SW cryptodev on DUTs in 3-node single-link circular\
406 | | ... | topology \| aesni-mb \| ${2} \|
407 | | ...
408 | | [Arguments] | ${sw_pmd_type} | ${count}
409 | | ${smt_used}= | Is SMT enabled | ${nodes['DUT1']['cpuinfo']}
410 | | ${thr_count_int}= | Run keyword if | ${smt_used}
411 | | ... | Evaluate | int(${count}*2)
412 | | ... | ELSE | Set variable | ${count}
413 | | ${socket_id}= | Get Interface Numa Node | ${nodes['DUT1']} | ${dut1_if2}
414 | | Run keyword | DUT1.Add DPDK SW Cryptodev | ${sw_pmd_type} | ${socket_id}
415 | | ... | ${thr_count_int}
416 | | ${smt_used}= | Is SMT enabled | ${nodes['DUT2']['cpuinfo']}
417 | | ${thr_count_int}= | Run keyword if | ${smt_used}
418 | | ... | Evaluate | int(${count}*2)
419 | | ... | ELSE | Set variable | ${count}
420 | | ${socket_id}= | Get Interface Numa Node | ${nodes['DUT2']} | ${dut2_if1}
421 | | Run keyword | DUT2.Add DPDK SW Cryptodev | ${sw_pmd_type} | ${socket_id}
422 | | ... | ${thr_count_int}
423
424 | Write startup configuration on all VPP DUTs
425 | | [Documentation] | Write VPP startup configuration on all DUTs.
426 | | ...
427 | | :FOR | ${dut} | IN | @{duts}
428 | | | Run keyword | ${dut}.Write Config
429
430 | Apply startup configuration on all VPP DUTs
431 | | [Documentation] | Write VPP startup configuration and restart VPP on all
432 | | ... | DUTs.
433 | | ...
434 | | :FOR | ${dut} | IN | @{duts}
435 | | | Run keyword | ${dut}.Apply Config
436 | | Save VPP PIDs
437 | | Enable Coredump Limit VPP on All DUTs | ${nodes}
438 | | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${True}
439
440 | Save VPP PIDs
441 | | [Documentation] | Get PIDs of VPP processes from all DUTs in topology and\
442 | | ... | set it as a test variable. The PIDs are stored as dictionary items\
443 | | ... | where the key is the host and the value is the PID.
444 | | ...
445 | | ${setup_vpp_pids}= | Get VPP PIDs | ${nodes}
446 | | ${keys}= | Get Dictionary Keys | ${setup_vpp_pids}
447 | | ${duts}= | Get Matches | ${nodes} | DUT*
448 | | :FOR | ${key} | IN | @{keys}
449 | | | ${pid}= | Get From Dictionary | ${setup_vpp_pids} | ${key}
450 | | | Run Keyword If | $pid is None | FAIL | No VPP PID found on node ${key}
451 | | Set Test Variable | ${setup_vpp_pids}
452
453 | Verify VPP PID in Teardown
454 | | [Documentation] | Check if the VPP PIDs on all DUTs are the same at the end\
455 | | ... | of test as they were at the begining. If they are not, only a message\
456 | | ... | is printed on console and to log. The test will not fail.
457 | | ...
458 | | ${teardown_vpp_pids}= | Get VPP PIDs | ${nodes}
459 | | ${err_msg}= | Catenate | ${SUITE NAME} - ${TEST NAME}
460 | | ... | \nThe VPP PIDs are not equal!\nTest Setup VPP PIDs:
461 | | ... | ${setup_vpp_pids}\nTest Teardown VPP PIDs: ${teardown_vpp_pids}
462 | | ${rc} | ${msg}= | Run keyword and ignore error
463 | | ... | Dictionaries Should Be Equal
464 | | ... | ${setup_vpp_pids} | ${teardown_vpp_pids}
465 | | Run Keyword And Return If | '${rc}'=='FAIL' | Log | ${err_msg}
466 | | ... | console=yes | level=WARN
467
468 | Set up functional test
469 | | [Documentation] | Common test setup for functional tests.
470 | | ...
471 | | Restart Vpp Service On All Duts | ${nodes}
472 | | Verify Vpp On All Duts | ${nodes}
473 | | VPP Enable Traces On All Duts | ${nodes}
474 | | Save VPP PIDs
475 | | All TGs Set Interface Default Driver | ${nodes}
476 | | Update All Interface Data On All Nodes | ${nodes}
477 | | Reset PAPI History On All DUTs | ${nodes}
478
479 | Tear down functional test
480 | | [Documentation] | Common test teardown for functional tests.
481 | | ...
482 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
483 | | Show Packet Trace on All DUTs | ${nodes}
484 | | Show PAPI History On All DUTs | ${nodes}
485 | | Vpp Show Errors On All DUTs | ${nodes}
486 | | Verify VPP PID in Teardown
487
488 | Tear down LISP functional test
489 | | [Documentation] | Common test teardown for functional tests with LISP.
490 | | ...
491 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
492 | | Show Packet Trace on All DUTs | ${nodes}
493 | | Show PAPI History On All DUTs | ${nodes}
494 | | Show Vpp Settings | ${nodes['DUT1']}
495 | | Show Vpp Settings | ${nodes['DUT2']}
496 | | Vpp Show Errors On All DUTs | ${nodes}
497 | | Verify VPP PID in Teardown
498
499 | Stop VPP Service on DUT
500 | | [Documentation] | Stop the VPP service on the specified node.
501 | | ...
502 | | ... | *Arguments:*
503 | | ... | - node - information about a DUT node. Type: dictionary
504 | | ...
505 | | ... | *Example:*
506 | | ...
507 | | ... | \| Stop VPP Service on DUT \| ${nodes['DUT1']} \|
508 | | ...
509 | | [Arguments] | ${node}
510 | | Stop VPP Service | ${node}