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