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