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