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.
15 | Library | resources.libraries.python.L2Util
16 | Library | resources.libraries.python.InterfaceUtil
17 | Library | resources.libraries.python.NodePath
18 | Library | resources.libraries.python.VhostUser
19 | Library | resources.libraries.python.Memif
22 | Show Bridge Domain Data On All DUTs
23 | | [Documentation] | Show Bridge Domain data on all DUTs.
25 | | FOR | ${dut} | IN | @{duts}
26 | | | VPP Get Bridge Domain Data | ${nodes['${dut}']}
29 | Create bridge domain
31 | | ... | Create bridge domain on given VPP node with defined learning status.
33 | | ... | *Arguments:*
34 | | ... | - ${dut_node} - DUT node. Type: dictionary
35 | | ... | - ${bd_id} - Bridge domain ID. Type: integer
36 | | ... | - ${learn} - Enable/disable MAC learn. Type: boolean, \
37 | | ... | default value: ${TRUE}
41 | | ... | \| Create bridge domain \| ${nodes['DUT1']} \| 2 \|
42 | | ... | \| Create bridge domain \| ${nodes['DUT1']} \| 5 \
43 | | ... | \| learn=${FALSE} \|
45 | | [Arguments] | ${dut_node} | ${bd_id} | ${learn}=${TRUE}
47 | | ${learn} = | Set Variable If | ${learn} == ${TRUE} | ${1} | ${0}
48 | | Create L2 BD | ${dut_node} | ${bd_id} | learn=${learn}
50 | Add interface to bridge domain
52 | | ... | Set given interface admin state to up and add this
53 | | ... | interface to required L2 bridge domain on defined VPP node.
55 | | ... | *Arguments:*
56 | | ... | - ${dut_node} - DUT node. Type: dictionary
57 | | ... | - ${dut_if} - DUT node interface name. Type: string
58 | | ... | - ${bd_id} - Bridge domain ID. Type: integer
59 | | ... | - ${shg} - Split-horizon group ID. Type: integer, default value: 0
63 | | ... | \| Add interface to bridge domain \| ${nodes['DUT2']} \
64 | | ... | \| GigabitEthernet0/8/0 \| 3 \|
66 | | [Arguments] | ${dut_node} | ${dut_if} | ${bd_id} | ${shg}=0
68 | | Set Interface State | ${dut_node} | ${dut_if} | up
69 | | Add Interface To L2 BD | ${dut_node} | ${dut_if} | ${bd_id} | ${shg}
71 | Initialize L2 bridge domain on node
73 | | ... | Setup L2 bridge domain topology by adding two interfaces on DUT into
74 | | ... | separate bridge domains that are created automatically starting with
75 | | ... | index 1. Learning is enabled. Interfaces are brought up.
77 | | ... | *Arguments:*
78 | | ... | - dut - DUT node. Type: string
79 | | ... | - count - Number of bridge domains interfaces. Type: integer
83 | | ... | \| Initialize L2 bridge domain on node \| DUT1 \| 1 \|
85 | | [Arguments] | ${dut} | ${count}=${1}
87 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
88 | | | ${dut_str}= | Convert To Lowercase | ${dut}
89 | | | Add Interface To L2 BD
90 | | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_1} | ${id}
91 | | | Add Interface To L2 BD
92 | | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_2} | ${id}
95 | Initialize L2 bridge domain
97 | | ... | Setup L2 bridge domain topology by adding two interfaces on each DUT
98 | | ... | into separate bridge domains that are created automatically starting
99 | | ... | with index 1. Learning is enabled. Interfaces are brought up.
101 | | ... | *Arguments:*
102 | | ... | - count - Number of bridge domains. Type: integer
106 | | ... | \| Initialize L2 bridge domain \| 1 \|
108 | | [Arguments] | ${count}=${1}
110 | | FOR | ${dut} | IN | @{duts}
111 | | | Initialize L2 bridge domain on node | ${dut} | count=${count}
114 | Initialize L2 bridge domains with Vhost-User on node
116 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
117 | | ... | defined VPP node. Add each Vhost-User interface into L2 bridge
118 | | ... | domains with learning enabled with physical inteface or Vhost-User
119 | | ... | interface of another VM.
121 | | ... | *Arguments:*
122 | | ... | - dut - DUT node. Type: string
123 | | ... | - nf_chain - NF chain. Type: integer
124 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
127 | | ... | Socket paths for VM are defined in following format:
128 | | ... | - /var/run/vpp/sock-\${VM_ID}-1
129 | | ... | - /var/run/vpp/sock-\${VM_ID}-2
133 | | ... | \| Initialize L2 bridge domains with Vhost-User on node \| DUT1 \
134 | | ... | \| 1 \| 1 \|
136 | | [Arguments] | ${dut} | ${nf_chain}=${1} | ${nf_nodes}=${1}
138 | | ${bd_id1}= | Evaluate | ${nf_nodes} * (${nf_chain} - 1) + ${nf_chain}
139 | | ${bd_id2}= | Evaluate | ${nf_nodes} * ${nf_chain} + ${nf_chain}
140 | | ${dut_str}= | Convert To Lowercase | ${dut}
141 | | Add interface to bridge domain
142 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${nf_chain}_1}
144 | | Add interface to bridge domain
145 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${nf_chain}_2}
147 | | FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes} + 1
148 | | | ${qemu_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
149 | | | Configure vhost interfaces
150 | | | ... | ${nodes['${dut}']}
151 | | | ... | /var/run/vpp/sock-${qemu_id}-1 | /var/run/vpp/sock-${qemu_id}-2
152 | | | ... | ${dut}-vhost-${qemu_id}-if1 | ${dut}-vhost-${qemu_id}-if2
153 | | | ${bd_id1}= | Evaluate | ${qemu_id} + (${nf_chain} - 1)
154 | | | ${bd_id2}= | Evaluate | ${bd_id1} + 1
155 | | | Add interface to bridge domain
156 | | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${qemu_id}-if1} | ${bd_id1}
157 | | | Add interface to bridge domain
158 | | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${qemu_id}-if2} | ${bd_id2}
161 | Initialize L2 bridge domains with Vhost-User
163 | | ... | Create pairs of Vhost-User interfaces for defined number of VNF nodes
164 | | ... | on all defined VPP nodes. Add each Vhost-User interface into L2 bridge
165 | | ... | domains with learning enabled with physical inteface or Vhost-User
166 | | ... | interface of another VM.
168 | | ... | *Arguments:*
169 | | ... | - nf_chain - NF chain. Type: integer
170 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
174 | | ... | \| Initialize L2 bridge domains with Vhost-User \| 1 \| 1 \|
176 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1}
178 | | FOR | ${dut} | IN | @{duts}
179 | | | Initialize L2 bridge domains with Vhost-User on node
180 | | | ... | ${dut} | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
183 | Initialize L2 bridge domains for multiple chains with Vhost-User
185 | | ... | Create pairs of Vhost-User interfaces for defined number of NF chains
186 | | ... | with defined number of VNF nodes on all defined VPP nodes. Add each
187 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
188 | | ... | with physical inteface or Vhost-User interface of another VM.
189 | | ... | Put all interfaces in path up.
191 | | ... | *Arguments:*
192 | | ... | - nf_chains - Number of chains of NFs. Type: integer
193 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
194 | | ... | - start - Id of first chain, allows to add chains during test.
195 | | ... | Type: integer
199 | | ... | \| Initialize L2 bridge domains for multiple chains with Vhost-User \
200 | | ... | \| 3 \| 1 \| 2 \|
202 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${start}=${1}
204 | | Set interfaces in path up
205 | | FOR | ${nf_chain} | IN RANGE | ${start} | ${nf_chains} + 1
206 | | | Initialize L2 bridge domains with Vhost-User
207 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
210 | Initialize L2 bridge domain with VXLANoIPv4 in 3-node circular topology
212 | | ... | Setup L2 bridge domain topology with VXLANoIPv4 by connecting
213 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
214 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
215 | | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as
216 | | ... | interfaces.
218 | | Set interfaces in path up
219 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if2} | 172.16.0.1
221 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if1} | 172.16.0.2
223 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac}
224 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac}
225 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
226 | | ... | 172.16.0.1 | 172.16.0.2
227 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
228 | | ... | 172.16.0.2 | 172.16.0.1
229 | | VPP Add L2 Bridge Domain | ${dut1} | ${1} | ${dut1_if1} | ${dut1s_vxlan}
230 | | Set Interface State | ${dut1} | ${dut1s_vxlan} | up
231 | | VPP Add L2 Bridge Domain | ${dut2} | ${1} | ${dut2_if2} | ${dut2s_vxlan}
232 | | Set Interface State | ${dut2} | ${dut2s_vxlan} | up
234 | Initialize L2 bridge domain with VLAN and VXLANoIPv4 in 3-node circular topology
236 | | ... | Setup L2 bridge domain topology with VLAN and VXLANoIPv4 by connecting
237 | | ... | pairs of VLAN sub-interface and VXLAN interface to separate L2 bridge
238 | | ... | domain on each DUT. All interfaces are brought up. IPv4 addresses
239 | | ... | with prefix /32 are configured on interfaces between DUTs. VXLAN
240 | | ... | sub-interfaces has same IPv4 address as interfaces.
242 | | ... | *Arguments:*
243 | | ... | - vxlan_count - VXLAN count. Type: integer
247 | | ... | \| Initialize L2 bridge domain with VLAN and VXLANoIPv4 in 3-node \
248 | | ... | \| circular topology \| ${1} \|
250 | | [Arguments] | ${vxlan_count}=${1}
252 | | Set interfaces in path up
254 | | ${bd_id_start}= | Set Variable | ${1}
255 | | ${vni_start} = | Set Variable | ${20}
257 | | ${ip_step} = | Set Variable | ${2}
258 | | ${dut1_ip_start}= | Set Variable | 172.16.0.1
259 | | ${dut2_ip_start}= | Set Variable | 172.16.0.2
261 | | Vpp create multiple VXLAN IPv4 tunnels | node=${dut1}
262 | | ... | node_vxlan_if=${dut1_if2} | node_vlan_if=${dut1_if1}
263 | | ... | op_node=${dut2} | op_node_if=${dut2_if1} | n_tunnels=${vxlan_count}
264 | | ... | vni_start=${vni_start} | src_ip_start=${dut1_ip_start}
265 | | ... | dst_ip_start=${dut2_ip_start} | ip_step=${ip_step}
266 | | ... | bd_id_start=${bd_id_start}
267 | | Vpp create multiple VXLAN IPv4 tunnels | node=${dut2}
268 | | ... | node_vxlan_if=${dut2_if1} | node_vlan_if=${dut2_if2}
269 | | ... | op_node=${dut1} | op_node_if=${dut1_if2} | n_tunnels=${vxlan_count}
270 | | ... | vni_start=${vni_start} | src_ip_start=${dut2_ip_start}
271 | | ... | dst_ip_start=${dut1_ip_start} | ip_step=${ip_step}
272 | | ... | bd_id_start=${bd_id_start}
274 | Initialize L2 bridge domains with Vhost-User and VXLANoIPv4 in 3-node circular topology
276 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
277 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
278 | | ... | with physical inteface.
279 | | ... | Setup VXLANoIPv4 between DUTs by connecting physical and vxlan
280 | | ... | interfaces on each DUT. All interfaces are brought up.
281 | | ... | IPv4 addresses with prefix /24 are configured on interfaces between
282 | | ... | DUTs. VXLAN sub-interfaces has same IPv4 address as interfaces.
284 | | ... | *Arguments:*
285 | | ... | - bd_id1 - Bridge domain ID. Type: integer
286 | | ... | - bd_id2 - Bridge domain ID. Type: integer
290 | | ... | \| L2 bridge domains with Vhost-User and VXLANoIPv4 initialized in a\
291 | | ... | 3-node circular topology \| 1 \| 2 \|
293 | | [Arguments] | ${bd_id1} | ${bd_id2}
295 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if2} | 172.16.0.1
297 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if1} | 172.16.0.2
299 | | Set interfaces in path up
300 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
301 | | ... | 172.16.0.1 | 172.16.0.2
302 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
303 | | ... | 172.16.0.2 | 172.16.0.1
304 | | Configure vhost interfaces | ${dut1}
305 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
306 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
307 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
308 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
309 | | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${bd_id2}
310 | | Configure vhost interfaces | ${dut2}
311 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
312 | | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${bd_id1}
313 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
314 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
315 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
317 | Initialize L2 bridge domains with VLAN dot1q sub-interfaces in circular topology
319 | | ... | Setup L2 bridge domain topology with learning enabled with VLAN by
320 | | ... | connecting physical and vlan interfaces on each DUT. In case of 3-node
321 | | ... | topology create VLAN sub-interfaces between DUTs. In case of 2-node
322 | | ... | topology create VLAN sub-interface on dut1-if2 interface. All
323 | | ... | interfaces are brought up.
325 | | ... | *Arguments:*
326 | | ... | - bd_id1 - Bridge domain ID. Type: integer
327 | | ... | - bd_id2 - Bridge domain ID. Type: integer
328 | | ... | - subid - ID of the sub-interface to be created. Type: string
329 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
331 | | ... | _NOTE:_ This KW uses following test case variables:
332 | | ... | - dut1 - DUT1 node.
333 | | ... | - dut2 - DUT2 node.
334 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
335 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
339 | | ... | \| Initialize L2 bridge domains with VLAN dot1q sub-interfaces
340 | | ... | in a 3-node circular topology \| 1 \| 2 \| 10 \| pop-1 \|
342 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
344 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
345 | | ... | Variable Should Exist | ${dut2}
347 | | Set interfaces in path up
349 | | Run Keyword If | '${dut2_status}' == 'PASS'
350 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
351 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
352 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
353 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
354 | | Run Keyword If | '${dut2_status}' == 'PASS'
355 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
356 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
357 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
358 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
360 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
361 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id1}
362 | | Run Keyword If | '${dut2_status}' == 'PASS'
363 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
365 | | Run Keyword If | '${dut2_status}' == 'PASS'
366 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2}
369 | Initialize L2 bridge domains with Vhost-User and VLAN in circular topology
371 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
372 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
373 | | ... | with physical inteface. In case of 3-node topology create VLAN
374 | | ... | sub-interfaces between DUTs. In case of 2-node topology create VLAN
375 | | ... | sub-interface on dut1-if2 interface. All interfaces are brought up.
377 | | ... | *Arguments:*
378 | | ... | - bd_id1 - Bridge domain ID. Type: integer
379 | | ... | - bd_id2 - Bridge domain ID. Type: integer
380 | | ... | - subid - ID of the sub-interface to be created. Type: string
381 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
385 | | ... | \| L2 bridge domains with Vhost-User and VLAN initialized in circular\
386 | | ... | topology \| 1 \| 2 \| 10 \| pop-1 \|
388 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
390 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
391 | | ... | Variable Should Exist | ${dut2}
393 | | Set interfaces in path up
395 | | Run Keyword If | '${dut2_status}' == 'PASS'
396 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
397 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
398 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
399 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
400 | | Run Keyword If | '${dut2_status}' == 'PASS'
401 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
402 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
403 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
404 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
406 | | Configure vhost interfaces | ${dut1}
407 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
408 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
409 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
410 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
411 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
412 | | Run Keyword If | '${dut2_status}' == 'PASS'
413 | | ... | Configure vhost interfaces | ${dut2}
414 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
415 | | Run Keyword If | '${dut2_status}' == 'PASS'
416 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
418 | | Run Keyword If | '${dut2_status}' == 'PASS'
419 | | ... | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
420 | | Run Keyword If | '${dut2_status}' == 'PASS'
421 | | ... | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
422 | | Run Keyword If | '${dut2_status}' == 'PASS'
423 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
425 | Initialize L2 bridge domains with Vhost-User and VLAN with VPP link bonding in a 3-node circular topology
427 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Create one
428 | | ... | link bonding (BondEthernet) interface on both VPP nodes. Enslave one
429 | | ... | physical interface towards next DUT by BondEthernet interface. Setup
430 | | ... | VLAN on BondEthernet interfaces between DUTs. Add one Vhost-User
431 | | ... | interface into L2 bridge domains with learning enabled with physical
432 | | ... | interface towards TG and other Vhost-User interface into L2 bridge
433 | | ... | domains with learning enabled with VLAN sub-interface. All interfaces
434 | | ... | are brought up.
436 | | ... | *Arguments:*
437 | | ... | - bd_id1 - Bridge domain ID. Type: integer
438 | | ... | - bd_id2 - Bridge domain ID. Type: integer
439 | | ... | - subid - ID of the sub-interface to be created. Type: string
440 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
441 | | ... | - bond_mode - Link bonding mode. Type: string
442 | | ... | - lb_mode - Load balance mode. Type: string
446 | | ... | \| Initialize L2 bridge domains with Vhost-User and VLAN with VPP\
447 | | ... | link bonding in a 3-node circular topology \| 1 \| 2 \
448 | | ... | \| 10 \| pop-1 \| xor \| l34 \|
450 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
451 | | ... | ${bond_mode} | ${lb_mode}
453 | | Set interfaces in path up
454 | | ${dut1_eth_bond_if1}= | VPP Create Bond Interface | ${dut1} | ${bond_mode}
456 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
457 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
458 | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
459 | | ... | Variable Should Exist | ${dut1_if2}
460 | | Run Keyword If | '${if2_status}' == 'PASS'
461 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2}
462 | | ... | ${dut1_eth_bond_if1}
464 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_1}
465 | | ... | ${dut1_eth_bond_if1}
466 | | Run Keyword Unless | '${if2_status}' == 'PASS'
467 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_2}
468 | | ... | ${dut1_eth_bond_if1}
469 | | ${dut2_eth_bond_if1}= | VPP Create Bond Interface | ${dut2} | ${bond_mode}
471 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
472 | | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1}
473 | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
474 | | ... | Variable Should Exist | ${dut2_if1}
475 | | Run Keyword If | '${if1_status}' == 'PASS'
476 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1}
477 | | ... | ${dut2_eth_bond_if1}
479 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_1}
480 | | ... | ${dut2_eth_bond_if1}
481 | | Run Keyword Unless | '${if2_status}' == 'PASS'
482 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_2}
483 | | ... | ${dut2_eth_bond_if1}
484 | | VPP Show Bond Data On All Nodes | ${nodes} | verbose=${TRUE}
485 | | Initialize VLAN dot1q sub-interfaces in circular topology
486 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
488 | | Configure L2 tag rewrite method on interfaces
489 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
490 | | ... | ${tag_rewrite}
491 | | Configure vhost interfaces | ${dut1}
492 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
493 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
494 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
495 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
496 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
497 | | Configure vhost interfaces | ${dut2}
498 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
499 | | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id1}
500 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
501 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
502 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
504 | Initialize L2 Bridge Domain with memif pairs on DUT node
506 | | ... | Create pairs of Memif interfaces on DUT node. Put each Memif interface
507 | | ... | to separate L2 bridge domain with one physical or memif interface
508 | | ... | to create a chain accross DUT node.
510 | | ... | *Arguments:*
511 | | ... | - dut - DUT node. Type: dictionary
512 | | ... | - nf_chain - NF chain. Type: integer
513 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
514 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
515 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
518 | | ... | Socket paths for Memif are defined in following format:
519 | | ... | - /tmp/memif-\${dut}_CNF\${nf_id}-\${sid}
523 | | ... | \| Initialize L2 Bridge Domain with memif pairs on DUT node \
524 | | ... | \| ${dut} \| 1 \| 1 \|
526 | | [Arguments] | ${dut} | ${nf_chain}=${1} | ${nf_nodes}=${1}
527 | | ... | ${auto_scale}=${True}
529 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
530 | | ... | Set Variable | ${rxq_count_int}
531 | | ... | ELSE | Set Variable | ${1}
532 | | ${bd_id1}= | Evaluate | ${nf_nodes} * (${nf_chain} - 1) + ${nf_chain}
533 | | ${bd_id2}= | Evaluate | ${nf_nodes} * ${nf_chain} + ${nf_chain}
534 | | ${dut_str}= | Convert To Lowercase | ${dut}
535 | | Add interface to bridge domain
536 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${nf_chain}_1}
538 | | Add interface to bridge domain
539 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${nf_chain}_2}
541 | | FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes}+1
542 | | | ${nf_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
543 | | | ${sock1}= | Set Variable | memif-${dut}_CNF
544 | | | ${sock2}= | Set Variable | memif-${dut}_CNF
545 | | | ${bd_id1}= | Evaluate | ${nf_id} + (${nf_chain} - 1)
546 | | | ${bd_id2}= | Evaluate | ${bd_id1} + 1
547 | | | Set up memif interfaces on DUT node | ${nodes['${dut}']}
548 | | | ... | ${sock1} | ${sock2} | ${nf_id} | ${dut}-memif-${nf_id}-if1
549 | | | ... | ${dut}-memif-${nf_id}-if2 | ${rxq} | ${rxq}
550 | | | Add interface to bridge domain
551 | | | ... | ${nodes['${dut}']} | ${${dut}-memif-${nf_id}-if1} | ${bd_id1}
552 | | | Add interface to bridge domain
553 | | | ... | ${nodes['${dut}']} | ${${dut}-memif-${nf_id}-if2} | ${bd_id2}
556 | Initialize L2 Bridge Domain with memif pairs
558 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
559 | | ... | Memif interface to separate L2 bridge domain with one physical or
560 | | ... | virtual interface to create a chain accross DUT node.
562 | | ... | *Arguments:*
563 | | ... | - nf_chain - NF chain. Type: integer
564 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
565 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
566 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
570 | | ... | \| Initialize L2 Bridge Domain with memif pairs \| 1 \| 1 \|
572 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
574 | | FOR | ${dut} | IN | @{duts}
575 | | | Initialize L2 Bridge Domain with memif pairs on DUT node | ${dut}
576 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
577 | | | ... | auto_scale=${auto_scale}
580 | Initialize L2 Bridge Domain for multiple chains with memif pairs
582 | | ... | Create pairs of Memif interfaces for defined number of NF chains
583 | | ... | with defined number of NF nodes on all defined VPP nodes. Add each
584 | | ... | Memif interface into L2 bridge domains with learning enabled
585 | | ... | with physical inteface or Memif interface of another NF.
587 | | ... | *Arguments:*
588 | | ... | - nf_chains - Number of chains of NFs. Type: integer
589 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
590 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
591 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
595 | | ... | \| Initialize L2 Bridge Domain for multiple chains with memif pairs \
596 | | ... | \| 1 \| 1 \|
598 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
600 | | FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
601 | | | Initialize L2 Bridge Domain with memif pairs | nf_chain=${nf_chain}
602 | | | ... | nf_nodes=${nf_nodes} | auto_scale=${auto_scale}
604 | | Set interfaces in path up
605 | | Show Memif on all DUTs | ${nodes}
606 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
608 | Initialize L2 Bridge Domain for pipeline with memif pairs
610 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
611 | | ... | Memif interface to separate L2 bridge domain with one physical or
612 | | ... | virtual interface to create a service pipeline on DUT node.
614 | | ... | *Arguments:*
615 | | ... | - nf_chain - NF pipe. Type: integer
616 | | ... | - nf_nodes - Number of NFs nodes per pipeline. Type: integer
617 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
618 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
622 | | ... | \| Initialize L2 Bridge Domain for pipeline with memif pairs \
623 | | ... | \| 1 \| 1 \|
625 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
627 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
628 | | ... | Set Variable | ${rxq_count_int}
629 | | ... | ELSE | Set Variable | ${1}
630 | | ${bd_id1}= | Evaluate | ${nf_nodes} * (${nf_chain} - 1) + ${nf_chain}
631 | | ${bd_id2}= | Evaluate | ${nf_nodes} * ${nf_chain} + ${nf_chain}
632 | | FOR | ${dut} | IN | @{duts}
633 | | | ${dut_str}= | Convert To Lowercase | ${dut}
634 | | | Add interface to bridge domain
635 | | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${nf_chain}_1}
636 | | | ... | ${bd_id1}
637 | | | Add interface to bridge domain
638 | | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${nf_chain}_2}
639 | | | ... | ${bd_id2}
640 | | | ${nf_id_frst}= | Evaluate | (${nf_chain}-${1}) * ${nf_nodes} + ${1}
641 | | | ${nf_id_last}= | Evaluate | (${nf_chain}-${1}) * ${nf_nodes} + ${nf_nodes}
642 | | | ${sid_frst}= | Evaluate | ${nf_id_frst} * ${2} - ${1}
643 | | | ${sid_last}= | Evaluate | ${nf_id_last} * ${2}
644 | | | Set up single memif interface on DUT node | ${nodes['${dut}']}
645 | | | ... | memif-${dut}_CNF | mid=${nf_id_frst} | sid=${sid_frst}
646 | | | ... | memif_if=${dut}-memif-${nf_id_frst}-if1
647 | | | ... | rxq=${rxq} | txq=${rxq}
648 | | | Set up single memif interface on DUT node | ${nodes['${dut}']}
649 | | | ... | memif-${dut}_CNF | mid=${nf_id_last} | sid=${sid_last}
650 | | | ... | memif_if=${dut}-memif-${nf_id_last}-if2
651 | | | ... | rxq=${rxq} | txq=${rxq}
652 | | | Add interface to bridge domain
653 | | | ... | ${nodes['${dut}']} | ${${dut}-memif-${nf_id_frst}-if1} | ${bd_id1}
654 | | | Add interface to bridge domain
655 | | | ... | ${nodes['${dut}']} | ${${dut}-memif-${nf_id_last}-if2} | ${bd_id2}
658 | Initialize L2 Bridge Domain for multiple pipelines with memif pairs
660 | | ... | Create pairs of Memif interfaces for defined number of NF pipelines
661 | | ... | with defined number of NF nodes on all defined VPP nodes. Add each
662 | | ... | Memif interface into L2 bridge domains with learning enabled
663 | | ... | with physical inteface or Memif interface of another NF.
665 | | ... | *Arguments:*
666 | | ... | - nf_chains - Number of pipelines of NFs. Type: integer
667 | | ... | - nf_nodes - Number of NFs nodes per pipeline. Type: integer
668 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
669 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
673 | | ... | \| Initialize L2 Bridge Domain for multiple pipelines with memif \
674 | | ... | pairs \| 1 \| 1 \|
676 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
678 | | FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
679 | | | Initialize L2 Bridge Domain for pipeline with memif pairs
680 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
681 | | | ... | auto_scale=${auto_scale}
683 | | Set interfaces in path up
684 | | Show Memif on all DUTs | ${nodes}
685 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
687 | Initialize L2 Bridge Domain with memif pairs and VLAN in circular topology
689 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
690 | | ... | Memif interface to separate L2 bridge domain with one physical or
691 | | ... | virtual interface to create a chain accross DUT node. In case of
692 | | ... | 3-node topology create VLAN sub-interfaces between DUTs. In case of
693 | | ... | 2-node topology create VLAN sub-interface on dut1-if2 interface. All
694 | | ... | interfaces are brought up.
696 | | ... | *Arguments:*
697 | | ... | - bd_id1 - Bridge domain ID. Type: integer
698 | | ... | - bd_id2 - Bridge domain ID. Type: integer
699 | | ... | - subid - ID of the sub-interface to be created. Type: string
700 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
704 | | ... | \| Initialize L2 Bridge Domain with memif pairs and VLAN in circular\
705 | | ... | topology \| 1 \| 2 \| 10 \| pop-1 \|
707 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
709 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
710 | | ... | Variable Should Exist | ${dut2}
712 | | Set interfaces in path up
714 | | Run Keyword If | '${dut2_status}' == 'PASS'
715 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
716 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
717 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
718 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
719 | | Run Keyword If | '${dut2_status}' == 'PASS'
720 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
721 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
722 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
723 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
725 | | ${number}= | Set Variable | ${1}
726 | | ${sock1}= | Set Variable | memif-DUT1_CNF
727 | | ${sock2}= | Set Variable | memif-DUT1_CNF
728 | | ${memif_if1_name}= | Set Variable | DUT1-memif-${number}-if1
729 | | ${memif_if2_name}= | Set Variable | DUT1-memif-${number}-if2
730 | | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock2}
731 | | ... | ${number} | ${memif_if1_name} | ${memif_if2_name} | ${rxq_count_int}
732 | | ... | ${rxq_count_int}
733 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
734 | | Add interface to bridge domain | ${dut1} | ${${memif_if1_name}} | ${bd_id1}
735 | | Add interface to bridge domain | ${dut1} | ${${memif_if2_name}} | ${bd_id2}
736 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
737 | | ${sock1}= | Run Keyword If | '${dut2_status}' == 'PASS'
738 | | ... | Set Variable | memif-DUT2_CNF
739 | | ${sock2}= | Run Keyword If | '${dut2_status}' == 'PASS'
740 | | ... | Set Variable | memif-DUT2_CNF
741 | | ${memif_if1_name}= | Run Keyword If | '${dut2_status}' == 'PASS'
742 | | ... | Set Variable | DUT2-memif-${number}-if1
743 | | ${memif_if2_name}= | Run Keyword If | '${dut2_status}' == 'PASS'
744 | | ... | Set Variable | DUT2-memif-${number}-if2
745 | | Run Keyword If | '${dut2_status}' == 'PASS'
746 | | ... | Set up memif interfaces on DUT node | ${dut2} | ${sock1} | ${sock2}
747 | | ... | ${number} | ${memif_if1_name} | ${memif_if2_name} | ${rxq_count_int}
748 | | ... | ${rxq_count_int}
749 | | Run Keyword If | '${dut2_status}' == 'PASS'
750 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
752 | | Run Keyword If | '${dut2_status}' == 'PASS'
753 | | ... | Add interface to bridge domain | ${dut2} | ${${memif_if1_name}}
755 | | Run Keyword If | '${dut2_status}' == 'PASS'
756 | | ... | Add interface to bridge domain | ${dut2} | ${${memif_if2_name}}
758 | | Run Keyword If | '${dut2_status}' == 'PASS'
759 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
761 | | Show Memif on all DUTs | ${nodes}
762 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
764 | Initialize L2 Bridge Domain for single memif
766 | | ... | Create single Memif interface on all defined VPP nodes. Put Memif
767 | | ... | interface to separate L2 bridge domain with one physical interface.
769 | | ... | *Arguments:*
770 | | ... | - number - Memif ID. Type: integer
773 | | ... | Socket paths for Memif are defined in following format:
774 | | ... | - /tmp/memif-DUT1_CNF\${number}-\${sid}
776 | | ... | KW uses test variable ${rxq_count_int} set by KW Add worker threads
777 | | ... | and rxqueues to all DUTs
781 | | ... | \| Initialize L2 Bridge Domain for single memif \| 1 \|
783 | | [Arguments] | ${number}=${1}
785 | | FOR | ${dut} | IN | @{duts}
786 | | | ${sock}= | Set Variable | memif-${dut}_CNF
787 | | | ${sid}= | Evaluate | (${number} * ${2}) - ${1}
788 | | | Set up single memif interface on DUT node | ${nodes['${dut}']} | ${sock}
789 | | | ... | mid=${number} | sid=${sid} | memif_if=${dut}-memif-${number}-if1
790 | | | ... | rxq=${rxq_count_int} | txq=${rxq_count_int}
791 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1}
792 | | | ... | ${number}
793 | | | Add interface to bridge domain | ${nodes['${dut}']}
794 | | | ... | ${${dut}-memif-${number}-if1} | ${number}
796 | | Set single interfaces in path up
797 | | Show Memif on all DUTs | ${nodes}
799 | Initialize L2 bridge domain with MACIP ACLs on DUT1 in 3-node circular topology
801 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
802 | | ... | domain that is created automatically with index 1. Learning is
803 | | ... | enabled. Interfaces are brought up. Apply required MACIP ACL rules to
804 | | ... | DUT1 interfaces.
806 | | Set interfaces in path up
807 | | VPP Add L2 Bridge Domain | ${dut1} | ${1} | ${dut1_if1} | ${dut1_if2}
808 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
809 | | Configure MACIP ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
811 | Initialize L2 bridge domain with IPv4 ACLs on DUT1 in 3-node circular topology
813 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
814 | | ... | domain that is created automatically with index 1. Learning is
815 | | ... | enabled. Interfaces are brought up. Apply required ACL rules to DUT1
816 | | ... | interfaces.
818 | | Set interfaces in path up
819 | | VPP Add L2 Bridge Domain | ${dut1} | ${1} | ${dut1_if1} | ${dut1_if2}
820 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
821 | | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}