Clean: Various libraries
[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.TestConfig
34 | Library | resources.libraries.python.TGSetup
35 | Library | resources.libraries.python.topology.Topology
36 | Library | resources.libraries.python.Trace
37 | Library | resources.libraries.python.VppCounters
38 | Library | resources.libraries.python.VPPUtil
39 | ...
40 | Resource | resources/libraries/robot/crypto/ipsec.robot
41 | Resource | resources/libraries/robot/features/gbp.robot
42 | Resource | resources/libraries/robot/features/policer.robot
43 | Resource | resources/libraries/robot/ip/ip4.robot
44 | Resource | resources/libraries/robot/ip/ip6.robot
45 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
46 | Resource | resources/libraries/robot/l2/l2_patch.robot
47 | Resource | resources/libraries/robot/l2/l2_traffic.robot
48 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
49 | Resource | resources/libraries/robot/l2/tagging.robot
50 | Resource | resources/libraries/robot/overlay/srv6.robot
51 | Resource | resources/libraries/robot/performance/performance_configuration.robot
52 | Resource | resources/libraries/robot/performance/performance_limits.robot
53 | Resource | resources/libraries/robot/performance/performance_utils.robot
54 | Resource | resources/libraries/robot/shared/counters.robot
55 | Resource | resources/libraries/robot/shared/interfaces.robot
56 | Resource | resources/libraries/robot/shared/container.robot
57 | Resource | resources/libraries/robot/shared/memif.robot
58 | Resource | resources/libraries/robot/shared/suite_teardown.robot
59 | Resource | resources/libraries/robot/shared/suite_setup.robot
60 | Resource | resources/libraries/robot/shared/test_teardown.robot
61 | Resource | resources/libraries/robot/shared/test_setup.robot
62 | Resource | resources/libraries/robot/shared/traffic.robot
63 | Resource | resources/libraries/robot/shared/vm.robot
64
65 *** Keywords ***
66 | Configure crypto device on all DUTs
67 | | [Documentation] | Verify if Crypto QAT device virtual functions are
68 | | ... | initialized on all DUTs. If parameter force_init is set to True, then
69 | | ... | try to initialize/disable.
70 | | ...
71 | | ... | *Arguments:*
72 | | ... | - crypto_type - Crypto device type - HW_DH895xcc or HW_C3xxx.
73 | | ... | Type: string, default value: HW_DH895xcc
74 | | ... | - numvfs - Number of VFs to initialize, 0 - disable the VFs
75 | | ... | Type: integer, default value: ${32}
76 | | ... | - force_init - Force to initialize. Type: boolean
77 | | ...
78 | | ... | *Example:*
79 | | ...
80 | | ... | \| Configure crypto device on all DUTs \| HW_DH895xcc \| ${32} \|
81 | | ...
82 | | [Arguments] | ${crypto_type} | ${numvfs} | ${force_init}=${False}
83 | | ...
84 | | :FOR | ${dut} | IN | @{duts}
85 | | | Crypto Device Verify | ${nodes['${dut}']} | ${crypto_type}
86 | | | ... | ${numvfs} | force_init=${force_init}
87
88 | Configure kernel module on all DUTs
89 | | [Documentation] | Verify if specific kernel module is loaded on all DUTs.
90 | | ... | If parameter force_load is set to True, then try to load.
91 | | ...
92 | | ... | *Arguments:*
93 | | ... | - module - Module to verify. Type: string
94 | | ... | - force_load - Try to load module. Type: boolean
95 | | ...
96 | | ... | *Example:*
97 | | ...
98 | | ... | \| Configure kernel module on all DUTs \| ${True} \|
99 | | ...
100 | | [Arguments] | ${module} | ${force_load}=${False}
101 | | ...
102 | | Verify Kernel Module on All DUTs | ${nodes} | ${module}
103 | | ... | force_load=${force_load}
104
105 | Create base startup configuration of VPP on all DUTs
106 | | [Documentation] | Create base startup configuration of VPP to all DUTs.
107 | | ...
108 | | :FOR | ${dut} | IN | @{duts}
109 | | | Import Library | resources.libraries.python.VppConfigGenerator
110 | | | ... | WITH NAME | ${dut}
111 | | | Run keyword | ${dut}.Set Node |  ${nodes['${dut}']}
112 | | | Run keyword | ${dut}.Add Unix Log
113 | | | Run keyword | ${dut}.Add Unix CLI Listen
114 | | | Run keyword | ${dut}.Add Unix Nodaemon
115 | | | Run keyword | ${dut}.Add Unix Coredump
116 | | | Run keyword | ${dut}.Add Socksvr
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 VLAN strip offload switch off
377 | | [Documentation]
378 | | ... | Add VLAN Strip Offload switch off on all PCI devices.
379 | | ...
380 | | :FOR | ${dut} | IN | @{duts}
381 | | | ${dut_str}= | Convert To Lowercase | ${dut}
382 | | | ${if1_pci}= | Get Interface PCI Addr | ${nodes['${dut}']}
383 | | | ... | ${${dut_str}_if1}
384 | | | ${if2_pci}= | Get Interface PCI Addr | ${nodes['${dut}']}
385 | | | ... | ${${dut_str}_if2}
386 | | | Run keyword | ${dut}.Add DPDK Dev Parameter | ${if1_pci}
387 | | | ... | vlan-strip-offload | off
388 | | | Run keyword | ${dut}.Add DPDK Dev Parameter | ${if2_pci}
389 | | | ... | vlan-strip-offload | off
390
391 | Add VLAN strip offload switch off between DUTs in 3-node single link topology
392 | | [Documentation]
393 | | ... | Add VLAN Strip Offload switch off on PCI devices between DUTs to VPP
394 | | ... | configuration file.
395 | | ...
396 | | Run keyword | DUT1.Add DPDK Dev Parameter | ${dut1_if2_pci}
397 | | ... | vlan-strip-offload | off
398 | | Run keyword | DUT2.Add DPDK Dev Parameter | ${dut2_if1_pci}
399 | | ... | vlan-strip-offload | off
400
401 | Add VLAN strip offload switch off between DUTs in 3-node double link topology
402 | | [Documentation]
403 | | ... | Add VLAN Strip Offload switch off on PCI devices between DUTs to VPP
404 | | ... | configuration file
405 | | ...
406 | | Run keyword | DUT1.Add DPDK Dev Parameter | ${dut1_if2_1_pci}
407 | | ... | vlan-strip-offload | off
408 | | Run keyword | DUT1.Add DPDK Dev Parameter | ${dut1_if2_2_pci}
409 | | ... | vlan-strip-offload | off
410 | | Run keyword | DUT2.Add DPDK Dev Parameter | ${dut2_if1_1_pci}
411 | | ... | vlan-strip-offload | off
412 | | Run keyword | DUT2.Add DPDK Dev Parameter | ${dut2_if1_2_pci}
413 | | ... | vlan-strip-offload | off
414
415 | Add NAT to all DUTs
416 | | [Documentation] | Add NAT configuration to all DUTs.
417 | | ...
418 | | :FOR | ${dut} | IN | @{duts}
419 | | | Run keyword | ${dut}.Add NAT
420
421 | Add cryptodev to all DUTs
422 | | [Documentation] | Add Cryptodev to VPP startup configuration to all DUTs.
423 | | ...
424 | | ... | *Arguments:*
425 | | ... | - count - Number of QAT devices. Type: integer
426 | | ...
427 | | ... | *Example:*
428 | | ...
429 | | ... | \| Add cryptodev to all DUTs \| ${4} \|
430 | | ...
431 | | [Arguments] | ${count}
432 | | ...
433 | | :FOR | ${dut} | IN | @{duts}
434 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
435 | | | ${thr_count_int}= | Run keyword if | ${smt_used}
436 | | | ... | Evaluate | int(${count}*2)
437 | | | ... | ELSE | Set variable | ${count}
438 | | | Run keyword | ${dut}.Add DPDK Cryptodev | ${thr_count_int}
439
440 | Add DPDK SW cryptodev on DUTs in 3-node single-link circular topology
441 | | [Documentation] | Add required number of SW crypto devices of given type
442 | | ... | to VPP startup configuration on all DUTs in 3-node single-link
443 | | ... | circular topology.
444 | | ...
445 | | ... | *Arguments:*
446 | | ... | - sw_pmd_type - PMD type of SW crypto device. Type: string
447 | | ... | - count - Number of SW crypto devices. Type: string
448 | | ...
449 | | ... | *Example:*
450 | | ...
451 | | ... | \| Add DPDK SW cryptodev on DUTs in 3-node single-link circular\
452 | | ... | topology \| aesni-mb \| ${2} \|
453 | | ...
454 | | [Arguments] | ${sw_pmd_type} | ${count}
455 | | ${smt_used}= | Is SMT enabled | ${nodes['DUT1']['cpuinfo']}
456 | | ${thr_count_int}= | Run keyword if | ${smt_used}
457 | | ... | Evaluate | int(${count}*2)
458 | | ... | ELSE | Set variable | ${count}
459 | | ${socket_id}= | Get Interface Numa Node | ${nodes['DUT1']} | ${dut1_if2}
460 | | Run keyword | DUT1.Add DPDK SW Cryptodev | ${sw_pmd_type} | ${socket_id}
461 | | ... | ${thr_count_int}
462 | | ${smt_used}= | Is SMT enabled | ${nodes['DUT2']['cpuinfo']}
463 | | ${thr_count_int}= | Run keyword if | ${smt_used}
464 | | ... | Evaluate | int(${count}*2)
465 | | ... | ELSE | Set variable | ${count}
466 | | ${socket_id}= | Get Interface Numa Node | ${nodes['DUT2']} | ${dut2_if1}
467 | | Run keyword | DUT2.Add DPDK SW Cryptodev | ${sw_pmd_type} | ${socket_id}
468 | | ... | ${thr_count_int}
469
470 | Write startup configuration on all VPP DUTs
471 | | [Documentation] | Write VPP startup configuration without restarting VPP.
472 | | ...
473 | | :FOR | ${dut} | IN | @{duts}
474 | | | Run keyword | ${dut}.Write Config
475
476 | Apply startup configuration on all VPP DUTs
477 | | [Documentation] | Write VPP startup configuration and restart VPP on all
478 | | ... | DUTs.
479 | | ...
480 | | ... | *Arguments:*
481 | | ... | - with_trace - Enable packet trace after VPP restart Type: boolean
482 | | ...
483 | | ... | *Example:*
484 | | ...
485 | | ... | \| Apply startup configuration on all VPP DUTs \| False \|
486 | | ...
487 | | [Arguments] | ${with_trace}=${False}
488 | | ...
489 | | :FOR | ${dut} | IN | @{duts}
490 | | | Run keyword | ${dut}.Apply Config
491 | | Save VPP PIDs
492 | | Enable Coredump Limit VPP on All DUTs | ${nodes}
493 | | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${True}
494 | | Run keyword If | ${with_trace} | VPP Enable Traces On All Duts | ${nodes}
495
496 | Save VPP PIDs
497 | | [Documentation] | Get PIDs of VPP processes from all DUTs in topology and\
498 | | ... | set it as a test variable. The PIDs are stored as dictionary items\
499 | | ... | where the key is the host and the value is the PID.
500 | | ...
501 | | ${setup_vpp_pids}= | Get VPP PIDs | ${nodes}
502 | | ${keys}= | Get Dictionary Keys | ${setup_vpp_pids}
503 | | ${duts}= | Get Matches | ${nodes} | DUT*
504 | | :FOR | ${key} | IN | @{keys}
505 | | | ${pid}= | Get From Dictionary | ${setup_vpp_pids} | ${key}
506 | | | Run Keyword If | $pid is None | FAIL | No VPP PID found on node ${key}
507 | | Set Test Variable | ${setup_vpp_pids}
508
509 | Verify VPP PID in Teardown
510 | | [Documentation] | Check if the VPP PIDs on all DUTs are the same at the end\
511 | | ... | of test as they were at the begining. If they are not, only a message\
512 | | ... | is printed on console and to log. The test will not fail.
513 | | ...
514 | | ${teardown_vpp_pids}= | Get VPP PIDs | ${nodes}
515 | | ${err_msg}= | Catenate | ${SUITE NAME} - ${TEST NAME}
516 | | ... | \nThe VPP PIDs are not equal!\nTest Setup VPP PIDs:
517 | | ... | ${setup_vpp_pids}\nTest Teardown VPP PIDs: ${teardown_vpp_pids}
518 | | ${rc} | ${msg}= | Run keyword and ignore error
519 | | ... | Dictionaries Should Be Equal
520 | | ... | ${setup_vpp_pids} | ${teardown_vpp_pids}
521 | | Run Keyword And Return If | '${rc}'=='FAIL' | Log | ${err_msg}
522 | | ... | console=yes | level=WARN
523
524 | Set up functional test
525 | | [Documentation] | Common test setup for functional tests.
526 | | ...
527 | | Restart Vpp Service On All Duts | ${nodes}
528 | | Verify Vpp On All Duts | ${nodes}
529 | | VPP Enable Traces On All Duts | ${nodes}
530 | | Save VPP PIDs
531 | | All TGs Set Interface Default Driver | ${nodes}
532 | | Update All Interface Data On All Nodes | ${nodes}
533 | | Reset PAPI History On All DUTs | ${nodes}
534
535 | Tear down functional test
536 | | [Documentation] | Common test teardown for functional tests.
537 | | ...
538 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
539 | | Show Packet Trace on All DUTs | ${nodes}
540 | | Show PAPI History On All DUTs | ${nodes}
541 | | Vpp Show Errors On All DUTs | ${nodes}
542 | | Verify VPP PID in Teardown
543
544 | Tear down LISP functional test
545 | | [Documentation] | Common test teardown for functional tests with LISP.
546 | | ...
547 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
548 | | Show Packet Trace on All DUTs | ${nodes}
549 | | Show PAPI History On All DUTs | ${nodes}
550 | | Show Vpp Settings | ${nodes['DUT1']}
551 | | Show Vpp Settings | ${nodes['DUT2']}
552 | | Vpp Show Errors On All DUTs | ${nodes}
553 | | Verify VPP PID in Teardown