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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
14 | Library | resources.libraries.python.InterfaceUtil
15 | Library | resources.libraries.python.NodePath
16 | Library | resources.libraries.python.VhostUser
19 | Set interfaces in path up
21 | | ... | *Set UP state on VPP interfaces in path on all DUT nodes and set
22 | | ... | maximal MTU.*
24 | | FOR | ${dut} | IN | @{duts}
25 | | | Set interfaces in path up on DUT | ${dut}
27 | | All VPP Interfaces Ready Wait | ${nodes} | retries=${300}
29 | Set interfaces in path up on DUT
31 | | ... | *Set UP state on VPP interfaces in path on specified DUT node and
32 | | ... | set maximal MTU.*
34 | | ... | *Arguments:*
35 | | ... | - dut - DUT node on which to set the interfaces up.
36 | | ... | Type: string
40 | | ... | \| Set interfaces in path up on DUT \| DUT1 \|
42 | | [Arguments] | ${dut}
43 # TODO: Rework KW to set all interfaces in path UP and set MTU (including
44 # software interfaces. Run KW at the start phase of VPP setup to split
45 # from other "functional" configuration. This will allow modularity of this
47 | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
48 | | ... | Variable Should Exist | ${${dut}_if1}
49 | | Run Keyword If | '${if1_status}' == 'PASS'
50 | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1} | up
52 | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_1} | up
53 | | Run Keyword Unless | '${if1_status}' == 'PASS'
54 | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_2} | up
55 | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
56 | | ... | Variable Should Exist | ${${dut}_if2}
57 | | Run Keyword If | '${if2_status}' == 'PASS'
58 | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2} | up
60 | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2_1} | up
61 | | Run Keyword Unless | '${if2_status}' == 'PASS'
62 | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2_2} | up
63 | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
64 | | ... | Variable Should Exist | ${${dut}_if1}
65 | | Run Keyword If | '${if1_status}' == 'PASS'
66 | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1}
68 | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_1}
69 | | Run Keyword Unless | '${if1_status}' == 'PASS'
70 | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_2}
71 | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
72 | | ... | Variable Should Exist | ${${dut}_if2}
73 | | Run Keyword If | '${if2_status}' == 'PASS'
74 | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2}
76 | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2_1}
77 | | Run Keyword Unless | '${if2_status}' == 'PASS'
78 | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2_2}
80 | Set single interfaces in path up
82 | | ... | *Set UP state on single VPP interfaces in path on all DUT nodes and set
83 | | ... | maximal MTU.*
85 # TODO: Rework KW to set all interfaces in path UP and set MTU (including
86 # software interfaces. Run KW at the start phase of VPP setup to split
87 # from other "functional" configuration. This will allow modularity of this
89 | | FOR | ${dut} | IN | @{duts}
90 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
91 | | | ... | Variable Should Exist | ${${dut}_if1}
92 | | | Run Keyword If | '${if1_status}' == 'PASS'
93 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1} | up
95 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_1} | up
96 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
97 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_2} | up
99 | | FOR | ${dut} | IN | @{duts}
100 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
101 | | | ... | Variable Should Exist | ${${dut}_if1}
102 | | | Run Keyword If | '${if1_status}' == 'PASS'
103 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1}
105 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_1}
106 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
107 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_2}
109 | | All VPP Interfaces Ready Wait | ${nodes}
112 | | [Documentation] | Get vhost-user dump.
114 | | ... | *Arguments:*
115 | | ... | - node - DUT node data. Type: dictionary
117 | | [Arguments] | ${dut_node}
119 | | [Return] | ${vhost_dump}
121 | | ${vhost_dump}= | Vhost User Dump | ${dut_node}
123 | Initialize layer interface on node
125 | | ... | Baseline interfaces variables to be created.
127 | | ... | *Arguments:*
128 | | ... | - dut - DUT node. Type: string
129 | | ... | - count - Number of baseline interface variables. Type: integer
133 | | ... | \| Initialize layer interface on node \| DUT1 \| 1 \|
135 | | [Arguments] | ${dut} | ${count}=${1}
137 | | ${dut_str}= | Convert To Lowercase | ${dut}
138 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
139 | | | Set Test Variable | ${${dut_str}_if_${id}_1} | ${${dut_str}_if1}
140 | | | Set Test Variable | ${${dut_str}_if_${id}_2} | ${${dut_str}_if2}
143 | Initialize layer interface
145 | | ... | Physical interfaces variables to be created on all DUTs.
147 | | ... | *Arguments:*
148 | | ... | - count - Number of untagged interfaces variables. Type: integer
152 | | ... | \| Initialize layer interface \| 1 \|
154 | | [Arguments] | ${count}=${1}
156 | | FOR | ${dut} | IN | @{duts}
157 | | | Initialize layer interface on node | ${dut} | count=${count}
159 | | Set Test Variable | ${prev_layer} | if
161 | Pre-initialize layer driver
163 | | ... | Pre-initialize driver based interfaces on each DUT.
165 | | ... | *Arguments:*
166 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
167 | | ... | Type: string
171 | | ... | \| Pre-initialize layer driver \| vfio-pci \|
173 | | [Arguments] | ${driver}
175 | | Run Keyword | Pre-initialize layer ${driver} on all DUTs
177 | Pre-initialize layer vfio-pci on all DUTs
179 | | ... | Pre-initialize vfio-pci driver by adding related sections to startup
180 | | ... | config on all DUTs.
182 | | Add DPDK pci devices to all DUTs
183 | | FOR | ${dut} | IN | @{duts}
184 | | | Run Keyword | ${dut}.Add DPDK No Tx Checksum Offload
185 | | | Run Keyword | ${dut}.Add DPDK Log Level | debug
186 | | | Run Keyword | ${dut}.Add DPDK Uio Driver | vfio-pci
187 | | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
188 | | | Run Keyword If | not ${jumbo}
189 | | | ... | ${dut}.Add DPDK No Multi Seg
190 | | | Run Keyword If | ${rxd_count_int}
191 | | | ... | ${dut}.Add DPDK Dev Default RXD | ${rxd_count_int}
192 | | | Run Keyword If | ${txd_count_int}
193 | | | ... | ${dut}.Add DPDK Dev Default TXD | ${txd_count_int}
194 | | | Run Keyword If | '${crypto_type}' != '${None}'
195 | | | ... | ${dut}.Add DPDK Cryptodev | ${thr_count_int}
198 | Pre-initialize layer avf on all DUTs
200 | | ... | Pre-initialize avf driver. Currently no operation.
204 | Pre-initialize layer rdma-core on all DUTs
206 | | ... | Pre-initialize rdma-core driver. Currently no operation.
210 | Initialize layer driver
212 | | ... | Initialize driver based interfaces on each DUT. Interfaces are
213 | | ... | brought up.
215 | | ... | *Arguments:*
216 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
217 | | ... | Type: string
221 | | ... | \| Initialize layer driver \| vfio-pci \|
223 | | [Arguments] | ${driver}
225 | | FOR | ${dut} | IN | @{duts}
226 | | | Run Keyword | Initialize layer ${driver} on node | ${dut}
228 | | Set Test Variable | ${prev_layer} | vf
229 | | Set interfaces in path up
231 | Initialize layer vfio-pci on node
233 | | ... | Initialize vfio-pci interfaces on DUT. Currently no operation.
235 | | ... | *Arguments:*
236 | | ... | - dut - DUT node. Type: string
240 | | ... | \| Initialize layer vfio-pci on node \| DUT1 \|
242 | | [Arguments] | ${dut}
246 | Initialize layer avf on node
248 | | ... | Initialize AVF interfaces on DUT.
250 | | ... | *Arguments:*
251 | | ... | - dut - DUT node. Type: string
255 | | ... | \| Initialize layer avf on node \| DUT1 \|
257 | | [Arguments] | ${dut}
259 | | ${dut_str}= | Convert To Lowercase | ${dut}
260 | | ${if1_vlan}= | Get Interface Vlan | ${nodes['${dut}']} | ${${dut}_if1}
261 | | ${if2_vlan}= | Get Interface Vlan | ${nodes['${dut}']} | ${${dut}_if2}
262 | | Set Test Variable | ${${dut_str}_vlan1} | ${if1_vlan}
263 | | Set Test Variable | ${${dut_str}_vlan2} | ${if2_vlan}
264 | | ${dut_new_if1}= | VPP Create AVF Interface | ${nodes['${dut}']}
265 | | ... | ${${dut}_if1_vf0} | ${rxq_count_int}
266 | | ${dut_new_if1_mac}= | Get Interface MAC | ${nodes['${dut}']}
267 | | ... | ${dut_new_if1}
268 | | ${dut_new_if2}= | VPP Create AVF Interface | ${nodes['${dut}']}
269 | | ... | ${${dut}_if2_vf0} | ${rxq_count_int}
270 | | ${dut_new_if2_mac}= | Get Interface MAC | ${nodes['${dut}']}
271 | | ... | ${dut_new_if2}
272 | | Set Test Variable | ${${dut_str}_if1} | ${dut_new_if1}
273 | | Set Test Variable | ${${dut_str}_if2} | ${dut_new_if2}
274 | | Set Test Variable | ${${dut_str}_if1_mac} | ${dut_new_if1_mac}
275 | | Set Test Variable | ${${dut_str}_if2_mac} | ${dut_new_if2_mac}
277 | Initialize layer rdma-core on node
279 | | ... | Initialize rdma-core (MLX) interfaces on DUT.
281 | | ... | *Arguments:*
282 | | ... | - dut - DUT node. Type: string
286 | | ... | \| Initialize layer rdma-core on node \| DUT1 \|
288 | | [Arguments] | ${dut}
290 | | ${dut_str}= | Convert To Lowercase | ${dut}
291 | | ${if1_vlan}= | Get Interface Vlan | ${nodes['${dut}']} | ${${dut}_if1}
292 | | ${if2_vlan}= | Get Interface Vlan | ${nodes['${dut}']} | ${${dut}_if2}
293 | | Set Test Variable | ${${dut_str}_vlan1} | ${if1_vlan}
294 | | Set Test Variable | ${${dut_str}_vlan2} | ${if2_vlan}
295 | | ${dut_new_if1}= | VPP Create Rdma Interface | ${nodes['${dut}']}
296 | | ... | ${${dut}_if1} | ${rxq_count_int}
297 | | ${dut_new_if1_mac}= | Get Interface MAC | ${nodes['${dut}']}
298 | | ... | ${dut_new_if1}
299 | | ${dut_new_if2}= | VPP Create Rdma Interface | ${nodes['${dut}']}
300 | | ... | ${${dut}_if2} | ${rxq_count_int}
301 | | ${dut_new_if2_mac}= | Get Interface MAC | ${nodes['${dut}']}
302 | | ... | ${dut_new_if2}
303 | | Set Test Variable | ${${dut_str}_if1} | ${dut_new_if1}
304 | | Set Test Variable | ${${dut_str}_if2} | ${dut_new_if2}
305 | | Set Test Variable | ${${dut_str}_if1_mac} | ${dut_new_if1_mac}
306 | | Set Test Variable | ${${dut_str}_if2_mac} | ${dut_new_if2_mac}
308 | Initialize layer bonding on node
310 | | ... | Bonded interface and variables to be created on across east and
311 | | ... | west DUT's node interfaces.
313 | | ... | *Arguments:*
314 | | ... | - dut - DUT node. Type: string
315 | | ... | - bond_mode - Link bonding mode. Type: string
316 | | ... | - lb_mode - Load balance mode. Type: string
317 | | ... | - count - Number of bond interface variables. Type: integer
321 | | ... | \| Initialize layer bonding on node \| DUT1 \| xor \| l34 \| 1 \|
323 | | [Arguments] | ${dut} | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
325 | | ${dut_str}= | Convert To Lowercase | ${dut}
326 | | ${if_index}= | VPP Create Bond Interface
327 | | ... | ${nodes['${dut}']} | ${bond_mode} | load_balance=${lb_mode}
328 | | ... | mac=00:00:00:01:01:01
329 | | Set Interface State | ${nodes['${dut}']} | ${if_index} | up
330 | | VPP Enslave Physical Interface
331 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_1_1} | ${if_index}
332 | | VPP Enslave Physical Interface
333 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_1_2} | ${if_index}
334 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
335 | | | Set Test Variable | ${${dut_str}_bond_${id}_1} | ${if_index}
336 | | | Set Test Variable | ${${dut_str}_bond_${id}_2} | ${if_index}
339 | Initialize layer bonding
341 | | ... | Bonded interfaces and variables to be created on all DUT's interfaces.
343 | | ... | *Arguments:*
344 | | ... | - bond_mode - Link bonding mode. Type: string
345 | | ... | - lb_mode - Load balance mode. Type: string
346 | | ... | - count - Number of bond interface variables. Type: integer
350 | | ... | \| Initialize layer bonding \| xor \| l34 \| 1 \|
352 | | [Arguments] | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
354 | | FOR | ${dut} | IN | @{duts}
355 | | | Initialize layer bonding on node
356 | | | ... | ${dut} | bond_mode=${bond_mode} | lb_mode=${lb_mode}
357 | | | ... | count=${count}
359 | | Set Test Variable | ${prev_layer} | bond
361 | Initialize layer dot1q on node for chain
363 | | ... | Optionally create tag popping subinterface per chain.
364 | | ... | Return interface indices for dot1q layer interfaces,
365 | | ... | or Nones if subinterfaces are not created.
367 | | ... | *Arguments:*
368 | | ... | - dut - DUT node. Type: string
369 | | ... | - id - Positive index of the chain. Type: integer
370 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
371 | | ... | Type: boolean
375 | | ... | \| Initialize layer dot1q on node for chain \| DUT1 \| 1 \| True \|
377 | | [Arguments] | ${dut} | ${id} | ${vlan_per_chain}=${True}
379 | | ${dut_str}= | Convert To Lowercase | ${dut}
380 | | Return From Keyword If | ${id} != ${1} and not ${vlan_per_chain}
381 | | ... | ${NONE} | ${NONE}
382 | | # TODO: Is it worth creating Get Variable Value If Not None keyword?
383 | | ${default}= | Evaluate | ${100} + ${id} - ${1}
384 | | ${if1_vlan}= | Get Variable Value | \${${dut_str}_vlan1}
385 | | ${if1_vlan}= | Set Variable If | '${if1_vlan}' != '${NONE}'
386 | | ... | ${if1_vlan} | ${default}
387 | | ${default}= | Evaluate | ${200} + ${id} - ${1}
388 | | ${if2_vlan}= | Get Variable Value | \${${dut_str}_vlan2}
389 | | ${if2_vlan}= | Set Variable If | '${if2_vlan}' != '${NONE}'
390 | | ... | ${if2_vlan} | ${default}
391 | | ${if1_name} | ${if1_index}= | Create Vlan Subinterface
392 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_1}
393 | | ... | ${if1_vlan}
394 | | ${if2_name} | ${if2_index}= | Create Vlan Subinterface
395 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_2}
396 | | ... | ${if2_vlan}
397 | | Set Interface State | ${nodes['${dut}']} | ${if1_index} | up
398 | | Set Interface State | ${nodes['${dut}']} | ${if2_index} | up
399 | | Configure L2 tag rewrite method on interfaces
400 | | ... | ${nodes['${dut}']} | ${if1_index} | TAG_REWRITE_METHOD=pop-1
401 | | Configure L2 tag rewrite method on interfaces
402 | | ... | ${nodes['${dut}']} | ${if2_index} | TAG_REWRITE_METHOD=pop-1
403 | | Return From Keyword | ${if1_index} | ${if2_index}
405 | Initialize layer dot1q on node
407 | | ... | Dot1q interfaces and variables to be created on all DUT's node
408 | | ... | interfaces.
410 | | ... | TODO: Unify names for number of chains/pipelines/instances/interfaces.
411 | | ... | Chose names and descriptions that makes sense for both
412 | | ... | nf_density and older tests.
413 | | ... | Note that with vlan_per_chain=False it is not a number of interfaces.
414 | | ... | At least not number of real interfaces, just number of aliases.
415 | | ... | This TODO applies also to all keywords with nf_chains argument.
417 | | ... | *Arguments:*
418 | | ... | - dut - DUT node. Type: string
419 | | ... | - count - Number of chains. Type: integer
420 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
421 | | ... | Type: boolean
422 | | ... | - start - Id of first chain, allows adding chains during test.
423 | | ... | Type: integer
427 | | ... | \| Initialize layer dot1q on node \| DUT1 \| 3 \| True \| 2 \|
429 | | [Arguments] | ${dut} | ${count}=${1} | ${vlan_per_chain}=${True}
430 | | ... | ${start}=${1}
432 | | ${dut_str}= | Convert To Lowercase | ${dut}
433 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
434 | | | ${if1_index} | ${if2_index}= | Initialize layer dot1q on node for chain
435 | | | ... | dut=${dut} | id=${id} | vlan_per_chain=${vlan_per_chain}
436 | | | # First id results in non-None indices, after that _1_ are defined.
437 | | | ${if1_index}= | Set Variable If | '${if1_index}' == '${NONE}'
438 | | | ... | ${${dut_str}_dot1q_1_1} | ${if1_index}
439 | | | ${if2_index}= | Set Variable If | '${if2_index}' == '${NONE}'
440 | | | ... | ${${dut_str}_dot1q_1_2} | ${if2_index}
441 | | | Set Test Variable | ${${dut_str}_dot1q_${id}_1} | ${if1_index}
442 | | | Set Test Variable | ${${dut_str}_dot1q_${id}_2} | ${if2_index}
445 | Initialize layer dot1q
447 | | ... | Dot1q interfaces and variables to be created on all DUT's interfaces.
449 | | ... | *Arguments:*
450 | | ... | - count - Number of chains. Type: integer
451 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
452 | | ... | Type: boolean
453 | | ... | - start - Id of first chain, allows adding chains during test.
454 | | ... | Type: integer
456 | | ... | \| Initialize layer dot1q \| 3 \| True \| 2 \|
458 | | [Arguments] | ${count}=${1} | ${vlan_per_chain}=${True} | ${start}=${1}
460 | | FOR | ${dut} | IN | @{duts}
461 | | | Initialize layer dot1q on node | ${dut} | count=${count}
462 | | | ... | vlan_per_chain=${vlan_per_chain} | start=${start}
464 | | Set Test Variable | ${prev_layer} | dot1q
466 | Initialize layer ip4vxlan on node
468 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
469 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
470 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
471 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
473 | | ... | *Arguments:*
474 | | ... | - dut - DUT node. Type: string
475 | | ... | - count - Number of vxlan interfaces. Type: integer
476 | | ... | - start - Id of first chain, allows adding chains during test.
477 | | ... | Type: integer
481 | | ... | \| Initialize layer ip4vxlan on node \| DUT1 \| 3 \| 2 \|
483 | | [Arguments] | ${dut} | ${count}=${1} | ${start}=${1}
485 | | ${dut_str}= | Convert To Lowercase | ${dut}
486 | | Run Keyword If | "${start}" == "1" | VPP Interface Set IP Address
487 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_1_1}
488 | | ... | 172.16.0.1 | 24
489 | | Run Keyword If | "${start}" == "1" | VPP Interface Set IP Address
490 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_1_2}
491 | | ... | 172.26.0.1 | 24
492 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
493 | | | ${subnet}= | Evaluate | ${id} - 1
494 | | | ${vni}= | Evaluate | ${id} - 1
495 | | | ${ip4vxlan_1}= | Create VXLAN interface
496 | | | ... | ${nodes['${dut}']} | ${vni} | 172.16.0.1 | 172.17.${subnet}.2
497 | | | ${ip4vxlan_2}= | Create VXLAN interface
498 | | | ... | ${nodes['${dut}']} | ${vni} | 172.26.0.1 | 172.27.${subnet}.2
499 | | | ${prev_mac}= | Set Variable If | '${dut}' == 'DUT1'
500 | | | ... | ${tg_if1_mac} | ${dut1_if2_mac}
501 | | | ${next_mac}= | Set Variable If | '${dut}' == 'DUT1' and ${duts_count} == 2
502 | | | ... | ${dut2_if1_mac} | ${tg_if2_mac}
503 | | | VPP Add IP Neighbor
504 | | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_1}
505 | | | ... | 172.16.${subnet}.2 | ${prev_mac}
506 | | | VPP Add IP Neighbor
507 | | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_2}
508 | | | ... | 172.26.${subnet}.2 | ${next_mac}
510 | | | ... | ${nodes['${dut}']} | 172.17.${subnet}.0 | 24
511 | | | ... | gateway=172.16.${subnet}.2
512 | | | ... | interface=${${dut_str}_${prev_layer}_${id}_1}
514 | | | ... | ${nodes['${dut}']} | 172.27.${subnet}.0 | 24
515 | | | ... | gateway=172.26.${subnet}.2
516 | | | ... | interface=${${dut_str}_${prev_layer}_${id}_2}
517 | | | Set VXLAN Bypass
518 | | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_1}
519 | | | Set VXLAN Bypass
520 | | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_2}
521 | | | Set Test Variable
522 | | | ... | ${${dut_str}_ip4vxlan_${id}_1} | ${ip4vxlan_1}
523 | | | Set Test Variable
524 | | | ... | ${${dut_str}_ip4vxlan_${id}_2} | ${ip4vxlan_2}
527 | Initialize layer ip4vxlan
529 | | ... | VXLAN interfaces and variables to be created on all DUT's interfaces.
531 | | ... | *Arguments:*
532 | | ... | - count - Number of vxlan interfaces. Type: integer
533 | | ... | - start - Id of first chain, allows adding chains during test.
534 | | ... | Type: integer
536 | | ... | \| Initialize layer ip4vxlan \| 3 \| 2 \|
538 | | [Arguments] | ${count}=${1} | ${start}=${1}
540 | | FOR | ${dut} | IN | @{duts}
541 | | | Initialize layer ip4vxlan on node | ${dut} | count=${count}
542 | | ... | start=${start}
544 | | Set Test Variable | ${prev_layer} | ip4vxlan
546 | Configure vhost interfaces
548 | | ... | Create two Vhost-User interfaces on defined VPP node.
550 | | ... | *Arguments:*
551 | | ... | - ${dut_node} - DUT node. Type: dictionary
552 | | ... | - ${sock1} - Socket path for first Vhost-User interface. Type: string
553 | | ... | - ${sock2} - Socket path for second Vhost-User interface. Type: string
554 | | ... | - ${vhost_if1} - Name of the first Vhost-User interface (Optional).
555 | | ... | Type: string
556 | | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional).
557 | | ... | Type: string
559 | | ... | _NOTE:_ This KW sets following test case variable:
560 | | ... | - ${${vhost_if1}} - First Vhost-User interface.
561 | | ... | - ${${vhost_if2}} - Second Vhost-User interface.
565 | | ... | \| Configure vhost interfaces \
566 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \|
567 | | ... | \| Configure vhost interfaces \
568 | | ... | \| ${nodes['DUT2']} \| /tmp/sock1 \| /tmp/sock2 \| dut2_vhost_if1 \
569 | | ... | \| dut2_vhost_if2 \|
571 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1
572 | | ... | ${vhost_if2}=vhost_if2
574 | | ${vhost_1}= | Vpp Create Vhost User Interface | ${dut_node} | ${sock1}
575 | | ${vhost_2}= | Vpp Create Vhost User Interface | ${dut_node} | ${sock2}
576 | | ${vhost_1_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_1}
577 | | ${vhost_2_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_2}
578 | | ${vhost_1_mac}= | Get Interface MAC | ${dut_node} | ${vhost_1_key}
579 | | ${vhost_2_mac}= | Get Interface MAC | ${dut_node} | ${vhost_2_key}
580 | | Set Interface State | ${dut_node} | ${vhost_1} | up
581 | | Set Interface State | ${dut_node} | ${vhost_2} | up
582 | | Set Test Variable | ${${vhost_if1}} | ${vhost_1}
583 | | Set Test Variable | ${${vhost_if2}} | ${vhost_2}
584 | | Set Test Variable | ${${vhost_if1}_mac} | ${vhost_1_mac}
585 | | Set Test Variable | ${${vhost_if2}_mac} | ${vhost_2_mac}