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