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