1 # Copyright (c) 2023 Cisco and/or its affiliates.
2 # Copyright (c) 2023 PANTHEON.tech and/or its affiliates.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at:
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 | Library | resources.libraries.python.L2Util
17 | Library | resources.libraries.python.InterfaceUtil
18 | Library | resources.libraries.python.NodePath
19 | Library | resources.libraries.python.VhostUser
20 | Library | resources.libraries.python.Memif
23 | Show Bridge Domain Data On All DUTs
24 | | [Documentation] | Show Bridge Domain data on all DUTs.
26 | | FOR | ${dut} | IN | @{duts}
27 | | | VPP Get Bridge Domain Data | ${nodes['${dut}']}
30 | Add interface to bridge domain
32 | | ... | Set given interface admin state to up and add this
33 | | ... | interface to required L2 bridge domain on defined VPP node.
35 | | ... | *Arguments:*
36 | | ... | - ${dut} - DUT node. Type: dictionary
37 | | ... | - ${dut_if} - DUT node interface name. Type: string
38 | | ... | - ${bd_id} - Bridge domain ID. Type: integer
39 | | ... | - ${shg} - Split-horizon group ID. Type: integer, default value: 0
43 | | ... | \| Add interface to bridge domain \| ${nodes['DUT2']} \
44 | | ... | \| GigabitEthernet0/8/0 \| 3 \|
46 | | [Arguments] | ${dut} | ${dut_if} | ${bd_id} | ${shg}=0
48 | | Set Interface State | ${dut} | ${dut_if} | up
49 | | Add Interface To L2 BD | ${dut} | ${dut_if} | ${bd_id} | ${shg}
51 | Initialize L2 bridge domain on node
53 | | ... | Setup L2 bridge domain topology by adding two interfaces on DUT into
54 | | ... | separate bridge domains that are created automatically starting with
55 | | ... | index 1. Learning is enabled. Interfaces are brought up.
57 | | ... | *Arguments:*
58 | | ... | - dut - DUT node. Type: string
59 | | ... | - count - Number of bridge domains interfaces. Type: integer
63 | | ... | \| Initialize L2 bridge domain on node \| DUT1 \| 1 \|
65 | | [Arguments] | ${dut} | ${count}=${1}
67 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
68 | | | Add Interface To L2 BD
69 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_${id}}[0] | ${id}
70 | | | Add Interface To L2 BD
71 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_${id}}[0] | ${id}
74 | Initialize L2 bridge domain
76 | | ... | Setup L2 bridge domain topology by adding two interfaces on each DUT
77 | | ... | into separate bridge domains that are created automatically starting
78 | | ... | with index 1. Learning is enabled. Interfaces are brought up.
80 | | ... | *Arguments:*
81 | | ... | - count - Number of bridge domains. Type: integer
85 | | ... | \| Initialize L2 bridge domain \| 1 \|
87 | | [Arguments] | ${count}=${1}
89 | | FOR | ${dut} | IN | @{duts}
90 | | | Initialize L2 bridge domain on node | ${dut} | count=${count}
93 | Initialize L2 bridge domains with Vhost-User on node
95 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
96 | | ... | defined VPP node. Add each Vhost-User interface into L2 bridge
97 | | ... | domains with learning enabled with physical inteface or Vhost-User
98 | | ... | interface of another VM.
100 | | ... | *Arguments:*
101 | | ... | - dut - DUT node. Type: string
102 | | ... | - nf_chain - NF chain. Type: integer
103 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
104 | | ... | - virtio_feature_mask - Enabled Virtio features (Optional).
105 | | ... | Type: integer
108 | | ... | Socket paths for VM are defined in following format:
109 | | ... | - /var/run/vpp/sock-\${VM_ID}-1
110 | | ... | - /var/run/vpp/sock-\${VM_ID}-2
114 | | ... | \| Initialize L2 bridge domains with Vhost-User on node \| DUT1 \
115 | | ... | \| 1 \| 1 \|
117 | | [Arguments] | ${dut} | ${nf_chain}=${1} | ${nf_nodes}=${1}
118 | | ... | ${virtio_feature_mask}=${None}
120 | | ${bd_id1}= | Evaluate | ${nf_nodes} * (${nf_chain} - 1) + ${nf_chain}
121 | | ${bd_id2}= | Evaluate | ${nf_nodes} * ${nf_chain} + ${nf_chain}
122 | | Add interface to bridge domain
123 | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_${nf_chain}}[0]
125 | | Add interface to bridge domain
126 | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_${nf_chain}}[0]
128 | | FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes} + 1
129 | | | ${qemu_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
130 | | | Configure vhost interfaces
131 | | | ... | ${nodes['${dut}']}
132 | | | ... | /var/run/vpp/sock-${qemu_id}-1 | /var/run/vpp/sock-${qemu_id}-2
133 | | | ... | ${dut}-vhost-${qemu_id}-if1 | ${dut}-vhost-${qemu_id}-if2
134 | | | ... | virtio_feature_mask=${virtio_feature_mask}
135 | | | ${bd_id1}= | Evaluate | ${qemu_id} + (${nf_chain} - 1)
136 | | | ${bd_id2}= | Evaluate | ${bd_id1} + 1
137 | | | Add interface to bridge domain
138 | | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${qemu_id}-if1} | ${bd_id1}
139 | | | Add interface to bridge domain
140 | | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${qemu_id}-if2} | ${bd_id2}
143 | Initialize L2 bridge domains with Vhost-User
145 | | ... | Create pairs of Vhost-User interfaces for defined number of VNF nodes
146 | | ... | on all defined VPP nodes. Add each Vhost-User interface into L2 bridge
147 | | ... | domains with learning enabled with physical inteface or Vhost-User
148 | | ... | interface of another VM.
150 | | ... | *Arguments:*
151 | | ... | - nf_chain - NF chain. Type: integer
152 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
153 | | ... | - virtio_feature_mask - Enabled Virtio features (Optional).
154 | | ... | Type: integer
158 | | ... | \| Initialize L2 bridge domains with Vhost-User \| 1 \| 1 \|
160 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1}
161 | | ... | ${virtio_feature_mask}=${None}
163 | | FOR | ${dut} | IN | @{duts}
164 | | | Initialize L2 bridge domains with Vhost-User on node
165 | | | ... | ${dut} | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
166 | | | ... | virtio_feature_mask=${virtio_feature_mask}
169 | Initialize L2 bridge domains for multiple chains with Vhost-User
171 | | ... | Create pairs of Vhost-User interfaces for defined number of NF chains
172 | | ... | with defined number of VNF nodes on all defined VPP nodes. Add each
173 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
174 | | ... | with physical inteface or Vhost-User interface of another VM.
175 | | ... | Put all interfaces in path up.
177 | | ... | *Arguments:*
178 | | ... | - nf_chains - Number of chains of NFs. Type: integer
179 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
180 | | ... | - start - Id of first chain, allows to add chains during test.
181 | | ... | Type: integer
182 | | ... | - virtio_feature_mask - Enabled Virtio features (Optional).
183 | | ... | Type: integer
187 | | ... | \| Initialize L2 bridge domains for multiple chains with Vhost-User \
188 | | ... | \| 3 \| 1 \| 2 \|
190 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${start}=${1}
191 | | ... | ${virtio_feature_mask}=${None}
193 | | Set interfaces in path up
194 | | FOR | ${nf_chain} | IN RANGE | ${start} | ${nf_chains} + 1
195 | | | Initialize L2 bridge domains with Vhost-User
196 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
197 | | | ... | virtio_feature_mask=${virtio_feature_mask}
200 | Initialize L2 bridge domain with VXLANoIPv4 in 3-node circular topology
202 | | ... | Setup L2 bridge domain topology with VXLANoIPv4 by connecting
203 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
204 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
205 | | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as
206 | | ... | interfaces.
208 | | Set interfaces in path up
209 | | VPP Interface Set IP Address
210 | | ... | ${dut1} | ${DUT1_${int}2}[0] | 172.16.0.1 | 24
211 | | VPP Interface Set IP Address
212 | | ... | ${dut2} | ${DUT2_${int}1}[0] | 172.16.0.2 | 24
213 | | VPP Add IP Neighbor
214 | | ... | ${dut1} | ${DUT1_${int}2}[0] | 172.16.0.2
215 | | ... | ${DUT2_${int}1_mac}[0]
216 | | VPP Add IP Neighbor
217 | | ... | ${dut2} | ${DUT2_${int}1}[0] | 172.16.0.1
218 | | ... | ${DUT1_${int}2_mac}[0]
219 | | ${dut1s_vxlan}= | Create VXLAN interface
220 | | ... | ${dut1} | 24 | 172.16.0.1 | 172.16.0.2
221 | | ${dut2s_vxlan}= | Create VXLAN interface
222 | | ... | ${dut2} | 24 | 172.16.0.2 | 172.16.0.1
223 | | VPP Add L2 Bridge Domain
224 | | ... | ${dut1} | ${1} | ${DUT1_${int}1}[0] | ${dut1s_vxlan}
225 | | Set Interface State
226 | | ... | ${dut1} | ${dut1s_vxlan} | up
227 | | VPP Add L2 Bridge Domain
228 | | ... | ${dut2} | ${1} | ${DUT2_${int}2}[0] | ${dut2s_vxlan}
229 | | Set Interface State
230 | | ... | ${dut2} | ${dut2s_vxlan} | up
232 | Initialize L2 bridge domain with VLAN and VXLANoIPv4 in 3-node circular topology
234 | | ... | Setup L2 bridge domain topology with VLAN and VXLANoIPv4 by connecting
235 | | ... | pairs of VLAN sub-interface and VXLAN interface to separate L2 bridge
236 | | ... | domain on each DUT. All interfaces are brought up. IPv4 addresses
237 | | ... | with prefix /32 are configured on interfaces between DUTs. VXLAN
238 | | ... | sub-interfaces has same IPv4 address as interfaces.
240 | | ... | *Arguments:*
241 | | ... | - vxlan_count - VXLAN count. Type: integer
245 | | ... | \| Initialize L2 bridge domain with VLAN and VXLANoIPv4 in 3-node \
246 | | ... | \| circular topology \| ${1} \|
248 | | [Arguments] | ${vxlan_count}=${1}
250 | | Set interfaces in path up
252 | | ${bd_id_start}= | Set Variable | ${1}
253 | | ${vni_start} = | Set Variable | ${20}
255 | | ${ip_step} = | Set Variable | ${2}
256 | | ${dut1_ip_start}= | Set Variable | 172.16.0.1
257 | | ${dut2_ip_start}= | Set Variable | 172.16.0.2
259 | | Vpp create multiple VXLAN IPv4 tunnels
260 | | ... | node=${dut1}
261 | | ... | node_vxlan_if=${DUT1_${int}2}[0]
262 | | ... | node_vlan_if=${DUT1_${int}1}[0]
263 | | ... | op_node=${dut2}
264 | | ... | op_node_if=${DUT2_${int}1}[0]
265 | | ... | n_tunnels=${vxlan_count}
266 | | ... | vni_start=${vni_start}
267 | | ... | src_ip_start=${dut1_ip_start}
268 | | ... | dst_ip_start=${dut2_ip_start}
269 | | ... | ip_step=${ip_step}
270 | | ... | bd_id_start=${bd_id_start}
271 | | Vpp create multiple VXLAN IPv4 tunnels
272 | | ... | node=${dut2}
273 | | ... | node_vxlan_if=${DUT2_${int}1}[0]
274 | | ... | node_vlan_if=${DUT2_${int}2}[0]
275 | | ... | op_node=${dut1}
276 | | ... | op_node_if=${DUT1_${int}2}[0]
277 | | ... | n_tunnels=${vxlan_count}
278 | | ... | vni_start=${vni_start}
279 | | ... | src_ip_start=${dut2_ip_start}
280 | | ... | dst_ip_start=${dut1_ip_start}
281 | | ... | ip_step=${ip_step}
282 | | ... | bd_id_start=${bd_id_start}
284 | Initialize L2 bridge domains with Vhost-User and VXLANoIPv4 in 3-node circular topology
286 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
287 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
288 | | ... | with physical inteface.
289 | | ... | Setup VXLANoIPv4 between DUTs by connecting physical and vxlan
290 | | ... | interfaces on each DUT. All interfaces are brought up.
291 | | ... | IPv4 addresses with prefix /24 are configured on interfaces between
292 | | ... | DUTs. VXLAN sub-interfaces has same IPv4 address as interfaces.
294 | | ... | *Arguments:*
295 | | ... | - bd_id1 - Bridge domain ID. Type: integer
296 | | ... | - bd_id2 - Bridge domain ID. Type: integer
297 | | ... | - virtio_feature_mask - Enabled Virtio features (Optional).
298 | | ... | Type: integer
302 | | ... | \| L2 bridge domains with Vhost-User and VXLANoIPv4 initialized in a\
303 | | ... | 3-node circular topology \| 1 \| 2 \|
305 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${virtio_feature_mask}=${None}
307 | | VPP Interface Set IP Address
308 | | ... | ${dut1} | ${DUT1_${int}2}[0] | 172.16.0.1 | 24
309 | | VPP Interface Set IP Address
310 | | ... | ${dut2} | ${DUT2_${int}1}[0] | 172.16.0.2 | 24
311 | | Set interfaces in path up
312 | | ${dut1s_vxlan}= | Create VXLAN interface
313 | | ... | ${dut1} | 24 | 172.16.0.1 | 172.16.0.2
314 | | ${dut2s_vxlan}= | Create VXLAN interface
315 | | ... | ${dut2} | 24 | 172.16.0.2 | 172.16.0.1
316 | | Configure vhost interfaces | ${dut1}
317 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
318 | | ... | virtio_feature_mask=${virtio_feature_mask}
319 | | Add interface to bridge domain
320 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${bd_id1}
321 | | Add interface to bridge domain
322 | | ... | ${dut1} | ${vhost_if1} | ${bd_id1}
323 | | Add interface to bridge domain
324 | | ... | ${dut1} | ${vhost_if2} | ${bd_id2}
325 | | Add interface to bridge domain
326 | | ... | ${dut1} | ${dut1s_vxlan} | ${bd_id2}
327 | | Configure vhost interfaces | ${dut2}
328 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
329 | | ... | virtio_feature_mask=${virtio_feature_mask}
330 | | Add interface to bridge domain
331 | | ... | ${dut2} | ${dut2s_vxlan} | ${bd_id1}
332 | | Add interface to bridge domain
333 | | ... | ${dut2} | ${vhost_if1} | ${bd_id1}
334 | | Add interface to bridge domain
335 | | ... | ${dut2} | ${vhost_if2} | ${bd_id2}
336 | | Add interface to bridge domain
337 | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${bd_id2}
339 | Initialize L2 bridge domains with VLAN dot1q sub-interfaces in circular topology
341 | | ... | Setup L2 bridge domain topology with learning enabled with VLAN by
342 | | ... | connecting physical and vlan interfaces on each DUT. In case of 3-node
343 | | ... | topology create VLAN sub-interfaces between DUTs. In case of 2-node
344 | | ... | topology create VLAN sub-interface on dut1-if2 interface. All
345 | | ... | interfaces are brought up.
347 | | ... | *Arguments:*
348 | | ... | - bd_id1 - Bridge domain ID. Type: integer
349 | | ... | - bd_id2 - Bridge domain ID. Type: integer
350 | | ... | - subid - ID of the sub-interface to be created. Type: string
351 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
353 | | ... | _NOTE:_ This KW uses following test case variables:
354 | | ... | - dut1 - DUT1 node.
355 | | ... | - dut2 - DUT2 node.
356 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
357 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
361 | | ... | \| Initialize L2 bridge domains with VLAN dot1q sub-interfaces
362 | | ... | in a 3-node circular topology \| 1 \| 2 \| 10 \| pop-1 \|
364 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
366 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
367 | | ... | Variable Should Exist | ${dut2}
369 | | Set interfaces in path up
371 | | Run Keyword If | '${dut2_status}' == 'PASS'
372 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
373 | | ... | ${dut1} | ${DUT1_${int}2}[0]
374 | | ... | ${dut2} | ${DUT2_${int}1}[0] | SUB_ID=${subid}
375 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
376 | | ... | ${dut1} | ${DUT1_${int}2}[0] | SUB_ID=${subid}
377 | | Run Keyword If | '${dut2_status}' == 'PASS'
378 | | ... | Configure L2 tag rewrite method on interfaces
379 | | ... | ${dut1} | ${subif_index_1}
380 | | ... | ${dut2} | ${subif_index_2} | TAG_REWRITE_METHOD=${tag_rewrite}
381 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
382 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
383 | | Add interface to bridge domain
384 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${bd_id1}
385 | | Add interface to bridge domain
386 | | ... | ${dut1} | ${subif_index_1} | ${bd_id1}
387 | | Run Keyword If | '${dut2_status}' == 'PASS'
388 | | ... | Add interface to bridge domain
389 | | ... | ${dut2} | ${subif_index_2} | ${bd_id2}
390 | | Run Keyword If | '${dut2_status}' == 'PASS'
391 | | ... | Add interface to bridge domain
392 | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${bd_id2}
394 | Initialize L2 bridge domains with Vhost-User and VLAN in circular topology
396 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
397 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
398 | | ... | with physical inteface. In case of 3-node topology create VLAN
399 | | ... | sub-interfaces between DUTs. In case of 2-node topology create VLAN
400 | | ... | sub-interface on dut1-if2 interface. All interfaces are brought up.
402 | | ... | *Arguments:*
403 | | ... | - bd_id1 - Bridge domain ID. Type: integer
404 | | ... | - bd_id2 - Bridge domain ID. Type: integer
405 | | ... | - subid - ID of the sub-interface to be created. Type: string
406 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
407 | | ... | - virtio_feature_mask - Enabled Virtio features (Optional).
408 | | ... | Type: integer
412 | | ... | \| L2 bridge domains with Vhost-User and VLAN initialized in circular\
413 | | ... | topology \| 1 \| 2 \| 10 \| pop-1 \|
415 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
416 | | ... | ${virtio_feature_mask}=${None}
418 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
419 | | ... | Variable Should Exist | ${dut2}
421 | | Set interfaces in path up
423 | | Run Keyword If | '${dut2_status}' == 'PASS'
424 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
425 | | ... | ${dut1} | ${DUT1_${int}2}[0]
426 | | ... | ${dut2} | ${DUT2_${int}1}[0] | SUB_ID=${subid}
427 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
428 | | ... | ${dut1} | ${DUT1_${int}2}[0] | SUB_ID=${subid}
429 | | Run Keyword If | '${dut2_status}' == 'PASS'
430 | | ... | Configure L2 tag rewrite method on interfaces
431 | | ... | ${dut1} | ${subif_index_1}
432 | | ... | ${dut2} | ${subif_index_2} | TAG_REWRITE_METHOD=${tag_rewrite}
433 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
434 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
435 | | Configure vhost interfaces | ${dut1}
436 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
437 | | ... | virtio_feature_mask=${virtio_feature_mask}
438 | | Add interface to bridge domain
439 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${bd_id1}
440 | | Add interface to bridge domain
441 | | ... | ${dut1} | ${vhost_if1} | ${bd_id1}
442 | | Add interface to bridge domain
443 | | ... | ${dut1} | ${vhost_if2} | ${bd_id2}
444 | | Add interface to bridge domain
445 | | ... | ${dut1} | ${subif_index_1} | ${bd_id2}
446 | | Run Keyword If | '${dut2_status}' == 'PASS'
447 | | ... | Configure vhost interfaces | ${dut2}
448 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
449 | | ... | virtio_feature_mask=${virtio_feature_mask}
450 | | Run Keyword If | '${dut2_status}' == 'PASS'
451 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
453 | | Run Keyword If | '${dut2_status}' == 'PASS'
454 | | ... | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
455 | | Run Keyword If | '${dut2_status}' == 'PASS'
456 | | ... | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
457 | | Run Keyword If | '${dut2_status}' == 'PASS'
458 | | ... | Add interface to bridge domain | ${dut2} | ${DUT2_${int}2}[0]
461 | Initialize L2 bridge domains with Vhost-User and VLAN with VPP link bonding in a 3-node circular topology
463 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Create one
464 | | ... | link bonding (BondEthernet) interface on both VPP nodes. Add one
465 | | ... | physical interface towards next DUT as a member of BondEthernet
466 | | ... | interface. Setup VLAN on BondEthernet interfaces between DUTs. Add one
467 | | ... | Vhost-User interface into L2 bridge domains with learning enabled with
468 | | ... | physical interface towards TG and other Vhost-User interface into L2
469 | | ... | bridge domains with learning enabled with VLAN sub-interface. All
470 | | ... | interfaces are brought up.
472 | | ... | *Arguments:*
473 | | ... | - bd_id1 - Bridge domain ID. Type: integer
474 | | ... | - bd_id2 - Bridge domain ID. Type: integer
475 | | ... | - subid - ID of the sub-interface to be created. Type: string
476 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
477 | | ... | - bond_mode - Link bonding mode. Type: string
478 | | ... | - lb_mode - Load balance mode. Type: string
479 | | ... | - virtio_feature_mask - Enabled Virtio features (Optional).
480 | | ... | Type: integer
484 | | ... | \| Initialize L2 bridge domains with Vhost-User and VLAN with VPP\
485 | | ... | link bonding in a 3-node circular topology \| 1 \| 2 \
486 | | ... | \| 10 \| pop-1 \| xor \| l34 \|
488 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
489 | | ... | ${bond_mode} | ${lb_mode} | ${virtio_feature_mask}=${None}
491 | | Set interfaces in path up
492 | | ${dut1_eth_bond_if1}= | VPP Create Bond Interface
493 | | ... | ${dut1} | ${bond_mode} | ${lb_mode}
494 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
495 | | | ${_even}= | Evaluate | ${pf} % 2
496 | | | Run Keyword If | not ${even}
497 | | | ... | VPP Add Bond Member
498 | | | ... | ${dut1} | ${DUT1_${int}${pf}}[0] | ${dut1_eth_bond_if1}
500 | | ${dut2_eth_bond_if1}= | VPP Create Bond Interface
501 | | ... | ${dut2} | ${bond_mode} | ${lb_mode}
502 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
503 | | | ${_even}= | Evaluate | ${pf} % 2
504 | | | Run Keyword If | ${even}
505 | | | ... | VPP Add Bond Member
506 | | | ... | ${dut2} | ${DUT2_${int}${pf}}[0] | ${dut2_eth_bond_if1}
508 | | VPP Show Bond Data On All Nodes | ${nodes} | verbose=${TRUE}
509 | | Initialize VLAN dot1q sub-interfaces in circular topology
510 | | ... | ${dut1} | ${dut1_eth_bond_if1}
511 | | ... | ${dut2} | ${dut2_eth_bond_if1} | ${subid}
512 | | Configure L2 tag rewrite method on interfaces
513 | | ... | ${dut1} | ${subif_index_1}
514 | | ... | ${dut2} | ${subif_index_2} | ${tag_rewrite}
515 | | Configure vhost interfaces | ${dut1}
516 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
517 | | ... | virtio_feature_mask=${virtio_feature_mask}
518 | | Add interface to bridge domain
519 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${bd_id1}
520 | | Add interface to bridge domain
521 | | ... | ${dut1} | ${vhost_if1} | ${bd_id1}
522 | | Add interface to bridge domain
523 | | ... | ${dut1} | ${vhost_if2} | ${bd_id2}
524 | | Add interface to bridge domain
525 | | ... | ${dut1} | ${subif_index_1} | ${bd_id2}
526 | | Configure vhost interfaces | ${dut2}
527 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
528 | | ... | virtio_feature_mask=${virtio_feature_mask}
529 | | Add interface to bridge domain
530 | | ... | ${dut2} | ${subif_index_2} | ${bd_id1}
531 | | Add interface to bridge domain
532 | | ... | ${dut2} | ${vhost_if1} | ${bd_id1}
533 | | Add interface to bridge domain
534 | | ... | ${dut2} | ${vhost_if2} | ${bd_id2}
535 | | Add interface to bridge domain
536 | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${bd_id2}
538 | Initialize L2 Bridge Domain with memif pairs on DUT node
540 | | ... | Create pairs of Memif interfaces on DUT node. Put each Memif interface
541 | | ... | to separate L2 bridge domain with one physical or memif interface
542 | | ... | to create a chain accross DUT node.
544 | | ... | *Arguments:*
545 | | ... | - dut - DUT node. Type: dictionary
546 | | ... | - nf_chain - NF chain. Type: integer
547 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
548 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
549 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
552 | | ... | Socket paths for Memif are defined in following format:
553 | | ... | - /tmp/memif-\${dut}_CNF\${nf_id}-\${sid}
557 | | ... | \| Initialize L2 Bridge Domain with memif pairs on DUT node \
558 | | ... | \| ${dut} \| 1 \| 1 \|
560 | | [Arguments] | ${dut} | ${nf_chain}=${1} | ${nf_nodes}=${1}
561 | | ... | ${auto_scale}=${True}
563 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
564 | | ... | Set Variable | ${rxq_count_int}
565 | | ... | ELSE | Set Variable | ${1}
566 | | ${bd_id1}= | Evaluate | ${nf_nodes} * (${nf_chain} - 1) + ${nf_chain}
567 | | ${bd_id2}= | Evaluate | ${nf_nodes} * ${nf_chain} + ${nf_chain}
568 | | Add interface to bridge domain
569 | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_${nf_chain}}[0]
571 | | Add interface to bridge domain
572 | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_${nf_chain}}[0]
574 | | FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes}+1
575 | | | ${nf_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
576 | | | ${sock1}= | Set Variable | memif-${dut}_CNF
577 | | | ${sock2}= | Set Variable | memif-${dut}_CNF
578 | | | ${bd_id1}= | Evaluate | ${nf_id} + (${nf_chain} - 1)
579 | | | ${bd_id2}= | Evaluate | ${bd_id1} + 1
580 | | | Set up memif interfaces on DUT node | ${nodes['${dut}']}
581 | | | ... | ${sock1} | ${sock2} | ${nf_id} | ${dut}-memif-${nf_id}-if1
582 | | | ... | ${dut}-memif-${nf_id}-if2 | ${rxq} | ${rxq}
583 | | | Add interface to bridge domain
584 | | | ... | ${nodes['${dut}']} | ${${dut}-memif-${nf_id}-if1} | ${bd_id1}
585 | | | Add interface to bridge domain
586 | | | ... | ${nodes['${dut}']} | ${${dut}-memif-${nf_id}-if2} | ${bd_id2}
589 | Initialize L2 Bridge Domain with memif pairs
591 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
592 | | ... | Memif interface to separate L2 bridge domain with one physical or
593 | | ... | virtual interface to create a chain accross DUT node.
595 | | ... | This keyword does not wait for memifs to go up.
596 | | ... | Use the "for multiple chains" keyword for that functionality.
598 | | ... | *Arguments:*
599 | | ... | - nf_chain - NF chain. Type: integer
600 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
601 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
602 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
606 | | ... | \| Initialize L2 Bridge Domain with memif pairs \| 1 \| 1 \|
608 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
610 | | FOR | ${dut} | IN | @{duts}
611 | | | Initialize L2 Bridge Domain with memif pairs on DUT node | ${dut}
612 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
613 | | | ... | auto_scale=${auto_scale}
616 | Initialize L2 Bridge Domain for multiple chains with memif pairs
618 | | ... | Create pairs of Memif interfaces for defined number of NF chains
619 | | ... | with defined number of NF nodes on all defined VPP nodes. Add each
620 | | ... | Memif interface into L2 bridge domains with learning enabled
621 | | ... | with physical inteface or Memif interface of another NF.
623 | | ... | *Arguments:*
624 | | ... | - nf_chains - Number of chains of NFs. Type: integer
625 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
626 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
627 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
631 | | ... | \| Initialize L2 Bridge Domain for multiple chains with memif pairs \
632 | | ... | \| 1 \| 1 \|
634 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
636 | | FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
637 | | | Initialize L2 Bridge Domain with memif pairs | nf_chain=${nf_chain}
638 | | | ... | nf_nodes=${nf_nodes} | auto_scale=${auto_scale}
640 | | Set interfaces in path up
641 | | Show Memif on all DUTs | ${nodes}
642 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
644 | Initialize L2 Bridge Domain for pipeline with memif pairs
646 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
647 | | ... | Memif interface to separate L2 bridge domain with one physical or
648 | | ... | virtual interface to create a service pipeline on DUT node.
650 | | ... | *Arguments:*
651 | | ... | - nf_chain - NF pipe. Type: integer
652 | | ... | - nf_nodes - Number of NFs nodes per pipeline. Type: integer
653 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
654 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
658 | | ... | \| Initialize L2 Bridge Domain for pipeline with memif pairs \
659 | | ... | \| 1 \| 1 \|
661 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
663 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
664 | | ... | Set Variable | ${rxq_count_int}
665 | | ... | ELSE | Set Variable | ${1}
666 | | ${bd_id1}= | Evaluate | ${nf_nodes} * (${nf_chain} - 1) + ${nf_chain}
667 | | ${bd_id2}= | Evaluate | ${nf_nodes} * ${nf_chain} + ${nf_chain}
668 | | FOR | ${dut} | IN | @{duts}
669 | | | Add interface to bridge domain
670 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_${nf_chain}}[0]
671 | | | ... | ${bd_id1}
672 | | | Add interface to bridge domain
673 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_${nf_chain}}[0]
674 | | | ... | ${bd_id2}
675 | | | ${nf_id_frst}= | Evaluate | (${nf_chain}-${1}) * ${nf_nodes} + ${1}
676 | | | ${nf_id_last}= | Evaluate | (${nf_chain}-${1}) * ${nf_nodes} + ${nf_nodes}
677 | | | ${sid_frst}= | Evaluate | ${nf_id_frst} * ${2} - ${1}
678 | | | ${sid_last}= | Evaluate | ${nf_id_last} * ${2}
679 | | | Set up single memif interface on DUT node | ${nodes['${dut}']}
680 | | | ... | memif-${dut}_CNF | mid=${nf_id_frst} | sid=${sid_frst}
681 | | | ... | memif_if=${dut}-memif-${nf_id_frst}-if1
682 | | | ... | rxq=${rxq} | txq=${rxq}
683 | | | Set up single memif interface on DUT node | ${nodes['${dut}']}
684 | | | ... | memif-${dut}_CNF | mid=${nf_id_last} | sid=${sid_last}
685 | | | ... | memif_if=${dut}-memif-${nf_id_last}-if2
686 | | | ... | rxq=${rxq} | txq=${rxq}
687 | | | Add interface to bridge domain
688 | | | ... | ${nodes['${dut}']} | ${${dut}-memif-${nf_id_frst}-if1} | ${bd_id1}
689 | | | Add interface to bridge domain
690 | | | ... | ${nodes['${dut}']} | ${${dut}-memif-${nf_id_last}-if2} | ${bd_id2}
693 | Initialize L2 Bridge Domain for multiple pipelines with memif pairs
695 | | ... | Create pairs of Memif interfaces for defined number of NF pipelines
696 | | ... | with defined number of NF nodes on all defined VPP nodes. Add each
697 | | ... | Memif interface into L2 bridge domains with learning enabled
698 | | ... | with physical inteface or Memif interface of another NF.
700 | | ... | *Arguments:*
701 | | ... | - nf_chains - Number of pipelines of NFs. Type: integer
702 | | ... | - nf_nodes - Number of NFs nodes per pipeline. Type: integer
703 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
704 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
708 | | ... | \| Initialize L2 Bridge Domain for multiple pipelines with memif \
709 | | ... | pairs \| 1 \| 1 \|
711 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
713 | | FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
714 | | | Initialize L2 Bridge Domain for pipeline with memif pairs
715 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
716 | | | ... | auto_scale=${auto_scale}
718 | | Set interfaces in path up
719 | | Show Memif on all DUTs | ${nodes}
720 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
722 | Initialize L2 Bridge Domain with memif pairs and VLAN in circular topology
724 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
725 | | ... | Memif interface to separate L2 bridge domain with one physical or
726 | | ... | virtual interface to create a chain accross DUT node. In case of
727 | | ... | 3-node topology create VLAN sub-interfaces between DUTs. In case of
728 | | ... | 2-node topology create VLAN sub-interface on dut1-if2 interface. All
729 | | ... | interfaces are brought up.
731 | | ... | *Arguments:*
732 | | ... | - bd_id1 - Bridge domain ID. Type: integer
733 | | ... | - bd_id2 - Bridge domain ID. Type: integer
734 | | ... | - subid - ID of the sub-interface to be created. Type: string
735 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
739 | | ... | \| Initialize L2 Bridge Domain with memif pairs and VLAN in circular\
740 | | ... | topology \| 1 \| 2 \| 10 \| pop-1 \|
742 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
744 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
745 | | ... | Variable Should Exist | ${dut2}
747 | | Set interfaces in path up
749 | | Run Keyword If | '${dut2_status}' == 'PASS'
750 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
751 | | ... | ${dut1} | ${DUT1_${int}2}[0]
752 | | ... | ${dut2} | ${DUT2_${int}1}[0] | SUB_ID=${subid}
753 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
754 | | ... | ${dut1} | ${DUT1_${int}2}[0] | SUB_ID=${subid}
755 | | Run Keyword If | '${dut2_status}' == 'PASS'
756 | | ... | Configure L2 tag rewrite method on interfaces
757 | | ... | ${dut1} | ${subif_index_1}
758 | | ... | ${dut2} | ${subif_index_2} | TAG_REWRITE_METHOD=${tag_rewrite}
759 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
760 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
762 | | ${number}= | Set Variable | ${1}
763 | | ${sock1}= | Set Variable | memif-DUT1_CNF
764 | | ${sock2}= | Set Variable | memif-DUT1_CNF
765 | | ${memif_if1_name}= | Set Variable | DUT1-memif-${number}-if1
766 | | ${memif_if2_name}= | Set Variable | DUT1-memif-${number}-if2
767 | | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock2}
768 | | ... | ${number} | ${memif_if1_name} | ${memif_if2_name} | ${rxq_count_int}
769 | | ... | ${rxq_count_int}
770 | | Add interface to bridge domain
771 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${bd_id1}
772 | | Add interface to bridge domain
773 | | ... | ${dut1} | ${${memif_if1_name}} | ${bd_id1}
774 | | Add interface to bridge domain
775 | | ... | ${dut1} | ${${memif_if2_name}} | ${bd_id2}
776 | | Add interface to bridge domain
777 | | ... | ${dut1} | ${subif_index_1} | ${bd_id2}
778 | | ${sock1}= | Run Keyword If | '${dut2_status}' == 'PASS'
779 | | ... | Set Variable | memif-DUT2_CNF
780 | | ${sock2}= | Run Keyword If | '${dut2_status}' == 'PASS'
781 | | ... | Set Variable | memif-DUT2_CNF
782 | | ${memif_if1_name}= | Run Keyword If | '${dut2_status}' == 'PASS'
783 | | ... | Set Variable | DUT2-memif-${number}-if1
784 | | ${memif_if2_name}= | Run Keyword If | '${dut2_status}' == 'PASS'
785 | | ... | Set Variable | DUT2-memif-${number}-if2
786 | | Run Keyword If | '${dut2_status}' == 'PASS'
787 | | ... | Set up memif interfaces on DUT node | ${dut2} | ${sock1} | ${sock2}
788 | | ... | ${number} | ${memif_if1_name} | ${memif_if2_name} | ${rxq_count_int}
789 | | ... | ${rxq_count_int}
790 | | Run Keyword If | '${dut2_status}' == 'PASS'
791 | | ... | Add interface to bridge domain
792 | | ... | ${dut2} | ${subif_index_2} | ${bd_id1}
793 | | Run Keyword If | '${dut2_status}' == 'PASS'
794 | | ... | Add interface to bridge domain
795 | | ... | ${dut2} | ${${memif_if1_name}} | ${bd_id1}
796 | | Run Keyword If | '${dut2_status}' == 'PASS'
797 | | ... | Add interface to bridge domain
798 | | ... | ${dut2} | ${${memif_if2_name}} | ${bd_id2}
799 | | Run Keyword If | '${dut2_status}' == 'PASS'
800 | | ... | Add interface to bridge domain
801 | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${bd_id2}
803 | | Set interfaces in path up
804 | | Show Memif on all DUTs | ${nodes}
805 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
807 | Initialize L2 Bridge Domain for single memif
809 | | ... | Create single Memif interface on all defined VPP nodes. Put Memif
810 | | ... | interface to separate L2 bridge domain with one physical interface.
812 | | ... | *Arguments:*
813 | | ... | - number - Memif ID. Type: integer
816 | | ... | Socket paths for Memif are defined in following format:
817 | | ... | - /tmp/memif-DUT1_CNF\${number}-\${sid}
819 | | ... | KW uses test variable ${rxq_count_int} set by KW Add worker threads
820 | | ... | and rxqueues to all DUTs
824 | | ... | \| Initialize L2 Bridge Domain for single memif \| 1 \|
826 | | [Arguments] | ${number}=${1}
828 | | FOR | ${dut} | IN | @{duts}
829 | | | ${sock}= | Set Variable | memif-${dut}_CNF
830 | | | ${sid}= | Evaluate | (${number} * ${2}) - ${1}
831 | | | Set up single memif interface on DUT node | ${nodes['${dut}']} | ${sock}
832 | | | ... | mid=${number} | sid=${sid} | memif_if=${dut}-memif-${number}-if1
833 | | | ... | rxq=${rxq_count_int} | txq=${rxq_count_int}
834 | | | Add interface to bridge domain
835 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}1}[]0 | ${number}
836 | | | Add interface to bridge domain | ${nodes['${dut}']}
837 | | | ... | ${${dut}-memif-${number}-if1} | ${number}
839 | | Set single interfaces in path up
840 | | Show Memif on all DUTs | ${nodes}
842 | Initialize L2 bridge domain with MACIP ACLs in circular topology
844 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
845 | | ... | domain that is created automatically with index 1. Learning is
846 | | ... | enabled. Interfaces are brought up. Apply required MACIP ACL rules to
847 | | ... | DUT1 interfaces.
849 | | Set interfaces in path up
851 | | VPP Add L2 Bridge Domain
852 | | ... | ${dut1} | ${1} | ${DUT1_${int}1}[0] | ${DUT1_${int}2}[0]
853 | | Configure MACIP ACLs
854 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${DUT1_${int}2}[0]
856 | | Run Keyword If | ${duts_count} == 2
857 | | ... | Configure L2XC | ${dut2} | ${DUT2_${int}1}[0] | ${DUT2_${int}2}[0]
859 | Initialize L2 bridge domain with IPv4 ACLs in circular topology
861 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
862 | | ... | domain that is created automatically with index 1. Learning is
863 | | ... | enabled. Interfaces are brought up. Apply required ACL rules to DUT1
864 | | ... | interfaces.
866 | | Set interfaces in path up
868 | | VPP Add L2 Bridge Domain
869 | | ... | ${dut1} | ${1} | ${DUT1_${int}1}[0] | ${DUT1_${int}2}[0]
870 | | Configure IPv4 ACLs
871 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${DUT1_${int}2}[0]
873 | | Run Keyword If | ${duts_count} == 2
874 | | ... | Configure L2XC | ${dut2} | ${DUT2_${int}1}[0] | ${DUT2_${int}2}[0]