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