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