Device: Add stats test with AVF
[csit.git] / resources / libraries / robot / shared / default.robot
1 # Copyright (c) 2021 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.Adl
24 | Library | resources.libraries.python.Classify
25 | Library | resources.libraries.python.CpuUtils
26 | Library | resources.libraries.python.CoreDumpUtil
27 | Library | resources.libraries.python.DUTSetup
28 | Library | resources.libraries.python.L2Util
29 | Library | resources.libraries.python.InterfaceUtil
30 | Library | resources.libraries.python.IPUtil
31 | Library | resources.libraries.python.IPv6Util
32 | Library | resources.libraries.python.NodePath
33 | Library | resources.libraries.python.Namespaces
34 | Library | resources.libraries.python.PapiHistory
35 | Library | resources.libraries.python.SchedUtils
36 | Library | resources.libraries.python.Tap
37 | Library | resources.libraries.python.Tap.TapFeatureMask
38 | Library | resources.libraries.python.TestConfig
39 | Library | resources.libraries.python.TGSetup
40 | Library | resources.libraries.python.topology.Topology
41 | Library | resources.libraries.python.Trace
42 | Library | resources.libraries.python.VhostUser.VirtioFeatureMask
43 | Library | resources.libraries.python.VppCounters
44 | Library | resources.libraries.python.VPPUtil
45 |
46 | Resource | resources/libraries/robot/lb/load_balancer.robot
47 | Resource | resources/libraries/robot/crypto/ipsec.robot
48 | Resource | resources/libraries/robot/features/acl.robot
49 | Resource | resources/libraries/robot/features/policer.robot
50 | Resource | resources/libraries/robot/ip/ip4.robot
51 | Resource | resources/libraries/robot/ip/ip6.robot
52 | Resource | resources/libraries/robot/ip/nat.robot
53 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
54 | Resource | resources/libraries/robot/l2/l2_patch.robot
55 | Resource | resources/libraries/robot/l2/l2_traffic.robot
56 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
57 | Resource | resources/libraries/robot/l2/tagging.robot
58 | Resource | resources/libraries/robot/overlay/srv6.robot
59 | Resource | resources/libraries/robot/overlay/lisp.robot
60 | Resource | resources/libraries/robot/overlay/lispgpe.robot
61 | Resource | resources/libraries/robot/overlay/lisp_api.robot
62 | Resource | resources/libraries/robot/performance/performance_utils.robot
63 | Resource | resources/libraries/robot/shared/interfaces.robot
64 | Resource | resources/libraries/robot/shared/container.robot
65 | Resource | resources/libraries/robot/shared/memif.robot
66 | Resource | resources/libraries/robot/shared/suite_teardown.robot
67 | Resource | resources/libraries/robot/shared/suite_setup.robot
68 | Resource | resources/libraries/robot/shared/test_teardown.robot
69 | Resource | resources/libraries/robot/shared/test_setup.robot
70 | Resource | resources/libraries/robot/shared/traffic.robot
71 | Resource | resources/libraries/robot/shared/vm.robot
72
73 *** Variables ***
74 | ${cpu_alloc_str}= | ${0}
75
76 *** Keywords ***
77 # TODO: Sort keywords alphabetically.
78
79 | Call Resetter
80 | | [Documentation]
81 | | ... | Check for a presence of test variable \${resetter}.
82 | | ... | If it exists (and not None), call the resetter (as a Python callable).
83 | | ... | This is usually used to reset any state on DUT before next trial.
84 | |
85 | | ... | TODO: Move to a more specific library if needed.
86 | |
87 | | ... | *Example:*
88 | |
89 | | ... | \| Call Resetter \|
90 | |
91 | | ${resetter} = | Get Resetter
92 | | # See http://robotframework.org/robotframework/3.1.2/libraries/BuiltIn.html
93 | | # #Evaluating%20expressions for $variable (without braces) syntax.
94 | | # Parens are there to perform the call.
95 | | Run Keyword If | $resetter | Evaluate | $resetter()
96
97 | Verify statistic commands
98 | | [Documentation]
99 | | ... | Execute several commands related to stats.
100 | | ... | To be used by "stats" device tests,
101 | | ... | as other device tests do not interact with stats.
102 | |
103 | | ... | The commands should also cover frequently used
104 | | ... | PAPI (non-stats) commands and CLI commands.
105 | |
106 | | ${results}= | Create List
107 | | ${status} | ${value}= | Run Keyword And Ignore Error
108 | | ... | VPP Show Runtime On All DUTs | ${nodes}
109 | | Append To List | ${results} | ${status}
110 | | ${status} | ${value}= | Run Keyword And Ignore Error
111 | | ... | Show Statistics On All DUTs | ${nodes}
112 | | Append To List | ${results} | ${status}
113 | | ${status} | ${value}= | Run Keyword And Ignore Error
114 | | ... | Show Event Logger On All DUTs | ${nodes}
115 | | Append To List | ${results} | ${status}
116 | | ${status} | ${value}= | Run Keyword And Ignore Error
117 | | ... | VPP Clear Runtime On All DUTs | ${nodes}
118 | | Append To List | ${results} | ${status}
119 | | ${status} | ${value}= | Run Keyword And Ignore Error
120 | | ... | Clear Statistics On All DUTs | ${nodes}
121 | | Append To List | ${results} | ${status}
122 | | Should Not Contain Match | ${results} | FAIL
123 | | ... | msg=At least one of statistic commands failed!
124
125 | Workers From Physical Cores
126 | | [Documentation]
127 | | ... | Convert from core count to worker count.
128 | |
129 | | ... | This just calls CpuUtils.worker_count_from_cores_and_smt keyword
130 | | ... | with the global \${smt_used} value.
131 | | ... | See documentation there.
132 | |
133 | | ... | *Arguments:*
134 | | ... | - phy_cores - Number of physical cores to convert from. Type: integer.
135 | |
136 | | ... | *Return value:*
137 | | ... | - Number of workers active on the given number of cores.
138 | |
139 | | ... | *Example:*
140 | |
141 | | ... | \| \${dp_workers} = \| Workers from Physical Cores \| \${1} \|
142 | |
143 | | [Arguments] | ${phy_cores}
144 | |
145 | | Run Keyword And Return | Worker Count From Cores And Smt
146 | | ... | phy_cores=${phy_cores} | smt_used=${smt_used}
147
148 | Configure crypto device on all DUTs
149 | | [Documentation] | Verify if Crypto QAT device virtual functions are
150 | | ... | initialized on all DUTs. If parameter force_init is set to True, then
151 | | ... | try to initialize/disable.
152 | |
153 | | ... | *Arguments:*
154 | | ... | - crypto_type - Crypto device type - HW_DH895xcc or HW_C3xxx; default
155 | | ... | value: HW_DH895xcc. Type: string
156 | | ... | - numvfs - Number of VFs to initialize, 0 - disable the VFs; default
157 | | ... | value: ${32} Type: integer
158 | | ... | - force_init - Force to initialize. Type: boolean
159 | |
160 | | ... | *Example:*
161 | |
162 | | ... | \| Configure crypto device on all DUTs \| HW_DH895xcc \| ${32} \|
163 | |
164 | | [Arguments] | ${crypto_type} | ${numvfs} | ${force_init}=${False}
165 | |
166 | | FOR | ${dut} | IN | @{duts}
167 | | | Crypto Device Verify | ${nodes['${dut}']} | ${crypto_type}
168 | | | ... | ${numvfs} | force_init=${force_init}
169 | | END
170
171 | Configure kernel module on all DUTs
172 | | [Documentation] | Verify if specific kernel module is loaded on all DUTs.
173 | | ... | If parameter force_load is set to True, then try to load.
174 | |
175 | | ... | *Arguments:*
176 | | ... | - module - Module to verify. Type: string
177 | | ... | - force_load - Try to load module. Type: boolean
178 | |
179 | | ... | *Example:*
180 | |
181 | | ... | \| Configure kernel module on all DUTs \| ${True} \|
182 | |
183 | | [Arguments] | ${module} | ${force_load}=${False}
184 | |
185 | | Verify Kernel Module on All DUTs | ${nodes} | ${module}
186 | | ... | force_load=${force_load}
187
188 | Get Keyname for DUT
189 | | [Documentation]
190 | | ... | Get the Keyname for the DUT in the keyname list.
191 | | ... | Returns lowercase keyname value.
192 | |
193 | | ... | *Arguments:*
194 | | ... | - dutx - DUT to find keyname. Type: dict
195 | | ... | - dut_keys - DUT Keynames to search. Type: list
196 | |
197 | | ... | *Example:*
198 | |
199 | | ... | \| Get Keyname for DUT \| ${dutx} \| ${duts} \|
200 | |
201 | | [Arguments] | ${dutx} | ${dut_keys}
202 | |
203 | | FOR | ${key} | IN | @{dut_keys}
204 | | | ${found_key} | ${value}= | Run Keyword And Ignore Error
205 | | | ... | Dictionaries Should Be Equal | ${nodes['${key}']} | ${dutx}
206 | | | Run Keyword If | '${found_key}' == 'PASS' | EXIT FOR LOOP
207 | | END
208 | | Run Keyword If | '${found_key}' != 'PASS'
209 | | ... | Fail | Keyname for ${dutx} not found
210 | | ${keyname}= | Convert To Lowercase | ${key}
211 | | Return From Keyword | ${keyname}
212
213 | Create base startup configuration of VPP on all DUTs
214 | | [Documentation] | Create base startup configuration of VPP to all DUTs.
215 | |
216 | | FOR | ${dut} | IN | @{duts}
217 | | | Import Library | resources.libraries.python.VppConfigGenerator
218 | | | ... | WITH NAME | ${dut}
219 | | | Run Keyword | ${dut}.Set Node | ${nodes['${dut}']} | node_key=${dut}
220 | | | Run Keyword | ${dut}.Add Unix Log
221 | | | Run Keyword | ${dut}.Add Unix CLI Listen
222 | | | Run Keyword | ${dut}.Add Unix Nodaemon
223 | | | Run Keyword | ${dut}.Add Unix Coredump
224 | | | Run Keyword | ${dut}.Add Socksvr | ${SOCKSVR_PATH}
225 | | | Run Keyword | ${dut}.Add Main Heap Size | ${${heap_size_mult}*${2}}G
226 | | | Run Keyword | ${dut}.Add Main Heap Page Size | 2M
227 | | | Run Keyword | ${dut}.Add Statseg Size | 2G
228 | | | Run Keyword | ${dut}.Add Statseg Page Size | 2M
229 | | | Run Keyword | ${dut}.Add Statseg Per Node Counters | on
230 | | | Run Keyword | ${dut}.Add Plugin | disable | default
231 | | | Run Keyword | ${dut}.Add Plugin | enable | @{plugins_to_enable}
232 | | | Run Keyword | ${dut}.Add IP6 Hash Buckets | 2000000
233 | | | Run Keyword | ${dut}.Add IP6 Heap Size | 4G
234 | | | Run Keyword | ${dut}.Add Graph Node Variant | ${GRAPH_NODE_VARIANT}
235 | | END
236
237 | Add worker threads to all DUTs
238 | | [Documentation] | Setup worker threads in vpp startup configuration on all
239 | | ... | DUTs. Based on the SMT configuration of DUT if enabled keyword will
240 | | ... | automatically map also the sibling logical cores.
241 | | ... | Keyword will automatically set the appropriate test TAGs in format
242 | | ... | mTnC, where m=logical_core_count and n=physical_core_count.
243 | | ... | RXQ are computed automatically by dividing thread count with number 2
244 | | ... | (TODO: Add division by actual number of interfaces). User can manually
245 | | ... | override RX, RXD, TXD parameters if needed.
246 | |
247 | | ... | *Arguments:*
248 | | ... | - phy_cores - Number of physical cores to use. Type: integer
249 | | ... | - rx_queues - Number of RX queues. Type: integer
250 | | ... | - rxd - Number of RX descriptors. Type: integer
251 | | ... | - txd - Number of TX descriptors. Type: integer
252 | |
253 | | ... | *Example:*
254 | |
255 | | ... | \| Add worker threads to all DUTs \| ${1} \| ${1} \|
256 | |
257 | | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${rxd}=${None}
258 | | ... | ${txd}=${None}
259 | |
260 | | ${cpu_count_int} | Convert to Integer | ${phy_cores}
261 | | ${thr_count_int} | Convert to Integer | ${phy_cores}
262 | | ${rxd_count_int}= | Set variable | ${rxd}
263 | | ${txd_count_int}= | Set variable | ${txd}
264 | | FOR | ${dut} | IN | @{duts}
265 | | | ${numa}= | Get interfaces numa node
266 | | | ... | ${nodes['${dut}']} | @{${dut}_pf_keys}
267 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
268 | | | ${skip_cnt}= | Set variable | ${CPU_CNT_SYSTEM}
269 | | | ${cpu_main}= | Cpu list per node str | ${nodes['${dut}']} | ${numa}
270 | | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${CPU_CNT_MAIN}
271 | | | ${skip_cnt}= | Evaluate | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN}
272 | | | ${cpu_wt}= | Run Keyword If | ${cpu_count_int} > 0 |
273 | | | ... | Cpu list per node str | ${nodes['${dut}']} | ${numa}
274 | | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${cpu_count_int}
275 | | | ... | smt_used=${smt_used}
276 | | | ${thr_count_int}= | Run Keyword If | ${smt_used}
277 | | | ... | Evaluate | int(${cpu_count_int}*2)
278 | | | ... | ELSE | Set variable | ${thr_count_int}
279 | | | ${rxq_ratio} = | Get Variable Value | \${rxq_ratio} | ${2}
280 | | | ${rxq_count_int}= | Run Keyword If | ${rx_queues}
281 | | | ... | Set variable | ${rx_queues}
282 | | | ... | ELSE | Evaluate | int(${thr_count_int}/${rxq_ratio})
283 | | | ${rxq_count_int}= | Run Keyword If | ${rxq_count_int} == 0
284 | | | ... | Set variable | ${1}
285 | | | ... | ELSE | Set variable | ${rxq_count_int}
286 | | | Run Keyword | ${dut}.Add CPU Main Core | ${cpu_main}
287 | | | Run Keyword If | ${cpu_count_int} > 0
288 | | | ... | ${dut}.Add CPU Corelist Workers | ${cpu_wt}
289 | | | Run Keyword If | ${smt_used}
290 | | | ... | Run Keyword | ${dut}.Add Buffers Per Numa | ${215040} | ELSE
291 | | | ... | Run Keyword | ${dut}.Add Buffers Per Numa | ${107520}
292 | | | Run Keyword If | ${thr_count_int} > 1
293 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
294 | | | Set Tags | ${thr_count_int}T${cpu_count_int}C
295 | | END
296 | | ${cpu_alloc_str}= | Catenate | SEPARATOR=, | ${cpu_alloc_str} | ${cpu_main}
297 | | ${cpu_alloc_str}= | Catenate | SEPARATOR=, | ${cpu_alloc_str} | ${cpu_wt}
298 | | Set Test Variable | ${smt_used}
299 | | Set Test Variable | ${cpu_alloc_str}
300 | | Set Test Variable | ${cpu_count_int}
301 | | Set Test Variable | ${thr_count_int}
302 | | Set Test Variable | ${rxd_count_int}
303 | | Set Test Variable | ${txd_count_int}
304 | | Set Test Variable | ${rxq_count_int}
305
306 | Add worker threads for GSO tests to all DUTs
307 | | [Documentation] | Setup worker threads in vpp startup configuration on all
308 | | ... | DUTs. Based on the SMT configuration of DUT if enabled keyword will
309 | | ... | automatically map also the sibling logical cores.
310 | | ... | Keyword will automatically set the appropriate test TAGs in format
311 | | ... | mTnC, where m=logical_core_count and n=physical_core_count.
312 | | ... | RXQ are computed automatically by dividing thread count with number 2
313 | | ... | (TODO: Add division by actual number of interfaces). User can manually
314 | | ... | override RX, RXD, TXD parameters if needed.
315 | |
316 | | ... | *Arguments:*
317 | | ... | - phy_cores - Number of physical cores to use. Type: integer
318 | | ... | - rx_queues - Number of RX queues. Type: integer
319 | | ... | - rxd - Number of RX descriptors. Type: integer
320 | | ... | - txd - Number of TX descriptors. Type: integer
321 | |
322 | | ... | *Example:*
323 | |
324 | | ... | \| Add worker threads for GSO tests to all DUTs \| ${1} \| ${1} \|
325 | |
326 | | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${rxd}=${None}
327 | | ... | ${txd}=${None}
328 | |
329 | | ${cpu_count_int} | Convert to Integer | ${phy_cores}
330 | | ${thr_count_int} | Convert to Integer | ${phy_cores}
331 | | ${rxd_count_int}= | Set variable | ${rxd}
332 | | ${txd_count_int}= | Set variable | ${txd}
333 | | FOR | ${dut} | IN | @{duts}
334 | | | ${numa}= | Get interfaces numa node
335 | | | ... | ${nodes['${dut}']} | @{${dut}_pf_keys}
336 | | | ${smt_used}= | Set variable | ${False}
337 | | | ${skip_cnt}= | Set variable | ${CPU_CNT_SYSTEM}
338 | | | ${cpu_main}= | Cpu list per node str | ${nodes['${dut}']} | ${numa}
339 | | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${CPU_CNT_MAIN}
340 | | | ${skip_cnt}= | Evaluate | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN}
341 | | | ${cpu_wt}= | Run Keyword If | ${cpu_count_int} > 0 |
342 | | | ... | Cpu list per node str | ${nodes['${dut}']} | ${numa}
343 | | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${cpu_count_int}
344 | | | ... | smt_used=${smt_used}
345 | | | ${thr_count_int}= | Run Keyword If | ${smt_used}
346 | | | ... | Evaluate | int(${cpu_count_int}*2)
347 | | | ... | ELSE | Set variable | ${thr_count_int}
348 | | | ${rxq_ratio} = | Get Variable Value | \${rxq_ratio} | ${2}
349 | | | ${rxq_count_int}= | Run Keyword If | ${rx_queues}
350 | | | ... | Set variable | ${rx_queues}
351 | | | ... | ELSE | Evaluate | int(${thr_count_int}/${rxq_ratio})
352 | | | ${rxq_count_int}= | Run Keyword If | ${rxq_count_int} == 0
353 | | | ... | Set variable | ${1}
354 | | | ... | ELSE | Set variable | ${rxq_count_int}
355 | | | Run Keyword | ${dut}.Add CPU Main Core | ${cpu_main}
356 | | | Run Keyword If | ${cpu_count_int} > 0
357 | | | ... | ${dut}.Add CPU Corelist Workers | ${cpu_wt}
358 | | | Run Keyword If | ${smt_used}
359 | | | ... | Run Keyword | ${dut}.Add Buffers Per Numa | ${215040} | ELSE
360 | | | ... | Run Keyword | ${dut}.Add Buffers Per Numa | ${107520}
361 | | | Run Keyword If | ${thr_count_int} > 1
362 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
363 | | | Set Tags | ${thr_count_int}T${cpu_count_int}C
364 | | END
365 | | ${cpu_alloc_str}= | Catenate | SEPARATOR=, | ${cpu_alloc_str} | ${cpu_main}
366 | | ${cpu_alloc_str}= | Catenate | SEPARATOR=, | ${cpu_alloc_str} | ${cpu_wt}
367 | | Set Test Variable | ${smt_used}
368 | | Set Test Variable | ${cpu_alloc_str}
369 | | Set Test Variable | ${cpu_count_int}
370 | | Set Test Variable | ${thr_count_int}
371 | | Set Test Variable | ${rxd_count_int}
372 | | Set Test Variable | ${txd_count_int}
373 | | Set Test Variable | ${rxq_count_int}
374
375 | Add DPDK VLAN strip offload switch off between DUTs
376 | | [Documentation]
377 | | ... | Add VLAN Strip Offload switch off on PCI devices between DUTs to VPP
378 | | ... | configuration file.
379 | |
380 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
381 | | | ${_even}= | Evaluate | ${pf} % 2
382 | | | Run Keyword Unless | ${even}
383 | | | ... | DUT1.Add DPDK Dev Parameter | ${DUT1_${int}${pf}_pci}[0]
384 | | | ... | vlan-strip-offload | off
385 | | END
386 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
387 | | | ${_even}= | Evaluate | ${pf} % 2
388 | | | Run Keyword If | ${even}
389 | | | ... | DUT2.Add DPDK Dev Parameter | ${DUT2_${int}${pf}_pci}[0]
390 | | | ... | vlan-strip-offload | off
391 | | END
392
393 | Add NAT to all DUTs
394 | | [Documentation] | Add NAT configuration to all DUTs.
395 | |
396 | | ... | *Arguments:*
397 | | ... | - nat_mode - NAT mode; default value: deterministic. Type: string
398 | |
399 | | ... | *Example:*
400 | |
401 | | ... | \| Add NAT to all DUTs \| nat_mode=endpoint-dependent \|
402 | |
403 | | [Arguments] | ${nat_mode}=deterministic
404 | |
405 | | FOR | ${dut} | IN | @{duts}
406 | | | Run Keyword | ${dut}.Add NAT | value=${nat_mode}
407 | | END
408
409 | Add NAT max translations per thread to all DUTs
410 | | [Documentation] | Add NAT maximum number of translations per thread
411 | | ... | configuration.
412 | |
413 | | ... | *Arguments:*
414 | | ... | - max_translations_per_thread - NAT maximum number of translations per
415 | | ... | thread. Type: string
416 | |
417 | | ... | *Example:*
418 | |
419 | | ... | \| Add NAT translation memory to all DUTs \
420 | | ... | \| max_translations_per_thread=2048 \|
421 | |
422 | | [Arguments] | ${max_translations_per_thread}=1024
423 | |
424 | | FOR | ${dut} | IN | @{duts}
425 | | | Run Keyword | ${dut}.Add NAT max translations per thread
426 | | | ... | value=${max_translations_per_thread}
427 | | END
428
429 | Write startup configuration on all VPP DUTs
430 | | [Documentation] | Write VPP startup configuration without restarting VPP.
431 | |
432 | | FOR | ${dut} | IN | @{duts}
433 | | | Run Keyword | ${dut}.Write Config
434 | | END
435
436 | Apply startup configuration on all VPP DUTs
437 | | [Documentation] | Write VPP startup configuration and restart VPP on all
438 | | ... | DUTs.
439 | |
440 | | ... | *Arguments:*
441 | | ... | - with_trace - Enable packet trace after VPP restart Type: boolean
442 | |
443 | | ... | *Example:*
444 | |
445 | | ... | \| Apply startup configuration on all VPP DUTs \| False \|
446 | |
447 | | [Arguments] | ${with_trace}=${False}
448 | |
449 | | FOR | ${dut} | IN | @{duts}
450 | | | Run Keyword | ${dut}.Apply Config
451 | | END
452 | | Save VPP PIDs
453 | | Enable Coredump Limit VPP on All DUTs | ${nodes}
454 | | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${True}
455 | | Run Keyword If | ${with_trace} | VPP Enable Traces On All Duts | ${nodes}
456
457 | Apply startup configuration on VPP DUT
458 | | [Documentation] | Write VPP startup configuration and restart VPP DUT.
459 | |
460 | | ... | *Arguments:*
461 | | ... | - dut - DUT on which to apply the configuration. Type: string
462 | | ... | - with_trace - Enable packet trace after VPP restart Type: boolean
463 | |
464 | | [Arguments] | ${dut} | ${with_trace}=${False}
465 | |
466 | | Run Keyword | ${dut}.Apply Config
467 | | Save VPP PIDs on DUT | ${dut}
468 | | Enable Coredump Limit VPP on DUT | ${nodes['${dut}']}
469 | | ${dutnode}= | Copy Dictionary | ${nodes}
470 | | Keep In Dictionary | ${dutnode} | ${dut}
471 | | Update All Interface Data On All Nodes | ${dutnode} | skip_tg=${True}
472 | | Run Keyword If | ${with_trace} | VPP Enable Traces On Dut
473 | | ... | ${nodes['${dut}']}
474
475 | Save VPP PIDs
476 | | [Documentation] | Get PIDs of VPP processes from all DUTs in topology and\
477 | | ... | set it as a test variable. The PIDs are stored as dictionary items\
478 | | ... | where the key is the host and the value is the PID.
479 | |
480 | | ${setup_vpp_pids}= | Get VPP PIDs | ${nodes}
481 | | ${keys}= | Get Dictionary Keys | ${setup_vpp_pids}
482 | | FOR | ${key} | IN | @{keys}
483 | | | ${pid}= | Get From Dictionary | ${setup_vpp_pids} | ${key}
484 | | | Run Keyword If | $pid is None | FAIL | No VPP PID found on node ${key}
485 | | END
486 | | Set Test Variable | ${setup_vpp_pids}
487
488 | Save VPP PIDs on DUT
489 | | [Documentation] | Get PID of VPP processes from DUT and\
490 | | ... | set it as a test variable. The PID is stored as dictionary item\
491 | | ... | where the key is the host and the value is the PID.
492 | |
493 | | [Arguments] | ${dut}
494 | |
495 | | ${vpp_pids}= | Get VPP PID | ${nodes['${dut}']}
496 | | Run Keyword If | ${vpp_pids} is None | FAIL
497 | | ... | No VPP PID found on node ${nodes['${dut}']['host']
498 | | ${status} | ${message}= | Run Keyword And Ignore Error
499 | | ... | Variable Should Exist | ${setup_vpp_pids}
500 | | ${setup_vpp_pids}= | Run Keyword If | '${status}' == 'FAIL'
501 | | ... | Create Dictionary | ${nodes['${dut}']['host']}=${vpp_pids}
502 | | ... | ELSE | Set To Dictionary | ${setup_vpp_pids}
503 | | ... | ${nodes['${dut}']['host']}=${vpp_pids}
504 | | Set Test Variable | ${setup_vpp_pids}
505
506 | Verify VPP PID in Teardown
507 | | [Documentation] | Check if the VPP PIDs on all DUTs are the same at the end\
508 | | ... | of test as they were at the begining. If they are not, only a message\
509 | | ... | is printed on console and to log. The test will not fail.
510 | |
511 | | ${teardown_vpp_pids}= | Get VPP PIDs | ${nodes}
512 | | ${err_msg}= | Catenate | ${SUITE NAME} - ${TEST NAME}
513 | | ... | \nThe VPP PIDs are not equal!\nTest Setup VPP PIDs:
514 | | ... | ${setup_vpp_pids}\nTest Teardown VPP PIDs: ${teardown_vpp_pids}
515 | | ${rc} | ${msg}= | Run Keyword And Ignore Error
516 | | ... | Dictionaries Should Be Equal
517 | | ... | ${setup_vpp_pids} | ${teardown_vpp_pids}
518 | | Run Keyword And Return If | '${rc}'=='FAIL' | Log | ${err_msg}
519 | | ... | console=yes | level=WARN