VPP_Device - add baseline tests - part IIb)
[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/VatHistory.py
17 | ...
18 | Library | Collections
19 | Library | OperatingSystem
20 | Library | String
21 | ...
22 | Library | resources.libraries.python.CpuUtils
23 | Library | resources.libraries.python.DUTSetup
24 | Library | resources.libraries.python.L2Util
25 | Library | resources.libraries.python.SchedUtils
26 | Library | resources.libraries.python.Tap
27 | Library | resources.libraries.python.TGSetup
28 | Library | resources.libraries.python.VatHistory
29 | Library | resources.libraries.python.VppCounters
30 | Library | resources.libraries.python.VPPUtil
31 | Library | resources.libraries.python.Trace
32 | Library | resources.libraries.python.topology.Topology
33 | ...
34 | Resource | resources/libraries/robot/shared/container.robot
35 | Resource | resources/libraries/robot/vm/double_qemu_setup.robot
36 | Resource | resources/libraries/robot/vm/qemu.robot
37
38 *** Keywords ***
39 | Configure all DUTs before test
40 | | [Documentation] | Setup all DUTs in topology before test execution.
41 | | ...
42 | | Setup All DUTs | ${nodes}
43
44 | Configure all TGs for traffic script
45 | | [Documentation] | Prepare all TGs before traffic scripts execution.
46 | | ...
47 | | All TGs Set Interface Default Driver | ${nodes}
48
49 | Show Vpp Errors On All DUTs
50 | | [Documentation] | Show VPP errors verbose on all DUTs.
51 | | ...
52 | | ${duts}= | Get Matches | ${nodes} | DUT*
53 | | :FOR | ${dut} | IN | @{duts}
54 | | | Vpp Show Errors | ${nodes['${dut}']}
55
56 | Show VPP trace dump on all DUTs
57 | | [Documentation] | Save API trace and dump output on all DUTs.
58 | | ...
59 | | ${duts}= | Get Matches | ${nodes} | DUT*
60 | | :FOR | ${dut} | IN | @{duts}
61 | | | Vpp api trace save | ${nodes['${dut}']}
62 | | | Vpp api trace dump | ${nodes['${dut}']}
63
64 | Show Bridge Domain Data On All DUTs
65 | | [Documentation] | Show Bridge Domain data on all DUTs.
66 | | ...
67 | | ${duts}= | Get Matches | ${nodes} | DUT*
68 | | :FOR | ${dut} | IN | @{duts}
69 | | | Vpp Get Bridge Domain Data | ${nodes['${dut}']}
70
71 | Setup Scheduler Policy for Vpp On All DUTs
72 | | [Documentation] | Set realtime scheduling policy (SCHED_RR) with priority 1
73 | | ... | on all VPP worker threads on all DUTs.
74 | | ...
75 | | ${duts}= | Get Matches | ${nodes} | DUT*
76 | | :FOR | ${dut} | IN | @{duts}
77 | | | Set VPP Scheduling rr | ${nodes['${dut}']}
78
79 | Configure crypto device on all DUTs
80 | | [Documentation] | Verify if Crypto QAT device virtual functions are
81 | | ... | initialized on all DUTs. If parameter force_init is set to True, then
82 | | ... | try to initialize/disable.
83 | | ...
84 | | ... | *Arguments:*
85 | | ... | - force_init - Force to initialize. Type: boolean
86 | | ... | - numvfs - Number of VFs to initialize, 0 - disable the VFs
87 | | ... | (Optional). Type: integer, default value: ${32}
88 | | ...
89 | | ... | *Example:*
90 | | ...
91 | | ... | \| Configure crypto device on all DUTs \| ${True} \|
92 | | ...
93 | | [Arguments] | ${force_init}=${False} | ${numvfs}=${32}
94 | | ...
95 | | ${duts}= | Get Matches | ${nodes} | DUT*
96 | | :FOR | ${dut} | IN | @{duts}
97 | | | Crypto Device Verify | ${nodes['${dut}']} | force_init=${force_init}
98 | | | ... | numvfs=${numvfs}
99
100 | Configure AVF interfaces on all DUTs
101 | | [Documentation] | Configure virtual functions for AVF interfaces on PCI
102 | | ... | interface on all DUTs.
103 | | ...
104 | | ... | *Arguments:*
105 | | ... | - numvfs - Number of VFs to initialize, 0 - disable the VFs
106 | | ... | (Optional). Type: integer, default value: ${1}
107 | | ... | - topology_type - Topology type.
108 | | ... | (Optional). Type: string, default value: L2
109 | | ...
110 | | ... | *Example:*
111 | | ...
112 | | ... | \| Configure AVF device on all DUTs \| ${1} \| L2 \|
113 | | ...
114 | | [Arguments] | ${numvfs}=${1} | ${topology_type}=L2
115 | | ...
116 | | ${duts}= | Get Matches | ${nodes} | DUT*
117 | | :FOR | ${dut} | IN | @{duts}
118 | | | ${if1_avf_arr}= | Init AVF interface | ${nodes['${dut}']} | ${${dut}_if1}
119 | | | ... | numvfs=${numvfs} | topology_type=${topology_type}
120 | | | ${if2_avf_arr}= | Init AVF interface | ${nodes['${dut}']} | ${${dut}_if2}
121 | | | ... | numvfs=${numvfs} | topology_type=${topology_type}
122 # Currently only one AVF is supported.
123 | | | Set Suite Variable | ${${dut}_if1_vf0} | ${if1_avf_arr[0]}
124 | | | Set Suite Variable | ${${dut}_if2_vf0} | ${if2_avf_arr[0]}
125
126 | Configure kernel module on all DUTs
127 | | [Documentation] | Verify if specific kernel module is loaded on all DUTs.
128 | | ... | If parameter force_load is set to True, then try to load.
129 | | ...
130 | | ... | *Arguments:*
131 | | ... | - module - Module to verify. Type: string
132 | | ... | - force_load - Try to load module. Type: boolean
133 | | ...
134 | | ... | *Example:*
135 | | ...
136 | | ... | \| Configure kernel module on all DUTs \| ${True} \|
137 | | ...
138 | | [Arguments] | ${module} | ${force_load}=${False}
139 | | ...
140 | | Verify Kernel Module on All DUTs | ${nodes} | ${module}
141 | | ... | force_load=${force_load}
142
143 | Create base startup configuration of VPP on all DUTs
144 | | [Documentation] | Create base startup configuration of VPP to all DUTs.
145 | | ...
146 | | ${duts}= | Get Matches | ${nodes} | DUT*
147 | | :FOR | ${dut} | IN | @{duts}
148 | | | Import Library | resources.libraries.python.VppConfigGenerator
149 | | | ... | WITH NAME | ${dut}
150 | | | Run keyword | ${dut}.Set Node |  ${nodes['${dut}']}
151 | | | Run keyword | ${dut}.Add Unix Log
152 | | | Run keyword | ${dut}.Add Unix CLI Listen
153 | | | Run keyword | ${dut}.Add Unix Nodaemon
154 | | | Run keyword | ${dut}.Add Unix Coredump
155 | | | Run keyword | ${dut}.Add DPDK Socketmem | 1024,1024
156 | | | Run keyword | ${dut}.Add DPDK No Tx Checksum Offload
157 | | | Run keyword | ${dut}.Add DPDK Log Level | debug
158 | | | Run keyword | ${dut}.Add DPDK Uio Driver
159 | | | Run keyword | ${dut}.Add Heapsize | 4G
160 | | | Run keyword | ${dut}.Add Statseg size | 4G
161 | | | Run keyword | ${dut}.Add Plugin | disable | default
162 | | | Run keyword | ${dut}.Add Plugin | enable | @{plugins_to_enable}
163 | | | Run keyword | ${dut}.Add IP6 Hash Buckets | 2000000
164 | | | Run keyword | ${dut}.Add IP6 Heap Size | 4G
165 | | | Run keyword | ${dut}.Add IP Heap Size | 4G
166
167 | Add worker threads and rxqueues to all DUTs
168 | | [Documentation] | Setup worker threads and rxqueues in vpp startup
169 | | ... | configuration on all DUTs. Based on the SMT configuration of DUT if
170 | | ... | enabled keyword will automatically map also the sibling logical cores.
171 | | ... | Keyword will automatically set the appropriate test TAGs in format
172 | | ... | mTnC, where m=logical_core_count and n=physical_core_count.
173 | | ...
174 | | ... | *Arguments:*
175 | | ... | - phy_cores - Number of physical cores to use. Type: integer
176 | | ... | - rx_queues - Number of RX queues. Type: integer
177 | | ...
178 | | ... | *Example:*
179 | | ...
180 | | ... | \| Add worker threads and rxqueues to all DUTs \| ${1} \| ${1} \|
181 | | ...
182 | | [Arguments] | ${phy_cores} | ${rx_queues}=${None}
183 | | ...
184 | | ${cpu_count_int} | Convert to Integer | ${phy_cores}
185 | | ${thr_count_int} | Convert to Integer | ${phy_cores}
186 | | ${num_mbufs_int} | Convert to Integer | 16384
187 | | ${duts}= | Get Matches | ${nodes} | DUT*
188 | | :FOR | ${dut} | IN | @{duts}
189 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
190 | | | ... | Variable Should Exist | ${${dut}_if1}
191 | | | @{if_list}= | Run Keyword If | '${if1_status}' == 'PASS'
192 | | | ... | Create List | ${${dut}_if1}
193 | | | ... | ELSE | Create List | ${${dut}_if1_1} | ${${dut}_if1_2}
194 | | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
195 | | | ... | Variable Should Exist | ${${dut}_if2}
196 | | | Run Keyword If | '${if2_status}' == 'PASS'
197 | | | ... | Append To List | ${if_list} | ${${dut}_if2}
198 | | | ... | ELSE
199 | | | ... | Append To List | ${if_list} | ${${dut}_if2_1} | ${${dut}_if2_2}
200 | | | ${numa}= | Get interfaces numa node | ${nodes['${dut}']} | @{if_list}
201 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
202 | | | ${cpu_main}= | Cpu list per node str | ${nodes['${dut}']} | ${numa}
203 | | | ... | skip_cnt=${1} | cpu_cnt=${1}
204 | | | ${cpu_wt}= | Cpu list per node str | ${nodes['${dut}']} | ${numa}
205 | | | ... | skip_cnt=${2} | cpu_cnt=${cpu_count_int} | smt_used=${smt_used}
206 | | | ${thr_count_int}= | Run keyword if | ${smt_used}
207 | | | ... | Evaluate | int(${cpu_count_int}*2)
208 | | | ... | ELSE | Set variable | ${thr_count_int}
209 | | | ${rxq_count_int}= | Run keyword if | ${rx_queues}
210 | | | ... | Set variable | ${rx_queues}
211 | | | ... | ELSE | Evaluate | int(${thr_count_int}/2)
212 | | | ${rxq_count_int}= | Run keyword if | ${rxq_count_int} == 0
213 | | | ... | Set variable | ${1}
214 | | | ... | ELSE | Set variable | ${rxq_count_int}
215 | | | ${num_mbufs_int}= | Evaluate | int(${num_mbufs_int}*${rxq_count_int})
216 | | | Run keyword | ${dut}.Add CPU Main Core | ${cpu_main}
217 | | | Run keyword | ${dut}.Add CPU Corelist Workers | ${cpu_wt}
218 | | | Run keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
219 | | | Run keyword | ${dut}.Add DPDK Num Mbufs | ${num_mbufs_int}
220 | | | Run keyword if | ${thr_count_int} > 1
221 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
222 | | | Set Tags | ${thr_count_int}T${cpu_count_int}C
223 | | Set Test Variable | ${smt_used}
224 | | Set Test Variable | ${thr_count_int}
225 | | Set Test Variable | ${cpu_count_int}
226 | | Set Test Variable | ${rxq_count_int}
227
228 | Create Kubernetes VSWITCH startup config on all DUTs
229 | | [Documentation] | Create base startup configuration of VSWITCH in Kubernetes
230 | | ... | deploy to all DUTs.
231 | | ...
232 | | ... | *Arguments:*
233 | | ... | - ${jumbo} - Jumbo packet. Type: boolean
234 | | ... | - ${phy_cores} - Physical cores. Type: integer
235 | | ... | - ${rxq} - RX queues. Type: integer
236 | | ...
237 | | ... | *Example:*
238 | | ...
239 | | ... | \| Create Kubernetes VSWITCH startup config on all DUTs \| ${True} \
240 | | ... | \| ${1} \| ${1}
241 | | ...
242 | | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${jumbo}=${False}
243 | | ...
244 | | ${cpu_count_int} | Convert to Integer | ${phy_cores}
245 | | ${thr_count_int} | Convert to Integer | ${phy_cores}
246 | | ${num_mbufs_int} | Convert to Integer | 16384
247 | | ${duts}= | Get Matches | ${nodes} | DUT*
248 | | :FOR | ${dut} | IN | @{duts}
249 | | | ${numa}= | Get interfaces numa node | ${nodes['${dut}']}
250 | | | ... | ${${dut}_if1} | ${${dut}_if2}
251 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
252 | | | ${if1_pci}= | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1}
253 | | | ${if2_pci}= | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2}
254 | | | ${thr_count_int}= | Run keyword if | ${smt_used}
255 | | | ... | Evaluate | int(${cpu_count_int}*2)
256 | | | ... | ELSE | Set variable | ${thr_count_int}
257 | | | ${rxq_count_int}= | Run keyword if | ${rx_queues}
258 | | | ... | Set variable | ${rx_queues}
259 | | | ... | ELSE | Evaluate | int(${thr_count_int}/2)
260 | | | ${rxq_count_int}= | Run keyword if | ${rxq_count_int} == 0
261 | | | ... | Set variable | ${1}
262 | | | ... | ELSE | Set variable | ${rxq_count_int}
263 | | | ${num_mbufs_int}= | Evaluate | int(${num_mbufs_int}*${rxq_count_int})
264 | | | ${config}= | Run keyword | Create Kubernetes VSWITCH startup config
265 | | | ... | node=${nodes['${dut}']} | phy_cores=${phy_cores}
266 | | | ... | cpu_node=${numa} | jumbo=${jumbo} | rxq_count_int=${rxq_count_int}
267 | | | ... | num_mbufs_int=${num_mbufs_int}
268 | | | ... | filename=/tmp/vswitch.conf | if1=${if1_pci} | if2=${if2_pci}
269 | | | Run keyword if | ${thr_count_int} > 1
270 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
271 | | | Set Tags | ${thr_count_int}T${cpu_count_int}C
272 | | Set Test Variable | ${smt_used}
273 | | Set Test Variable | ${thr_count_int}
274 | | Set Test Variable | ${cpu_count_int}
275 | | Set Test Variable | ${rxq_count_int}
276
277 | Create Kubernetes VNF'${i}' startup config on all DUTs
278 | | [Documentation] | Create base startup configuration of VNF in Kubernetes
279 | | ... | deploy to all DUTs.
280 | | ...
281 | | ${i_int}= | Convert To Integer | ${i}
282 | | ${cpu_skip}= | Evaluate | ${vswitch_cpus}+${system_cpus}
283 | | ${dut1_numa}= | Get interfaces numa node | ${dut1}
284 | | ... | ${dut1_if1} | ${dut1_if2}
285 | | ${dut2_numa}= | Get interfaces numa node | ${dut2}
286 | | ... | ${dut2_if1} | ${dut2_if2}
287 | | ${config}= | Run keyword | Create Kubernetes VNF startup config
288 | | ... | node=${dut1} | phy_cores=${vnf_cpus} | cpu_node=${dut1_numa}
289 | | ... | cpu_skip=${cpu_skip} | filename=/tmp/vnf${i}.conf
290 | | ... | i=${i_int}
291 | | ${config}= | Run keyword | Create Kubernetes VNF startup config
292 | | ... | node=${dut2} | phy_cores=${vnf_cpus} | cpu_node=${dut2_numa}
293 | | ... | cpu_skip=${cpu_skip} | filename=/tmp/vnf${i}.conf
294 | | ... | i=${i_int}
295
296 | Add no multi seg to all DUTs
297 | | [Documentation] | Add No Multi Seg to VPP startup configuration to all DUTs.
298 | | ...
299 | | ${duts}= | Get Matches | ${nodes} | DUT*
300 | | :FOR | ${dut} | IN | @{duts}
301 | | | Run keyword | ${dut}.Add DPDK No Multi Seg
302
303 | Add DPDK no PCI to all DUTs
304 | | [Documentation] | Add DPDK no-pci to VPP startup configuration to all DUTs.
305 | | ...
306 | | ${duts}= | Get Matches | ${nodes} | DUT*
307 | | :FOR | ${dut} | IN | @{duts}
308 | | | Run keyword | ${dut}.Add DPDK no PCI
309
310 | Add DPDK dev default RXD to all DUTs
311 | | [Documentation] | Add DPDK num-rx-desc to VPP startup configuration to all
312 | | ... | DUTs.
313 | | ...
314 | | ... | *Arguments:*
315 | | ... | - rxd - Number of RX descriptors. Type: string
316 | | ...
317 | | ... | *Example:*
318 | | ...
319 | | ... | \| Add DPDK dev default RXD to all DUTs \| ${rxd} \|
320 | | ...
321 | | [Arguments] | ${rxd}
322 | | ...
323 | | ${duts}= | Get Matches | ${nodes} | DUT*
324 | | :FOR | ${dut} | IN | @{duts}
325 | | | Run keyword | ${dut}.Add DPDK Dev Default RXD | ${rxd}
326
327 | Add DPDK dev default TXD to all DUTs
328 | | [Documentation] | Add DPDK num-tx-desc to VPP startup configuration to all
329 | | ... | DUTs.
330 | | ...
331 | | ... | *Arguments:*
332 | | ... | - txd - Number of TX descriptors. Type: string
333 | | ...
334 | | ... | *Example:*
335 | | ...
336 | | ... | \| Add DPDK dev default TXD to all DUTs \| ${txd} \|
337 | | ...
338 | | [Arguments] | ${txd}
339 | | ...
340 | | ${duts}= | Get Matches | ${nodes} | DUT*
341 | | :FOR | ${dut} | IN | @{duts}
342 | | | Run keyword | ${dut}.Add DPDK Dev Default TXD | ${txd}
343
344 | Add DPDK Uio Driver on all DUTs
345 | | [Documentation] | Add DPDK uio driver to VPP startup configuration on all
346 | | ... | DUTs.
347 | | ...
348 | | ... | *Arguments:*
349 | | ... | - uio_driver - Required uio driver. Type: string
350 | | ...
351 | | ... | *Example:*
352 | | ...
353 | | ... | \| Add DPDK Uio Driver on all DUTs \| igb_uio \|
354 | | ...
355 | | [Arguments] | ${uio_driver}
356 | | ...
357 | | ${duts}= | Get Matches | ${nodes} | DUT*
358 | | :FOR | ${dut} | IN | @{duts}
359 | | | Run keyword | ${dut}.Add DPDK Uio Driver | ${uio_driver}
360
361 | Add NAT to all DUTs
362 | | [Documentation] | Add NAT configuration to all DUTs.
363 | | ...
364 | | ${duts}= | Get Matches | ${nodes} | DUT*
365 | | :FOR | ${dut} | IN | @{duts}
366 | | | Run keyword | ${dut}.Add NAT
367
368 | Add cryptodev to all DUTs
369 | | [Documentation] | Add Cryptodev to VPP startup configuration to all DUTs.
370 | | ...
371 | | ... | *Arguments:*
372 | | ... | - count - Number of QAT devices. Type: integer
373 | | ...
374 | | ... | *Example:*
375 | | ...
376 | | ... | \| Add cryptodev to all DUTs \| ${4} \|
377 | | ...
378 | | [Arguments] | ${count}
379 | | ${duts}= | Get Matches | ${nodes} | DUT*
380 | | :FOR | ${dut} | IN | @{duts}
381 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
382 | | | ${thr_count_int}= | Run keyword if | ${smt_used}
383 | | | ... | Evaluate | int(${count}*2)
384 | | | ... | ELSE | Set variable | ${count}
385 | | | Run keyword | ${dut}.Add DPDK Cryptodev | ${thr_count_int}
386
387 | Add DPDK SW cryptodev on DUTs in 3-node single-link circular topology
388 | | [Documentation] | Add required number of SW crypto devices of given type
389 | | ... | to VPP startup configuration on all DUTs in 3-node single-link
390 | | ... | circular topology.
391 | | ...
392 | | ... | *Arguments:*
393 | | ... | - sw_pmd_type - PMD type of SW crypto device. Type: string
394 | | ... | - count - Number of SW crypto devices. Type: string
395 | | ...
396 | | ... | *Example:*
397 | | ...
398 | | ... | \| Add DPDK SW cryptodev on DUTs in 3-node single-link circular\
399 | | ... | topology \| aesni-mb \| ${2} \|
400 | | ...
401 | | [Arguments] | ${sw_pmd_type} | ${count}
402 | | ${smt_used}= | Is SMT enabled | ${nodes['DUT1']['cpuinfo']}
403 | | ${thr_count_int}= | Run keyword if | ${smt_used}
404 | | ... | Evaluate | int(${count}*2)
405 | | ... | ELSE | Set variable | ${count}
406 | | ${socket_id}= | Get Interface Numa Node | ${nodes['DUT1']} | ${dut1_if2}
407 | | Run keyword | DUT1.Add DPDK SW Cryptodev | ${sw_pmd_type} | ${socket_id}
408 | | ... | ${thr_count_int}
409 | | ${smt_used}= | Is SMT enabled | ${nodes['DUT2']['cpuinfo']}
410 | | ${thr_count_int}= | Run keyword if | ${smt_used}
411 | | ... | Evaluate | int(${count}*2)
412 | | ... | ELSE | Set variable | ${count}
413 | | ${socket_id}= | Get Interface Numa Node | ${nodes['DUT2']} | ${dut2_if1}
414 | | Run keyword | DUT2.Add DPDK SW Cryptodev | ${sw_pmd_type} | ${socket_id}
415 | | ... | ${thr_count_int}
416
417 | Apply startup configuration on all VPP DUTs
418 | | [Documentation] | Write startup configuration and restart VPP on all DUTs.
419 | | ...
420 | | ... | *Arguments:*
421 | | ... | - restart_vpp - Whether to restart VPP (Optional). Type: boolean
422 | | ...
423 | | ... | *Example:*
424 | | ...
425 | | ... | \| Apply startup configuration on all VPP DUTs \| ${False} \|
426 | | ...
427 | | [Arguments] | ${restart_vpp}=${True}
428 | | ...
429 | | ${duts}= | Get Matches | ${nodes} | DUT*
430 | | :FOR | ${dut} | IN | @{duts}
431 | | | Run keyword | ${dut}.Apply Config | restart_vpp=${restart_vpp}
432 | | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${True}
433
434 | Save VPP PIDs
435 | | [Documentation] | Get PIDs of VPP processes from all DUTs in topology and\
436 | | ... | set it as a test variable. The PIDs are stored as dictionary items\
437 | | ... | where the key is the host and the value is the PID.
438 | | ...
439 | | ${setup_vpp_pids}= | Get VPP PIDs | ${nodes}
440 | | ${keys}= | Get Dictionary Keys | ${setup_vpp_pids}
441 | | :FOR | ${key} | IN | @{keys}
442 | | | ${pid}= | Get From Dictionary | ${setup_vpp_pids} | ${key}
443 | | | Run Keyword If | $pid is None | FAIL | No VPP PID found on node ${key}
444 | | | Run Keyword If | ',' in '${pid}'
445 | | | ... | FAIL | More then one VPP PID found on node ${key}: ${pid}
446 | | Set Test Variable | ${setup_vpp_pids}
447
448 | Verify VPP PID in Teardown
449 | | [Documentation] | Check if the VPP PIDs on all DUTs are the same at the end\
450 | | ... | of test as they were at the begining. If they are not, only a message\
451 | | ... | is printed on console and to log. The test will not fail.
452 | | ...
453 | | ${teardown_vpp_pids}= | Get VPP PIDs | ${nodes}
454 | | ${err_msg}= | Catenate | ${SUITE NAME} - ${TEST NAME}
455 | | ... | \nThe VPP PIDs are not equal!\nTest Setup VPP PIDs:
456 | | ... | ${setup_vpp_pids}\nTest Teardown VPP PIDs: ${teardown_vpp_pids}
457 | | ${rc} | ${msg}= | Run keyword and ignore error
458 | | ... | Dictionaries Should Be Equal
459 | | ... | ${setup_vpp_pids} | ${teardown_vpp_pids}
460 | | Run Keyword And Return If | '${rc}'=='FAIL' | Log | ${err_msg}
461 | | ... | console=yes | level=WARN
462
463 | Set up functional test
464 | | [Documentation] | Common test setup for functional tests.
465 | | ...
466 | | Configure all DUTs before test
467 | | Save VPP PIDs
468 | | Configure all TGs for traffic script
469 | | Update All Interface Data On All Nodes | ${nodes}
470 | | Reset VAT History On All DUTs | ${nodes}
471
472 | Tear down functional test
473 | | [Documentation] | Common test teardown for functional tests.
474 | | ...
475 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
476 | | Show Packet Trace on All DUTs | ${nodes}
477 | | Show VAT History On All DUTs | ${nodes}
478 | | Vpp Show Errors On All DUTs | ${nodes}
479 | | Verify VPP PID in Teardown
480
481 | Set up VPP device test
482 # TODO: Generalize this KW if it will not diverge from Functional derivate too
483 # much
484 | | [Documentation] | Common test setup for vpp-device tests.
485 | | ...
486 | | Configure all DUTs before test
487 | | Save VPP PIDs
488 | | Configure all TGs for traffic script
489 | | Update All Interface Data On All Nodes | ${nodes} | skip_tg_udev=${True}
490 | | Reset VAT History On All DUTs | ${nodes}
491
492 | Tear down VPP device test
493 # TODO: Generalize this KW if it will not diverge from Functional derivate too
494 # much
495 | | [Documentation] | Common test teardown for vpp-device tests.
496 | | ...
497 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
498 | | Show Packet Trace on All DUTs | ${nodes}
499 | | Show VAT History On All DUTs | ${nodes}
500 | | Vpp Show Errors On All DUTs | ${nodes}
501 | | Verify VPP PID in Teardown
502
503 | Tear down LISP functional test
504 | | [Documentation] | Common test teardown for functional tests with LISP.
505 | | ...
506 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
507 | | Show Packet Trace on All DUTs | ${nodes}
508 | | Show VAT History On All DUTs | ${nodes}
509 | | Show Vpp Settings | ${nodes['DUT1']}
510 | | Show Vpp Settings | ${nodes['DUT2']}
511 | | Vpp Show Errors On All DUTs | ${nodes}
512 | | Verify VPP PID in Teardown
513
514 | Tear down LISP functional test with QEMU
515 | | [Documentation] | Common test teardown for functional tests with LISP and\
516 | | ... | QEMU.
517 | | ...
518 | | ... | *Arguments:*
519 | | ... | - vm_node - VM to stop. Type: string
520 | | ...
521 | | ... | *Example:*
522 | | ...
523 | | ... | \| Tear down LISP functional test with QEMU \| ${vm_node} \|
524 | | ...
525 | | [Arguments] | ${vm_node}
526 | | ...
527 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
528 | | Show Packet Trace on All DUTs | ${nodes}
529 | | Show VAT History On All DUTs | ${nodes}
530 | | Show Vpp Settings | ${nodes['DUT1']}
531 | | Show Vpp Settings | ${nodes['DUT2']}
532 | | Vpp Show Errors On All DUTs | ${nodes}
533 | | Stop and clear QEMU | ${nodes['DUT1']} | ${vm_node}
534 | | Verify VPP PID in Teardown
535
536 | Set up TAP functional test
537 | | [Documentation] | Common test setup for functional tests with TAP.
538 | | ...
539 | | Set up functional test
540 | | Clean Up Namespaces | ${nodes['DUT1']}
541
542 | Set up functional test with containers
543 | | [Documentation]
544 | | ... | Common test setup for functional tests with containers.
545 | | ...
546 | | ... | *Arguments:*
547 | | ... | - chains: Total number of chains (Optional). Type: integer, default
548 | | ... | value: ${1}
549 | | ... | - nodeness: Total number of nodes per chain (Optional). Type: integer,
550 | | ... | default value: ${1}
551 | | ...
552 | | ... | _NOTE:_ This KW sets following test case variables:
553 | | ... | - tmp_volume - Docker volume mounted as /tmp directory on DUT1.
554 | | ... | - dcr_uuid - UUID string (including prefix - underscore character) of
555 | | ... | DUT1 /tmp volume.
556 | | ...
557 | | ... | *Example:*
558 | | ...
559 | | ... | \| Set up functional test with containers \| 1 \| 1 \|
560 | | ...
561 | | [Arguments] | ${chains}=${1} | ${nodeness}=${1}
562 | | ...
563 | | Set Test Variable | @{container_groups} | @{EMPTY}
564 | | Set Test Variable | ${container_group} | CNF
565 | | Import Library | resources.libraries.python.ContainerUtils.ContainerManager
566 | | ... | engine=${container_engine} | WITH NAME | ${container_group}
567 | | ...
568 | | ${tmp_volume}= | Get Environment Variable | CSIT_DUT1_VOL
569 | | ${dcr_uuid}= | Remove String | ${tmp_volume} | DUT1_VOL
570 | | Set Test Variable | ${tmp_volume}
571 | | Set Test Variable | ${dcr_uuid}
572 | | ...
573 | | Construct chains of containers on all DUTs | ${chains} | ${nodeness}
574 | | ... | set_nf_cpus=${False}
575 | | Acquire all '${container_group}' containers
576 | | Create all '${container_group}' containers
577 | | Configure VPP in all '${container_group}' containers
578 | | Stop VPP service on all DUTs | ${nodes}
579 | | Install VPP in all '${container_group}' containers
580 | | Start VPP service on all DUTs | ${nodes}
581 | | Append To List | ${container_groups} | ${container_group}
582
583 | Tear down TAP functional test
584 | | [Documentation] | Common test teardown for functional tests with TAP.
585 | | ...
586 | | Tear down functional test
587 | | Clean Up Namespaces | ${nodes['DUT1']}
588
589 | Tear down TAP functional test with Linux bridge
590 | | [Documentation] | Common test teardown for functional tests with TAP and
591 | | ... | a Linux bridge.
592 | | ...
593 | | ... | *Arguments:*
594 | | ... | - bid_TAP - Bridge name. Type: string
595 | | ...
596 | | ... | *Example:*
597 | | ...
598 | | ... | \| Tear down TAP functional test with Linux bridge \| ${bid_TAP} \|
599 | | ...
600 | | [Arguments] | ${bid_TAP}
601 | | ...
602 | | Tear down functional test
603 | | Linux Del Bridge | ${nodes['DUT1']} | ${bid_TAP}
604 | | Clean Up Namespaces | ${nodes['DUT1']}
605
606 | Tear down FDS functional test
607 | | [Documentation] | Common test teardown for FDS functional tests.
608 | | ...
609 | | ... | *Arguments:*
610 | | ... | - dut1_node - Node Nr.1 where to clean qemu. Type: dictionary
611 | | ... | - qemu_node1 - VM Nr.1 node info dictionary. Type: string
612 | | ... | - dut2_node - Node Nr.2 where to clean qemu. Type: dictionary
613 | | ... | - qemu_node2 - VM Nr.2 node info dictionary. Type: string
614 | | ...
615 | | ... | *Example:*
616 | | ...
617 | | ... | \| Tear down FDS functional test \| ${dut1_node} \| ${qemu_node1}\
618 | | ... | \| ${dut2_node} \| ${qemu_node2} \|
619 | | ...
620 | | [Arguments] | ${dut1_node} | ${qemu_node1} | ${dut2_node}
621 | | ... | ${qemu_node2}
622 | | ...
623 | | Tear down functional test
624 | | Tear down QEMU | ${dut1_node} | ${qemu_node1} | qemu_node1
625 | | Tear down QEMU | ${dut2_node} | ${qemu_node2} | qemu_node2
626
627 | Tear down functional test with container
628 | | [Documentation]
629 | | ... | Common test teardown for functional tests which uses containers.
630 | | ...
631 | | :FOR | ${container_group} | IN | @{container_groups}
632 | | | Destroy all '${container_group}' containers
633
634 | Stop VPP Service on DUT
635 | | [Documentation] | Stop the VPP service on the specified node.
636 | | ...
637 | | ... | *Arguments:*
638 | | ... | - node - information about a DUT node. Type: dictionary
639 | | ...
640 | | ... | *Example:*
641 | | ...
642 | | ... | \| Stop VPP Service on DUT \| ${nodes['DUT1']} \|
643 | | ...
644 | | [Arguments] | ${node}
645 | | Stop VPP Service | ${node}
646
647 | Start VPP Service on DUT
648 | | [Documentation] | Start the VPP service on the specified node.
649 | | ...
650 | | ... | *Arguments:*
651 | | ... | - node - information about a DUT node. Type: dictionary
652 | | ...
653 | | ... | *Example:*
654 | | ...
655 | | ... | \| Start VPP Service on DUT \| ${nodes['DUT1']} \|
656 | | ...
657 | | [Arguments] | ${node}
658 | | Start VPP Service | ${node}