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