Clean: L2 bridge domain
[csit.git] / resources / libraries / robot / l2 / l2_bridge_domain.robot
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:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | 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
20
21 *** Keywords ***
22 | Show Bridge Domain Data On All DUTs
23 | | [Documentation] | Show Bridge Domain data on all DUTs.
24 | | ...
25 | | :FOR | ${dut} | IN | @{duts}
26 | | | VPP Get Bridge Domain Data | ${nodes['${dut}']}
27
28 | Create bridge domain
29 | | [Documentation]
30 | | ... | Create bridge domain on given VPP node with defined learning status.
31 | | ...
32 | | ... | *Arguments:*
33 | | ... | - ${dut_node} - DUT node. Type: dictionary
34 | | ... | - ${bd_id} - Bridge domain ID. Type: integer
35 | | ... | - ${learn} - Enable/disable MAC learn. Type: boolean, \
36 | | ... | default value: ${TRUE}
37 | | ...
38 | | ... | *Example:*
39 | | ...
40 | | ... | \| Create bridge domain \| ${nodes['DUT1']} \| 2 \|
41 | | ... | \| Create bridge domain \| ${nodes['DUT1']} \| 5 \
42 | | ... | \| learn=${FALSE} \|
43 | | ...
44 | | [Arguments] | ${dut_node} | ${bd_id} | ${learn}=${TRUE}
45 | | ...
46 | | ${learn} = | Set Variable If | ${learn} == ${TRUE} | ${1} | ${0}
47 | | Create L2 BD | ${dut_node} | ${bd_id} | learn=${learn}
48
49 | Add interface to bridge domain
50 | | [Documentation]
51 | | ... | Set given interface admin state to up and add this
52 | | ... | interface to required L2 bridge domain on defined VPP node.
53 | | ...
54 | | ... | *Arguments:*
55 | | ... | - ${dut_node} - DUT node. Type: dictionary
56 | | ... | - ${dut_if} - DUT node interface name. Type: string
57 | | ... | - ${bd_id} - Bridge domain ID. Type: integer
58 | | ... | - ${shg} - Split-horizon group ID. Type: integer, default value: 0
59 | | ...
60 | | ... | *Example:*
61 | | ...
62 | | ... | \| Add interface to bridge domain \| ${nodes['DUT2']} \
63 | | ... | \| GigabitEthernet0/8/0 \| 3 \|
64 | | ...
65 | | [Arguments] | ${dut_node} | ${dut_if} | ${bd_id} | ${shg}=0
66 | | ...
67 | | Set Interface State | ${dut_node} | ${dut_if} | up
68 | | Add Interface To L2 BD | ${dut_node} | ${dut_if} | ${bd_id} | ${shg}
69
70 | Add destination port to L2FIB
71 | | [Documentation]
72 | | ... | Create a static L2FIB entry for required destination port
73 | | ... | on defined interface and bridge domain ID of the given VPP node.
74 | | ...
75 | | ... | *Arguments:*
76 | | ... | - ${dest_node} - Destination node. Type: dictionary
77 | | ... | - ${dest_node_if} - Destination node interface name. Type: string
78 | | ... | - ${vpp_node} - DUT node to add L2FIB entry on. Type: dictionary
79 | | ... | - ${vpp_node_if} - DUT node interface name. Type: string
80 | | ... | - ${bd_id} - Bridge domain ID. Type: integer
81 | | ...
82 | | ... | *Return:*
83 | | ... | - No value returned
84 | | ...
85 | | ... | *Example:*
86 | | ...
87 | | ... | \| Add destination port to L2FIB \| ${nodes['TG']} \
88 | | ... | \| eth1 \| ${nodes['DUT2']} \| GigabitEthernet0/8/0 \| 3 \|
89 | | ...
90 | | [Arguments] | ${node} | ${dest_node_if} | ${vpp_node}
91 | | ... | ${vpp_node_if} | ${bd_id}
92 | | ...
93 | | ${mac}= | Get Interface Mac | ${node} | ${dest_node_if}
94 | | Vpp Add L2fib Entry | ${vpp_node} | ${mac} | ${vpp_node_if} | ${bd_id}
95
96 | Initialize L2 bridge domain on node
97 | | [Documentation]
98 | | ... | Setup L2 bridge domain topology by adding two interfaces on DUT into
99 | | ... | separate bridge domains that are created automatically starting with
100 | | ... | index 1. Learning is enabled. Interfaces are brought up.
101 | | ...
102 | | ... | *Arguments:*
103 | | ... | - dut - DUT node. Type: string
104 | | ... | - count - Number of bridge domains interfaces. Type: integer
105 | | ...
106 | | ... | *Example:*
107 | | ...
108 | | ... | \| Initialize L2 bridge domain on node \| DUT1 \| 1 \|
109 | | ...
110 | | [Arguments] | ${dut} | ${count}=${1}
111 | | ...
112 | | :FOR | ${id} | IN RANGE | 1 | ${count} + 1
113 | | | ${dut_str}= | Convert To Lowercase | ${dut}
114 | | | Add Interface To L2 BD
115 | | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_1} | ${id}
116 | | | Add Interface To L2 BD
117 | | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_2} | ${id}
118
119 | Initialize L2 bridge domain
120 | | [Documentation]
121 | | ... | Setup L2 bridge domain topology by adding two interfaces on each DUT
122 | | ... | into separate bridge domains that are created automatically starting
123 | | ... | with index 1. Learning is enabled. Interfaces are brought up.
124 | | ...
125 | | ... | *Arguments:*
126 | | ... | - count - Number of bridge domains. Type: integer
127 | | ...
128 | | ... | *Example:*
129 | | ...
130 | | ... | \| Initialize L2 bridge domain \| 1 \|
131 | | ...
132 | | [Arguments] | ${count}=${1}
133 | | ...
134 | | :FOR | ${dut} | IN | @{duts}
135 | | | Initialize L2 bridge domain on node | ${dut} | count=${count}
136
137 | Initialize L2 bridge domains with Vhost-User on node
138 | | [Documentation]
139 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
140 | | ... | defined VPP node. Add each Vhost-User interface into L2 bridge
141 | | ... | domains with learning enabled with physical inteface or Vhost-User
142 | | ... | interface of another VM.
143 | | ...
144 | | ... | *Arguments:*
145 | | ... | - dut - DUT node. Type: string
146 | | ... | - nf_chain - NF chain. Type: integer
147 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
148 | | ...
149 | | ... | *Note:*
150 | | ... | Socket paths for VM are defined in following format:
151 | | ... | - /var/run/vpp/sock-\${VM_ID}-1
152 | | ... | - /var/run/vpp/sock-\${VM_ID}-2
153 | | ...
154 | | ... | *Example:*
155 | | ...
156 | | ... | \| Initialize L2 bridge domains with Vhost-User on node \| DUT1 \
157 | | ... | \| 1 \| 1 \|
158 | | ...
159 | | [Arguments] | ${dut} | ${nf_chain}=${1} | ${nf_nodes}=${1}
160 | | ...
161 | | ${bd_id1}= | Evaluate | ${nf_nodes} * (${nf_chain} - 1) + ${nf_chain}
162 | | ${bd_id2}= | Evaluate | ${nf_nodes} * ${nf_chain} + ${nf_chain}
163 | | ${dut_str}= | Convert To Lowercase | ${dut}
164 | | Add interface to bridge domain
165 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${nf_chain}_1}
166 | | ... | ${bd_id1}
167 | | Add interface to bridge domain
168 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${nf_chain}_2}
169 | | ... | ${bd_id2}
170 | | :FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes} + 1
171 | | | ${qemu_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
172 | | | Configure vhost interfaces
173 | | | ... | ${nodes['${dut}']}
174 | | | ... | /var/run/vpp/sock-${qemu_id}-1 | /var/run/vpp/sock-${qemu_id}-2
175 | | | ... | ${dut}-vhost-${qemu_id}-if1 | ${dut}-vhost-${qemu_id}-if2
176 | | | ${bd_id1}= | Evaluate | ${qemu_id} + (${nf_chain} - 1)
177 | | | ${bd_id2}= | Evaluate | ${bd_id1} + 1
178 | | | Add interface to bridge domain
179 | | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${qemu_id}-if1} | ${bd_id1}
180 | | | Add interface to bridge domain
181 | | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${qemu_id}-if2} | ${bd_id2}
182
183 | Initialize L2 bridge domains with Vhost-User
184 | | [Documentation]
185 | | ... | Create pairs of Vhost-User interfaces for defined number of VNF nodes
186 | | ... | on all defined VPP nodes. Add each Vhost-User interface into L2 bridge
187 | | ... | domains with learning enabled with physical inteface or Vhost-User
188 | | ... | interface of another VM.
189 | | ...
190 | | ... | *Arguments:*
191 | | ... | - nf_chain - NF chain. Type: integer
192 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
193 | | ...
194 | | ... | *Example:*
195 | | ...
196 | | ... | \| Initialize L2 bridge domains with Vhost-User \| 1 \| 1 \|
197 | | ...
198 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1}
199 | | ...
200 | | :FOR | ${dut} | IN | @{duts}
201 | | | Initialize L2 bridge domains with Vhost-User on node
202 | | | ... | ${dut} | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
203
204 | Initialize L2 bridge domains for multiple chains with Vhost-User
205 | | [Documentation]
206 | | ... | Create pairs of Vhost-User interfaces for defined number of NF chains
207 | | ... | with defined number of VNF nodes on all defined VPP nodes. Add each
208 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
209 | | ... | with physical inteface or Vhost-User interface of another VM.
210 | | ... | Put all interfaces in path up.
211 | | ...
212 | | ... | *Arguments:*
213 | | ... | - nf_chains - Number of chains of NFs. Type: integer
214 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
215 | | ...
216 | | ... | *Example:*
217 | | ...
218 | | ... | \| Initialize L2 bridge domains for multiple chains with Vhost-User \
219 | | ... | \| 1 \| 1 \|
220 | | ...
221 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1}
222 | | ...
223 | | Set interfaces in path up
224 | | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains} + 1
225 | | | Initialize L2 bridge domains with Vhost-User
226 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
227
228 | Initialize L2 bridge domain with VXLANoIPv4 in 3-node circular topology
229 | | [Documentation]
230 | | ... | Setup L2 bridge domain topology with VXLANoIPv4 by connecting
231 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
232 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
233 | | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as
234 | | ... | interfaces.
235 | | ...
236 | | Set interfaces in path up
237 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if2} | 172.16.0.1
238 | | ... | 24
239 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if1} | 172.16.0.2
240 | | ... | 24
241 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac}
242 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac}
243 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
244 | | ... | 172.16.0.1 | 172.16.0.2
245 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
246 | | ... | 172.16.0.2 | 172.16.0.1
247 | | VPP Add L2 Bridge Domain | ${dut1} | ${1} | ${dut1_if1} | ${dut1s_vxlan}
248 | | Set Interface State | ${dut1} | ${dut1s_vxlan} | up
249 | | VPP Add L2 Bridge Domain | ${dut2} | ${1} | ${dut2_if2} | ${dut2s_vxlan}
250 | | Set Interface State | ${dut2} | ${dut2s_vxlan} | up
251
252 | Initialize L2 bridge domain with VLAN and VXLANoIPv4 in 3-node circular topology
253 | | [Documentation]
254 | | ... | Setup L2 bridge domain topology with VLAN and VXLANoIPv4 by connecting
255 | | ... | pairs of VLAN sub-interface and VXLAN interface to separate L2 bridge
256 | | ... | domain on each DUT. All interfaces are brought up. IPv4 addresses
257 | | ... | with prefix /32 are configured on interfaces between DUTs. VXLAN
258 | | ... | sub-interfaces has same IPv4 address as interfaces.
259 | | ...
260 | | ... | *Arguments:*
261 | | ... | - vxlan_count - VXLAN count. Type: integer
262 | | ...
263 | | ... | *Example:*
264 | | ...
265 | | ... | \| Initialize L2 bridge domain with VLAN and VXLANoIPv4 in 3-node \
266 | | ... | \| circular topology \| ${1} \|
267 | | ...
268 | | [Arguments] | ${vxlan_count}=${1}
269 | | ...
270 | | Set interfaces in path up
271 | | ...
272 | | ${bd_id_start}= | Set Variable | ${1}
273 | | ${vni_start} = | Set Variable | ${20}
274 | | ...
275 | | ${ip_step} = | Set Variable | ${2}
276 | | ${dut1_ip_start}= | Set Variable | 172.16.0.1
277 | | ${dut2_ip_start}= | Set Variable | 172.16.0.2
278 | | ...
279 | | Vpp create multiple VXLAN IPv4 tunnels | node=${dut1}
280 | | ... | node_vxlan_if=${dut1_if2} | node_vlan_if=${dut1_if1}
281 | | ... | op_node=${dut2} | op_node_if=${dut2_if1} | n_tunnels=${vxlan_count}
282 | | ... | vni_start=${vni_start} | src_ip_start=${dut1_ip_start}
283 | | ... | dst_ip_start=${dut2_ip_start} | ip_step=${ip_step}
284 | | ... | bd_id_start=${bd_id_start}
285 | | Vpp create multiple VXLAN IPv4 tunnels | node=${dut2}
286 | | ... | node_vxlan_if=${dut2_if1} | node_vlan_if=${dut2_if2}
287 | | ... | op_node=${dut1} | op_node_if=${dut1_if2} | n_tunnels=${vxlan_count}
288 | | ... | vni_start=${vni_start} | src_ip_start=${dut2_ip_start}
289 | | ... | dst_ip_start=${dut1_ip_start} | ip_step=${ip_step}
290 | | ... | bd_id_start=${bd_id_start}
291
292 | Initialize L2 bridge domains with Vhost-User and VXLANoIPv4 in 3-node circular topology
293 | | [Documentation]
294 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
295 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
296 | | ... | with physical inteface.
297 | | ... | Setup VXLANoIPv4 between DUTs by connecting physical and vxlan
298 | | ... | interfaces on each DUT. All interfaces are brought up.
299 | | ... | IPv4 addresses with prefix /24 are configured on interfaces between
300 | | ... | DUTs. VXLAN sub-interfaces has same IPv4 address as interfaces.
301 | | ...
302 | | ... | *Arguments:*
303 | | ... | - bd_id1 - Bridge domain ID. Type: integer
304 | | ... | - bd_id2 - Bridge domain ID. Type: integer
305 | | ...
306 | | ... | *Example:*
307 | | ...
308 | | ... | \| L2 bridge domains with Vhost-User and VXLANoIPv4 initialized in a\
309 | | ... | 3-node circular topology \| 1 \| 2 \|
310 | | ...
311 | | [Arguments] | ${bd_id1} | ${bd_id2}
312 | | ...
313 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if2} | 172.16.0.1
314 | | ... | 24
315 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if1} | 172.16.0.2
316 | | ... | 24
317 | | Set interfaces in path up
318 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
319 | | ... | 172.16.0.1 | 172.16.0.2
320 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
321 | | ... | 172.16.0.2 | 172.16.0.1
322 | | Configure vhost interfaces | ${dut1}
323 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
324 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
325 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
326 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
327 | | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${bd_id2}
328 | | Configure vhost interfaces | ${dut2}
329 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
330 | | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${bd_id1}
331 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
332 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
333 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
334
335 | Init L2 bridge domains with single DUT with Vhost-User and VXLANoIPv4 in 3-node circular topology
336 | | [Documentation]
337 | | ... | Create two Vhost-User interfaces on one VPP node. Add each
338 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
339 | | ... | one connected to physical interface, the other to VXLAN.
340 | | ... | Setup VXLANoIPv4 between DUTs and TG by connecting physical and vxlan
341 | | ... | interfaces on the DUT. All interfaces are brought up.
342 | | ... | IPv4 addresses with prefix /24 are configured on interfaces between
343 | | ... | DUT and TG.
344 | | ...
345 | | ... | *Arguments:*
346 | | ... | - dut1_address - Address of physical interface on DUT1. Type: string
347 | | ... | - dut1_address_subnet - Subnet of the address of physical interface on
348 | | ... |                         DUT1. Type: string
349 | | ... | - dut2_address - Address of physical interface on DUT2. Type: string
350 | | ... | - dut2_address_subnet - Subnet of the address of physical interface on
351 | | ... |                         DUT2. Type: string
352 | | ... | - dut1_gw - Address of the _gateway_ to which the traffic will be
353 | | ... |             forwarded on DUT1. Type: string
354 | | ... | - dut2_gw - Address of the _gateway_ to which the traffic will be
355 | | ... |             forwarded on DUT2. Type: string
356 | | ... | - dut1_vxlans - List of VXLAN params to be configured on DUT1.
357 | | ... |                 Type: list of dicts, dict params vni, vtep
358 | | ... | - dut2_vxlans - List of VXLAN params to be configured on DUT2.
359 | | ... |                 Type: list of dicts, dict params vni, vtep
360 | | ... | - dut1_route_subnet - Subnet address to forward to  _gateway_ on DUT1.
361 | | ... |                       Type: string
362 | | ... | - dut1_route_mask - Subnet address mask to forward to  _gateway_
363 | | ... |                     on DUT1. Type: string
364 | | ... | - dut2_route_subnet - Subnet address to forward to  _gateway_ on DUT2.
365 | | ... |                       Type: string
366 | | ... | - dut2_route_mask - Subnet address mask to forward to  _gateway_
367 | | ... |                     on DUT2. Type: string
368 | | ...
369 | | ... | *Example:*
370 | | ...
371 | | [Arguments] | ${dut1_address} | ${dut1_address_subnet} |
372 | | ... | ${dut2_address} | ${dut2_address_subnet} | ${dut1_gw} | ${dut2_gw} |
373 | | ... | ${dut1_vxlans} | ${dut2_vxlans} | ${dut1_route_subnet} |
374 | | ... | ${dut1_route_mask} | ${dut2_route_subnet} | ${dut2_route_mask}
375 | | ...
376 | | Configure vhost interfaces | ${dut1}
377 | | ... | /var/run/vpp/sock-1-${dut1_bd_id1}
378 | | ... | /var/run/vpp/sock-1-${dut1_bd_id2}
379 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if1} |
380 | | ... | ${dut1_address} | ${dut1_address_subnet}
381 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if2} |
382 | | ... | ${dut2_address} | ${dut2_address_subnet}
383 | | ${dut1_bd_id1}= | Set Variable | 1
384 | | ${dut1_bd_id2}= | Set Variable | 2
385 | | ${dut2_bd_id1}= | Set Variable | 1
386 | | :FOR | ${vxlan} | IN | @{dut1_vxlans}
387 | | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | ${vxlan.vni}
388 | | | ... | ${dut1_address} | ${vxlan.vtep}
389 | | | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${dut1_bd_id1}
390 | | :FOR | ${vxlan} | IN | @{dut2_vxlans}
391 | | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | ${vxlan.vni}
392 | | | ... | ${dut2_address} | ${vxlan.vtep}
393 | | | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${dut2_bd_id1}
394 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | ${dut1_gw} | ${tg_if1_mac}
395 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if2} | ${dut2_gw} | ${tg_if2_mac}
396 | | Vpp Route Add | ${dut1} | ${dut1_route_subnet} | ${dut1_route_mask}
397 | | ... | gateway=${dut1_gw} | interface=${dut1_if1}
398 | | Vpp Route Add | ${dut2} | ${dut2_route_subnet} | ${dut2_route_mask}
399 | | ... | gateway=${dut2_gw} | interface=${dut2_if2}
400 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${dut1_bd_id2}
401 | | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${dut2_bd_id1}
402 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${dut1_bd_id1}
403 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${dut1_bd_id2}
404
405 | Initialize L2 bridge domains with VLAN dot1q sub-interfaces in circular topology
406 | | [Documentation]
407 | | ... | Setup L2 bridge domain topology with learning enabled with VLAN by
408 | | ... | connecting physical and vlan interfaces on each DUT. In case of 3-node
409 | | ... | topology create VLAN sub-interfaces between DUTs. In case of 2-node
410 | | ... | topology create VLAN sub-interface on dut1-if2 interface. All
411 | | ... | interfaces are brought up.
412 | | ...
413 | | ... | *Arguments:*
414 | | ... | - bd_id1 - Bridge domain ID. Type: integer
415 | | ... | - bd_id2 - Bridge domain ID. Type: integer
416 | | ... | - subid - ID of the sub-interface to be created. Type: string
417 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
418 | | ...
419 | | ... | _NOTE:_ This KW uses following test case variables:
420 | | ... | - dut1 - DUT1 node.
421 | | ... | - dut2 - DUT2 node.
422 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
423 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
424 | | ...
425 | | ... | *Example:*
426 | | ...
427 | | ... | \| Initialize L2 bridge domains with VLAN dot1q sub-interfaces
428 | | ... | in a 3-node circular topology \| 1 \| 2 \| 10 \| pop-1 \|
429 | | ...
430 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
431 | | ...
432 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
433 | | ... | Variable Should Exist | ${dut2}
434 | | ...
435 | | Set interfaces in path up
436 | | ...
437 | | Run Keyword If | '${dut2_status}' == 'PASS'
438 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
439 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
440 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
441 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
442 | | Run Keyword If | '${dut2_status}' == 'PASS'
443 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
444 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
445 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
446 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
447 | | ...
448 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
449 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id1}
450 | | Run Keyword If | '${dut2_status}' == 'PASS'
451 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
452 | | ... | ${bd_id2}
453 | | Run Keyword If | '${dut2_status}' == 'PASS'
454 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2}
455 | | ... | ${bd_id2}
456
457 | Initialize L2 bridge domains with Vhost-User and VLAN in circular topology
458 | | [Documentation]
459 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
460 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
461 | | ... | with physical inteface. In case of 3-node topology create VLAN
462 | | ... | sub-interfaces between DUTs. In case of 2-node topology create VLAN
463 | | ... | sub-interface on dut1-if2 interface. All interfaces are brought up.
464 | | ...
465 | | ... | *Arguments:*
466 | | ... | - bd_id1 - Bridge domain ID. Type: integer
467 | | ... | - bd_id2 - Bridge domain ID. Type: integer
468 | | ... | - subid - ID of the sub-interface to be created. Type: string
469 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
470 | | ...
471 | | ... | *Example:*
472 | | ...
473 | | ... | \| L2 bridge domains with Vhost-User and VLAN initialized in circular\
474 | | ... | topology \| 1 \| 2 \| 10 \| pop-1 \|
475 | | ...
476 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
477 | | ...
478 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
479 | | ... | Variable Should Exist | ${dut2}
480 | | ...
481 | | Set interfaces in path up
482 | | ...
483 | | Run Keyword If | '${dut2_status}' == 'PASS'
484 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
485 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
486 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
487 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
488 | | Run Keyword If | '${dut2_status}' == 'PASS'
489 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
490 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
491 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
492 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
493 | | ...
494 | | Configure vhost interfaces | ${dut1}
495 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
496 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
497 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
498 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
499 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
500 | | Run Keyword If | '${dut2_status}' == 'PASS'
501 | | ... | Configure vhost interfaces | ${dut2}
502 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
503 | | Run Keyword If | '${dut2_status}' == 'PASS'
504 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
505 | | ... | ${bd_id1}
506 | | Run Keyword If | '${dut2_status}' == 'PASS'
507 | | ... | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
508 | | Run Keyword If | '${dut2_status}' == 'PASS'
509 | | ... | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
510 | | Run Keyword If | '${dut2_status}' == 'PASS'
511 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
512
513 | Initialize L2 bridge domains with Vhost-User and VLAN with VPP link bonding in a 3-node circular topology
514 | | [Documentation]
515 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Create one
516 | | ... | link bonding (BondEthernet) interface on both VPP nodes. Enslave one
517 | | ... | physical interface towards next DUT by BondEthernet interface. Setup
518 | | ... | VLAN on BondEthernet interfaces between DUTs. Add one Vhost-User
519 | | ... | interface into L2 bridge domains with learning enabled with physical
520 | | ... | interface towards TG and other Vhost-User interface into L2 bridge
521 | | ... | domains with learning enabled with VLAN sub-interface. All interfaces
522 | | ... | are brought up.
523 | | ...
524 | | ... | *Arguments:*
525 | | ... | - bd_id1 - Bridge domain ID. Type: integer
526 | | ... | - bd_id2 - Bridge domain ID. Type: integer
527 | | ... | - subid - ID of the sub-interface to be created. Type: string
528 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
529 | | ... | - bond_mode - Link bonding mode. Type: string
530 | | ... | - lb_mode - Load balance mode. Type: string
531 | | ...
532 | | ... | *Example:*
533 | | ...
534 | | ... | \| Initialize L2 bridge domains with Vhost-User and VLAN with VPP\
535 | | ... | link bonding in a 3-node circular topology \| 1 \| 2 \
536 | | ... | \| 10 \| pop-1 \| xor \| l34 \|
537 | | ...
538 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
539 | | ... | ${bond_mode} | ${lb_mode}
540 | | ...
541 | | Set interfaces in path up
542 | | ${dut1_eth_bond_if1}= | VPP Create Bond Interface | ${dut1} | ${bond_mode}
543 | | ... | ${lb_mode}
544 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
545 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
546 | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
547 | | ... | Variable Should Exist | ${dut1_if2}
548 | | Run Keyword If | '${if2_status}' == 'PASS'
549 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2}
550 | | ... | ${dut1_eth_bond_if1}
551 | | ... | ELSE
552 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_1}
553 | | ... | ${dut1_eth_bond_if1}
554 | | Run Keyword Unless | '${if2_status}' == 'PASS'
555 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_2}
556 | | ... | ${dut1_eth_bond_if1}
557 | | ${dut2_eth_bond_if1}= | VPP Create Bond Interface | ${dut2} | ${bond_mode}
558 | | ... | ${lb_mode}
559 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
560 | | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1}
561 | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
562 | | ... | Variable Should Exist | ${dut2_if1}
563 | | Run Keyword If | '${if1_status}' == 'PASS'
564 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1}
565 | | ... | ${dut2_eth_bond_if1}
566 | | ... | ELSE
567 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_1}
568 | | ... | ${dut2_eth_bond_if1}
569 | | Run Keyword Unless | '${if2_status}' == 'PASS'
570 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_2}
571 | | ... | ${dut2_eth_bond_if1}
572 | | VPP Show Bond Data On All Nodes | ${nodes} | verbose=${TRUE}
573 | | Initialize VLAN dot1q sub-interfaces in circular topology
574 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
575 | | ... | ${subid}
576 | | Configure L2 tag rewrite method on interfaces
577 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
578 | | ... | ${tag_rewrite}
579 | | Configure vhost interfaces | ${dut1}
580 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
581 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
582 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
583 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
584 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
585 | | Configure vhost interfaces | ${dut2}
586 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
587 | | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id1}
588 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
589 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
590 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
591
592 | Initialize L2 Bridge Domain with memif pairs on DUT node
593 | | [Documentation]
594 | | ... | Create pairs of Memif interfaces on DUT node. Put each Memif interface
595 | | ... | to separate L2 bridge domain with one physical or memif interface
596 | | ... | to create a chain accross DUT node.
597 | | ...
598 | | ... | *Arguments:*
599 | | ... | - dut - DUT node. Type: dictionary
600 | | ... | - nf_chain - NF chain. Type: integer
601 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
602 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
603 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
604 | | ...
605 | | ... | *Note:*
606 | | ... | Socket paths for Memif are defined in following format:
607 | | ... | - /tmp/memif-\${dut}_CNF\${nf_id}-\${sid}
608 | | ...
609 | | ... | *Example:*
610 | | ...
611 | | ... | \| Initialize L2 Bridge Domain with memif pairs on DUT node \
612 | | ... | \| ${dut} \| 1 \| 1 \|
613 | | ...
614 | | [Arguments] | ${dut} | ${nf_chain}=${1} | ${nf_nodes}=${1}
615 | | ... | ${auto_scale}=${True}
616 | | ...
617 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
618 | | ... | Set Variable | ${rxq_count_int}
619 | | ... | ELSE | Set Variable | ${1}
620 | | ${bd_id2}= | Evaluate | ${nf_nodes}+1
621 | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1} | ${1}
622 | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if2}
623 | | ... | ${bd_id2}
624 | | :FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes}+1
625 | | | ${nf_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
626 | | | ${sock1}= | Set Variable | memif-${dut}_CNF
627 | | | ${sock2}= | Set Variable | memif-${dut}_CNF
628 | | | Set up memif interfaces on DUT node | ${nodes['${dut}']}
629 | | | ... | ${sock1} | ${sock2} | ${nf_id} | ${dut}-memif-${nf_id}-if1
630 | | | ... | ${dut}-memif-${nf_id}-if2 | ${rxq} | ${rxq}
631 | | | ${bd_id2}= | Evaluate | ${nf_node}+1
632 | | | Add interface to bridge domain | ${nodes['${dut}']}
633 | | | ... | ${${dut}-memif-${nf_id}-if1} | ${nf_node}
634 | | | Add interface to bridge domain | ${nodes['${dut}']}
635 | | | ... | ${${dut}-memif-${nf_id}-if2} | ${bd_id2}
636
637 | Initialize L2 Bridge Domain with memif pairs
638 | | [Documentation]
639 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
640 | | ... | Memif interface to separate L2 bridge domain with one physical or
641 | | ... | virtual interface to create a chain accross DUT node.
642 | | ...
643 | | ... | *Arguments:*
644 | | ... | - nf_chain - NF chain. Type: integer
645 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
646 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
647 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
648 | | ...
649 | | ... | *Example:*
650 | | ...
651 | | ... | \| Initialize L2 Bridge Domain with memif pairs \| 1 \| 1 \|
652 | | ...
653 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
654 | | ...
655 | | :FOR | ${dut} | IN | @{duts}
656 | | | Initialize L2 Bridge Domain with memif pairs on DUT node | ${dut}
657 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
658 | | | ... | auto_scale=${auto_scale}
659
660 | Initialize L2 Bridge Domain for multiple chains with memif pairs
661 | | [Documentation]
662 | | ... | Create pairs of Memif interfaces for defined number of NF chains
663 | | ... | with defined number of NF nodes on all defined VPP nodes. Add each
664 | | ... | Memif interface into L2 bridge domains with learning enabled
665 | | ... | with physical inteface or Memif interface of another NF.
666 | | ...
667 | | ... | *Arguments:*
668 | | ... | - nf_chains - Number of chains of NFs. Type: integer
669 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
670 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
671 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
672 | | ...
673 | | ... | *Example:*
674 | | ...
675 | | ... | \| Initialize L2 Bridge Domain for multiple chains with memif pairs \
676 | | ... | \| 1 \| 1 \|
677 | | ...
678 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
679 | | ...
680 | | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
681 | | | Initialize L2 Bridge Domain with memif pairs | nf_chain=${nf_chain}
682 | | | ... | nf_nodes=${nf_nodes} | 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
686
687 | Initialize L2 Bridge Domain for pipeline with memif pairs
688 | | [Documentation]
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 service pipeline on DUT node.
692 | | ...
693 | | ... | *Arguments:*
694 | | ... | - nf_chain - NF pipe. Type: integer
695 | | ... | - nf_nodes - Number of NFs nodes per pipeline. Type: integer
696 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
697 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
698 | | ...
699 | | ... | *Example:*
700 | | ...
701 | | ... | \| Initialize L2 Bridge Domain for pipeline with memif pairs \
702 | | ... | \| 1 \| 1 \|
703 | | ...
704 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
705 | | ...
706 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
707 | | ... | Set Variable | ${rxq_count_int}
708 | | ... | ELSE | Set Variable | ${1}
709 | | :FOR | ${dut} | IN | @{duts}
710 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1} | ${1}
711 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if2} | ${2}
712 | | | ${nf_id_frst}= | Evaluate | (${nf_chain}-${1}) * ${nf_nodes} + ${1}
713 | | | ${nf_id_last}= | Evaluate | (${nf_chain}-${1}) * ${nf_nodes} + ${nf_nodes}
714 | | | ${sid_frst}= | Evaluate | ${nf_id_frst} * ${2} - ${1}
715 | | | ${sid_last}= | Evaluate | ${nf_id_last} * ${2}
716 | | | Set up single memif interface on DUT node | ${nodes['${dut}']}
717 | | | ... | memif-${dut}_CNF | mid=${nf_id_frst} | sid=${sid_frst}
718 | | | ... | memif_if=${dut}-memif-${nf_id_frst}-if1
719 | | | ... | rxq=${rxq} | txq=${rxq}
720 | | | Set up single memif interface on DUT node | ${nodes['${dut}']}
721 | | | ... | memif-${dut}_CNF | mid=${nf_id_last} | sid=${sid_last}
722 | | | ... | memif_if=${dut}-memif-${nf_id_last}-if2
723 | | | ... | rxq=${rxq} | txq=${rxq}
724 | | | Add interface to bridge domain | ${nodes['${dut}']}
725 | | | ... | ${${dut}-memif-${nf_id_frst}-if1} | ${1}
726 | | | Add interface to bridge domain | ${nodes['${dut}']}
727 | | | ... | ${${dut}-memif-${nf_id_last}-if2} | ${2}
728
729 | Initialize L2 Bridge Domain for multiple pipelines with memif pairs
730 | | [Documentation]
731 | | ... | Create pairs of Memif interfaces for defined number of NF pipelines
732 | | ... | with defined number of NF nodes on all defined VPP nodes. Add each
733 | | ... | Memif interface into L2 bridge domains with learning enabled
734 | | ... | with physical inteface or Memif interface of another NF.
735 | | ...
736 | | ... | *Arguments:*
737 | | ... | - nf_chains - Number of pipelines of NFs. Type: integer
738 | | ... | - nf_nodes - Number of NFs nodes per pipeline. Type: integer
739 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
740 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
741 | | ...
742 | | ... | *Example:*
743 | | ...
744 | | ... | \| Initialize L2 Bridge Domain for multiple pipelines with memif \
745 | | ... | pairs \| 1 \| 1 \|
746 | | ...
747 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
748 | | ...
749 | | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
750 | | | Initialize L2 Bridge Domain for pipeline with memif pairs
751 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
752 | | | ... | auto_scale=${auto_scale}
753 | | Set interfaces in path up
754 | | Show Memif on all DUTs | ${nodes}
755 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
756
757 | Initialize L2 Bridge Domain with memif pairs and VLAN in circular topology
758 | | [Documentation]
759 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
760 | | ... | Memif interface to separate L2 bridge domain with one physical or
761 | | ... | virtual interface to create a chain accross DUT node. In case of
762 | | ... | 3-node topology create VLAN sub-interfaces between DUTs. In case of
763 | | ... | 2-node topology create VLAN sub-interface on dut1-if2 interface. All
764 | | ... | interfaces are brought up.
765 | | ...
766 | | ... | *Arguments:*
767 | | ... | - bd_id1 - Bridge domain ID. Type: integer
768 | | ... | - bd_id2 - Bridge domain ID. Type: integer
769 | | ... | - subid - ID of the sub-interface to be created. Type: string
770 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
771 | | ...
772 | | ... | *Example:*
773 | | ...
774 | | ... | \| Initialize L2 Bridge Domain with memif pairs and VLAN in circular\
775 | | ... | topology \| 1 \| 2 \| 10 \| pop-1 \|
776 | | ...
777 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
778 | | ...
779 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
780 | | ... | Variable Should Exist | ${dut2}
781 | | ...
782 | | Set interfaces in path up
783 | | ...
784 | | Run Keyword If | '${dut2_status}' == 'PASS'
785 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
786 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
787 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
788 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
789 | | Run Keyword If | '${dut2_status}' == 'PASS'
790 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
791 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
792 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
793 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
794 | | ...
795 | | ${number}= | Set Variable | ${1}
796 | | ${sock1}= | Set Variable | memif-DUT1_CNF
797 | | ${sock2}= | Set Variable | memif-DUT1_CNF
798 | | ${memif_if1_name}= | Set Variable | DUT1-memif-${number}-if1
799 | | ${memif_if2_name}= | Set Variable | DUT1-memif-${number}-if2
800 | | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock2}
801 | | ... | ${number} | ${memif_if1_name} | ${memif_if2_name} | ${rxq_count_int}
802 | | ... | ${rxq_count_int}
803 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
804 | | Add interface to bridge domain | ${dut1} | ${${memif_if1_name}} | ${bd_id1}
805 | | Add interface to bridge domain | ${dut1} | ${${memif_if2_name}} | ${bd_id2}
806 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
807 | | ${sock1}= | Run Keyword If | '${dut2_status}' == 'PASS'
808 | | ... | Set Variable | memif-DUT2_CNF
809 | | ${sock2}= | Run Keyword If | '${dut2_status}' == 'PASS'
810 | | ... | Set Variable | memif-DUT2_CNF
811 | | ${memif_if1_name}= | Run Keyword If | '${dut2_status}' == 'PASS'
812 | | ... | Set Variable | DUT2-memif-${number}-if1
813 | | ${memif_if2_name}= | Run Keyword If | '${dut2_status}' == 'PASS'
814 | | ... | Set Variable | DUT2-memif-${number}-if2
815 | | Run Keyword If | '${dut2_status}' == 'PASS'
816 | | ... | Set up memif interfaces on DUT node | ${dut2} | ${sock1} | ${sock2}
817 | | ... | ${number} | ${memif_if1_name} | ${memif_if2_name} | ${rxq_count_int}
818 | | ... | ${rxq_count_int}
819 | | Run Keyword If | '${dut2_status}' == 'PASS'
820 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
821 | | ... | ${bd_id1}
822 | | Run Keyword If | '${dut2_status}' == 'PASS'
823 | | ... | Add interface to bridge domain | ${dut2} | ${${memif_if1_name}}
824 | | ... | ${bd_id1}
825 | | Run Keyword If | '${dut2_status}' == 'PASS'
826 | | ... | Add interface to bridge domain | ${dut2} | ${${memif_if2_name}}
827 | | ... | ${bd_id2}
828 | | Run Keyword If | '${dut2_status}' == 'PASS'
829 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
830 | | ...
831 | | Show Memif on all DUTs | ${nodes}
832 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
833
834 | Initialize L2 Bridge Domain for single memif
835 | | [Documentation]
836 | | ... | Create single Memif interface on all defined VPP nodes. Put Memif
837 | | ... | interface to separate L2 bridge domain with one physical interface.
838 | | ...
839 | | ... | *Arguments:*
840 | | ... | - number - Memif ID. Type: integer
841 | | ...
842 | | ... | *Note:*
843 | | ... | Socket paths for Memif are defined in following format:
844 | | ... | - /tmp/memif-DUT1_CNF\${number}-\${sid}
845 | | ...
846 | | ... | KW uses test variable ${rxq_count_int} set by KW Add worker threads
847 | | ... | and rxqueues to all DUTs
848 | | ...
849 | | ... | *Example:*
850 | | ...
851 | | ... | \| Initialize L2 Bridge Domain for single memif \| 1 \|
852 | | ...
853 | | [Arguments] | ${number}=${1}
854 | | ...
855 | | :FOR | ${dut} | IN | @{duts}
856 | | | ${sock}= | Set Variable | memif-${dut}_CNF
857 | | | ${sid}= | Evaluate | (${number} * ${2}) - ${1}
858 | | | Set up single memif interface on DUT node | ${nodes['${dut}']} | ${sock}
859 | | | ... | mid=${number} | sid=${sid} | memif_if=${dut}-memif-${number}-if1
860 | | | ... | rxq=${rxq_count_int} | txq=${rxq_count_int}
861 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1}
862 | | | ... | ${number}
863 | | | Add interface to bridge domain | ${nodes['${dut}']}
864 | | | ... | ${${dut}-memif-${number}-if1} | ${number}
865 | | Set single interfaces in path up
866 | | Show Memif on all DUTs | ${nodes}
867
868 | Initialize L2 bridge domain with MACIP ACLs on DUT1 in 3-node circular topology
869 | | [Documentation]
870 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
871 | | ... | domain that is created automatically with index 1. Learning is
872 | | ... | enabled. Interfaces are brought up. Apply required MACIP ACL rules to
873 | | ... | DUT1 interfaces.
874 | | ...
875 | | Set interfaces in path up
876 | | VPP Add L2 Bridge Domain | ${dut1} | ${1} | ${dut1_if1} | ${dut1_if2}
877 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
878 | | Configure MACIP ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
879
880 | Initialize L2 bridge domain with IPv4 ACLs on DUT1 in 3-node circular topology
881 | | [Documentation]
882 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
883 | | ... | domain that is created automatically with index 1. Learning is
884 | | ... | enabled. Interfaces are brought up. Apply required ACL rules to DUT1
885 | | ... | interfaces.
886 | | ...
887 | | Set interfaces in path up
888 | | VPP Add L2 Bridge Domain | ${dut1} | ${1} | ${dut1_if1} | ${dut1_if2}
889 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
890 | | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}