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