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