Refactor VHOST code
[csit.git] / resources / libraries / robot / performance / performance_configuration.robot
1 # Copyright (c) 2018 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 | Collections
16 | Library | String
17 | Library | resources.libraries.python.topology.Topology
18 | Library | resources.libraries.python.NodePath
19 | Library | resources.libraries.python.DpdkUtil
20 | Library | resources.libraries.python.InterfaceUtil
21 | Library | resources.libraries.python.VhostUser
22 | Library | resources.libraries.python.TrafficGenerator
23 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
24 | Library | resources.libraries.python.Classify
25 | Library | resources.libraries.python.IPUtil
26 | Library | resources.libraries.python.L2Util
27 | Resource | resources/libraries/robot/shared/default.robot
28 | Resource | resources/libraries/robot/shared/interfaces.robot
29 | Resource | resources/libraries/robot/shared/counters.robot
30 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
31 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
32 | Resource | resources/libraries/robot/l2/l2_patch.robot
33 | Resource | resources/libraries/robot/ip/ip4.robot
34 | Resource | resources/libraries/robot/ip/ip6.robot
35 | Resource | resources/libraries/robot/vm/qemu.robot
36 | Resource | resources/libraries/robot/l2/tagging.robot
37 | Resource | resources/libraries/robot/overlay/srv6.robot
38 | Documentation | Performance suite keywords - configuration.
39
40 *** Keywords ***
41 | Set interfaces in path up
42 | | [Documentation]
43 | | ... | *Set UP state on VPP interfaces in path on all DUT nodes and set
44 | | ... | maximal MTU.*
45 | | ...
46 # TODO: Rework KW to set all interfaces in path UP and set MTU (including
47 # software interfaces. Run KW at the start phase of VPP setup to split
48 # from other "functial" configuration. This will allow modularity of this
49 # library
50 | | ${duts}= | Get Matches | ${nodes} | DUT*
51 | | :FOR | ${dut} | IN | @{duts}
52 | | | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1} | up
53 | | | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2} | up
54 | | All VPP Interfaces Ready Wait | ${nodes}
55 | | ${duts}= | Get Matches | ${nodes} | DUT*
56 | | :FOR | ${dut} | IN | @{duts}
57 | | | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1}
58 | | | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2}
59 | | All VPP Interfaces Ready Wait | ${nodes}
60
61 | Initialize IPSec in 3-node circular topology
62 | | [Documentation]
63 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
64 | | ... | topology. Get the interface MAC addresses and setup ARP on all VPP
65 | | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG and
66 | | ... | DUT1-DUT2 links. Set routing for encrypted traffic on both DUT nodes
67 | | ... | with prefix /8 and next hop of neighbour DUT or TG interface IPv4
68 | | ... | address.
69 | | ...
70 | | Set interfaces in path up
71 | | VPP Show Crypto Device Mapping | ${dut1}
72 | | VPP Show Crypto Device Mapping | ${dut2}
73 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
74 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
75 | | ${dut1_if1_mac}= | Get Interface MAC | ${dut1} | ${dut1_if1}
76 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
77 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
78 | | ${dut2_if2_mac}= | Get Interface MAC | ${dut2} | ${dut2_if2}
79 | | Set Test Variable | ${tg_if1_mac}
80 | | Set Test Variable | ${tg_if2_mac}
81 | | Set Test Variable | ${dut1_if1_mac}
82 | | Set Test Variable | ${dut1_if2_mac}
83 | | Set Test Variable | ${dut2_if1_mac}
84 | | Set Test Variable | ${dut2_if2_mac}
85 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
86 | | ... | ${dut1_if1_ip4} | 24
87 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
88 | | ... | ${dut1_if2_ip4} | 24
89 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
90 | | ... | ${dut2_if1_ip4} | 24
91 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2}
92 | | ... | ${dut2_if2_ip4} | 24
93 | | Add arp on dut | ${dut1} | ${dut1_if1} | ${tg_if1_ip4} | ${tg_if1_mac}
94 | | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_if1_ip4} | ${dut2_if1_mac}
95 | | Add arp on dut | ${dut2} | ${dut2_if2} | ${tg_if2_ip4} | ${tg_if2_mac}
96 | | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_if2_ip4} | ${dut1_if2_mac}
97 | | Vpp Route Add | ${dut1} | ${laddr_ip4} | 8 | ${tg_if1_ip4} | ${dut1_if1}
98 | | Vpp Route Add | ${dut2} | ${raddr_ip4} | 8 | ${tg_if2_ip4} | ${dut2_if2}
99
100 | Initialize IPv4 forwarding in 2-node circular topology
101 | | [Documentation]
102 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node circular
103 | | ... | topology. Get the interface MAC addresses and setup ARP on all VPP
104 | | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG links and
105 | | ... | /30 prefix on DUT1 link.
106 | | ...
107 | | Set interfaces in path up
108 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
109 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
110 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
111 | | Add arp on dut | ${dut1} | ${dut1_if2} | 20.20.20.2 | ${tg1_if2_mac}
112 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
113 | | ... | 10.10.10.1 | 24
114 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
115 | | ... | 20.20.20.1 | 24
116
117 | Initialize IPv4 forwarding in 3-node circular topology
118 | | [Documentation]
119 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
120 | | ... | topology. Get the interface MAC addresses and setup ARP on all VPP
121 | | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG links and
122 | | ... | /30 prefix on DUT1-DUT2 link. Set routing on both DUT nodes with
123 | | ... | prefix /24 and next hop of neighbour DUT interface IPv4 address.
124 | | ...
125 | | Set interfaces in path up
126 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
127 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
128 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
129 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
130 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
131 | | Add arp on dut | ${dut1} | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
132 | | Add arp on dut | ${dut2} | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
133 | | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
134 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
135 | | ... | 10.10.10.1 | 24
136 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
137 | | ... | 1.1.1.1 | 30
138 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
139 | | ... | 1.1.1.2 | 30
140 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2}
141 | | ... | 20.20.20.1 | 24
142 | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 1.1.1.2 | ${dut1_if2}
143 | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | 1.1.1.1 | ${dut2_if1}
144
145 | Initialize IPv4 forwarding with scaling in 3-node circular topology
146 | | [Documentation]
147 | | ... | Custom setup of IPv4 topology with scalability of ip routes on all
148 | | ... | DUT nodes in 3-node circular topology
149 | | ...
150 | | ... | *Arguments:*
151 | | ... | - ${count} - IP route count. Type: integer
152 | | ...
153 | | ... | *Return:*
154 | | ... | - No value returned
155 | | ...
156 | | ... | *Example:*
157 | | ...
158 | | ... | \| Initialize IPv4 forwarding with scaling in 3-node circular \
159 | | ... | topology \| 100000 \|
160 | | ...
161 | | [Arguments] | ${count}
162 | | ...
163 | | Set interfaces in path up
164 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
165 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
166 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
167 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
168 | | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac}
169 | | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac}
170 | | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac}
171 | | Add arp on dut | ${dut2} | ${dut2_if2} | 3.3.3.1 | ${tg1_if2_mac}
172 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30
173 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30
174 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2 | 30
175 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 3.3.3.2 | 30
176 | | Vpp Route Add | ${dut1} | 10.0.0.0 | 32 | 1.1.1.1 | ${dut1_if1}
177 | | ... | count=${count}
178 | | Vpp Route Add | ${dut1} | 20.0.0.0 | 32 | 2.2.2.2 | ${dut1_if2}
179 | | ... | count=${count}
180 | | Vpp Route Add | ${dut2} | 10.0.0.0 | 32 | 2.2.2.1 | ${dut2_if1}
181 | | ... | count=${count}
182 | | Vpp Route Add | ${dut2} | 20.0.0.0 | 32 | 3.3.3.1 | ${dut2_if2}
183 | | ... | count=${count}
184
185 | Initialize IPv4 forwarding with vhost in 2-node circular topology
186 | | [Documentation]
187 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
188 | | ... | VPP node. Set UP state of all VPP interfaces in path. Create
189 | | ... | ${vm_count}+1 FIB tables on DUT with multipath routing. Assign each
190 | | ... | Virtual interface to FIB table with Physical interface or Virtual
191 | | ... | interface on both nodes. Setup IPv4 addresses with /30 prefix on
192 | | ... | DUT-TG links. Set routing on DUT nodes in all FIB tables with prefix
193 | | ... | /24 and next hop of neighbour IPv4 address. Setup ARP on all VPP
194 | | ... | interfaces.
195 | | ...
196 | | ... | *Arguments:*
197 | | ... | - vm_count - Number of guest VMs. Type: integer
198 | | ...
199 | | ... | *Note:*
200 | | ... | Socket paths for VM are defined in following format:
201 | | ... | - /tmp/sock-${VM_ID}-1
202 | | ... | - /tmp/sock-${VM_ID}-2
203 | | ...
204 | | ... | *Example:*
205 | | ...
206 | | ... | \| IPv4 forwarding with Vhost-User initialized in a 2-node circular\
207 | | ... | topology \| 1 \|
208 | | ...
209 | | [Arguments] | ${vm_count}=${1}
210 | | ...
211 | | Set interfaces in path up
212 | | ${fib_table_1}= | Set Variable | ${101}
213 | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${vm_count}
214 | | Add Fib Table | ${dut1} | ${fib_table_1}
215 | | And Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | vrf=${fib_table_1}
216 | | ... | gateway=1.1.1.2 | interface=${dut1_if1} | multipath=${TRUE}
217 | | Add Fib Table | ${dut1} | ${fib_table_2}
218 | | And Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | vrf=${fib_table_2}
219 | | ... | gateway=2.2.2.2 | interface=${dut1_if2} | multipath=${TRUE}
220 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if1} | ${fib_table_1}
221 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if2} | ${fib_table_2}
222 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30
223 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30
224 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
225 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
226 | | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac}
227 | | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac}
228 | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | 1.1.1.1 | ${dut1_if1}
229 | | ... | vrf=${fib_table_1}
230 | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 2.2.2.2 | ${dut1_if2}
231 | | ... | vrf=${fib_table_2}
232 | | ${ip_base_start}= | Set Variable | ${4}
233 | | :FOR | ${number} | IN RANGE | 1 | ${vm_count}+1
234 | | | ${sock1}= | Set Variable | /tmp/sock-${number}-1
235 | | | ${sock2}= | Set Variable | /tmp/sock-${number}-2
236 | | | ${fib_table_1}= | Evaluate | ${100}+${number}
237 | | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${1}
238 | | | ${ip_base_vif1}= | Evaluate | ${ip_base_start}+(${number}-1)*2
239 | | | ${ip_base_vif2}= | Evaluate | ${ip_base_vif1}+1
240 | | | ${ip_net_vif1}= | Set Variable
241 | | | ... | ${ip_base_vif1}.${ip_base_vif1}.${ip_base_vif1}
242 | | | ${ip_net_vif2}= | Set Variable
243 | | | ... | ${ip_base_vif2}.${ip_base_vif2}.${ip_base_vif2}
244 | | | Configure vhost interfaces for L2BD forwarding | ${dut1}
245 | | | ... | ${sock1} | ${sock2} | dut1-vhost-${number}-if1
246 | | | ... | dut1-vhost-${number}-if2
247 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if1} | up
248 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if2} | up
249 | | | Add Fib Table | ${dut1} | ${fib_table_1}
250 | | | And Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | vrf=${fib_table_1}
251 | | | ... | gateway=${ip_net_vif1}.1 | interface=${dut1-vhost-${number}-if1}
252 | | | ... | multipath=${TRUE}
253 | | | Add Fib Table | ${dut1} | ${fib_table_2}
254 | | | And Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | vrf=${fib_table_2}
255 | | | ... | gateway=${ip_net_vif2}.2 | interface=${dut1-vhost-${number}-if2}
256 | | | ... | multipath=${TRUE}
257 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if1}
258 | | | ... | ${fib_table_1}
259 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if2}
260 | | | ... | ${fib_table_2}
261 | | | Configure IP addresses on interfaces
262 | | | ... | ${dut1} | ${dut1-vhost-${number}-if1} | ${ip_net_vif1}.1 | 30
263 | | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | ${ip_net_vif2}.1 | 30
264 | | | ${dut1_vif1_idx}= | Get Interface SW Index | ${dut1}
265 | | | ... | ${dut1-vhost-${number}-if1}
266 | | | ${dut1_vif2_idx}= | Get Interface SW Index | ${dut1}
267 | | | ... | ${dut1-vhost-${number}-if2}
268 | | | ${dut1_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut1}
269 | | | ... | ${dut1_vif1_idx}
270 | | | ${dut1_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut1}
271 | | | ... | ${dut1_vif2_idx}
272 | | | Set Test Variable | ${dut1-vhost-${number}-if1_mac}
273 | | | ... | ${dut1_vif1_mac}
274 | | | Set Test Variable | ${dut1-vhost-${number}-if2_mac}
275 | | | ... | ${dut1_vif2_mac}
276 | | | ${qemu_id}= | Set Variable If | ${number} < 10 | 0${number}
277 | | | ... | ${number}
278 | | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if1}
279 | | | ... | ${ip_net_vif1}.2 | 52:54:00:00:${qemu_id}:01
280 | | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if2}
281 | | | ... | ${ip_net_vif2}.2 | 52:54:00:00:${qemu_id}:02
282 | | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | ${ip_net_vif1}.2
283 | | | ... | ${dut1-vhost-${number}-if1} | vrf=${fib_table_1}
284 | | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | ${ip_net_vif2}.2
285 | | | ... | ${dut1-vhost-${number}-if2} | vrf=${fib_table_2}
286
287 | Initialize IPv4 forwarding with vhost in 3-node circular topology
288 | | [Documentation]
289 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on all
290 | | ... | VPP nodes. Set UP state of all VPP interfaces in path. Create
291 | | ... | ${vm_count}+1 FIB tables on each DUT with multipath routing. Assign
292 | | ... | each Virtual interface to FIB table with Physical interface or Virtual
293 | | ... | interface on both nodes. Setup IPv4 addresses with /30 prefix on
294 | | ... | DUT-TG links and /30 prefix on DUT1-DUT2 link. Set routing on all DUT
295 | | ... | nodes in all FIB tables with prefix /24 and next hop of neighbour IPv4
296 | | ... | address. Setup ARP on all VPP interfaces.
297 | | ...
298 | | ... | *Arguments:*
299 | | ... | - vm_count - Number of guest VMs. Type: integer
300 | | ...
301 | | ... | *Note:*
302 | | ... | Socket paths for VM are defined in following format:
303 | | ... | - /tmp/sock-${VM_ID}-1
304 | | ... | - /tmp/sock-${VM_ID}-2
305 | | ...
306 | | ... | *Example:*
307 | | ...
308 | | ... | \| IPv4 forwarding with Vhost-User initialized in a 3-node circular\
309 | | ... | topology \| 1 \|
310 | | ...
311 | | [Arguments] | ${vm_count}=${1}
312 | | ...
313 | | Set interfaces in path up
314 | | ${fib_table_1}= | Set Variable | ${101}
315 | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${vm_count}
316 | | Add Fib Table | ${dut1} | ${fib_table_1}
317 | | And Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | vrf=${fib_table_1}
318 | | ... | gateway=1.1.1.2 | interface=${dut1_if1} | multipath=${TRUE}
319 | | Add Fib Table | ${dut1} | ${fib_table_2}
320 | | And Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | vrf=${fib_table_2}
321 | | ... | gateway=2.2.2.2 | interface=${dut1_if2} | multipath=${TRUE}
322 | | Add Fib Table | ${dut2} | ${fib_table_1}
323 | | And Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | vrf=${fib_table_1}
324 | | ... | gateway=2.2.2.1 | interface=${dut2_if1} | multipath=${TRUE}
325 | | Add Fib Table | ${dut2} | ${fib_table_2}
326 | | And Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | vrf=${fib_table_2}
327 | | ... | gateway=3.3.3.2 | interface=${dut2_if2} | multipath=${TRUE}
328 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if1} | ${fib_table_1}
329 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if2} | ${fib_table_2}
330 | | Assign Interface To Fib Table | ${dut2} | ${dut2_if1} | ${fib_table_1}
331 | | Assign Interface To Fib Table | ${dut2} | ${dut2_if2} | ${fib_table_2}
332 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30
333 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30
334 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2 | 30
335 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 3.3.3.1 | 30
336 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
337 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
338 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
339 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
340 | | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac}
341 | | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac}
342 | | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac}
343 | | Add arp on dut | ${dut2} | ${dut2_if2} | 3.3.3.2 | ${tg1_if2_mac}
344 | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | 1.1.1.1 | ${dut1_if1}
345 | | ... | vrf=${fib_table_1}
346 | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 2.2.2.2 | ${dut1_if2}
347 | | ... | vrf=${fib_table_2}
348 | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | 2.2.2.1 | ${dut2_if1}
349 | | ... | vrf=${fib_table_1}
350 | | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | 3.3.3.2 | ${dut2_if2}
351 | | ... | vrf=${fib_table_2}
352 | | ${ip_base_start}= | Set Variable | ${4}
353 | | :FOR | ${number} | IN RANGE | 1 | ${vm_count}+1
354 | | | ${sock1}= | Set Variable | /tmp/sock-${number}-1
355 | | | ${sock2}= | Set Variable | /tmp/sock-${number}-2
356 | | | ${fib_table_1}= | Evaluate | ${100}+${number}
357 | | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${1}
358 | | | ${ip_base_vif1}= | Evaluate | ${ip_base_start}+(${number}-1)*2
359 | | | ${ip_base_vif2}= | Evaluate | ${ip_base_vif1}+1
360 | | | ${ip_net_vif1}= | Set Variable
361 | | | ... | ${ip_base_vif1}.${ip_base_vif1}.${ip_base_vif1}
362 | | | ${ip_net_vif2}= | Set Variable
363 | | | ... | ${ip_base_vif2}.${ip_base_vif2}.${ip_base_vif2}
364 | | | Configure vhost interfaces for L2BD forwarding | ${dut1}
365 | | | ... | ${sock1} | ${sock2} | dut1-vhost-${number}-if1
366 | | | ... | dut1-vhost-${number}-if2
367 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if1} | up
368 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if2} | up
369 | | | Configure vhost interfaces for L2BD forwarding | ${dut2}
370 | | | ... | ${sock1} | ${sock2} | dut2-vhost-${number}-if1
371 | | | ... | dut2-vhost-${number}-if2
372 | | | Set Interface State | ${dut2} | ${dut2-vhost-${number}-if1} | up
373 | | | Set Interface State | ${dut2} | ${dut2-vhost-${number}-if2} | up
374 | | | Add Fib Table | ${dut1} | ${fib_table_1}
375 | | | And Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | vrf=${fib_table_1}
376 | | | ... | gateway=${ip_net_vif1}.1 | interface=${dut1-vhost-${number}-if1}
377 | | | ... | multipath=${TRUE}
378 | | | Add Fib Table | ${dut1} | ${fib_table_2}
379 | | | And Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | vrf=${fib_table_2}
380 | | | ... | gateway=${ip_net_vif2}.2 | interface=${dut1-vhost-${number}-if2}
381 | | | ... | multipath=${TRUE}
382 | | | Add Fib Table | ${dut2} | ${fib_table_1}
383 | | | And Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | vrf=${fib_table_1}
384 | | | ... | gateway=${ip_net_vif1}.1 | interface=${dut2-vhost-${number}-if1}
385 | | | ... | multipath=${TRUE}
386 | | | Add Fib Table | ${dut2} | ${fib_table_2}
387 | | | And Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | vrf=${fib_table_2}
388 | | | ... | gateway=${ip_net_vif2}.2 | interface=${dut2-vhost-${number}-if2}
389 | | | ... | multipath=${TRUE}
390 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if1}
391 | | | ... | ${fib_table_1}
392 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if2}
393 | | | ... | ${fib_table_2}
394 | | | Assign Interface To Fib Table | ${dut2} | ${dut2-vhost-${number}-if1}
395 | | | ... | ${fib_table_1}
396 | | | Assign Interface To Fib Table | ${dut2} | ${dut2-vhost-${number}-if2}
397 | | | ... | ${fib_table_2}
398 | | | Configure IP addresses on interfaces
399 | | | ... | ${dut1} | ${dut1-vhost-${number}-if1} | ${ip_net_vif1}.1 | 30
400 | | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | ${ip_net_vif2}.1 | 30
401 | | | ... | ${dut2} | ${dut2-vhost-${number}-if1} | ${ip_net_vif1}.1 | 30
402 | | | ... | ${dut2} | ${dut2-vhost-${number}-if2} | ${ip_net_vif2}.1 | 30
403 | | | ${dut1_vif1_idx}= | Get Interface SW Index | ${dut1}
404 | | | ... | ${dut1-vhost-${number}-if1}
405 | | | ${dut1_vif2_idx}= | Get Interface SW Index | ${dut1}
406 | | | ... | ${dut1-vhost-${number}-if2}
407 | | | ${dut2_vif1_idx}= | Get Interface SW Index | ${dut2}
408 | | | ... | ${dut2-vhost-${number}-if1}
409 | | | ${dut2_vif2_idx}= | Get Interface SW Index | ${dut2}
410 | | | ... | ${dut2-vhost-${number}-if2}
411 | | | ${dut1_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut1}
412 | | | ... | ${dut1_vif1_idx}
413 | | | ${dut1_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut1}
414 | | | ... | ${dut1_vif2_idx}
415 | | | ${dut2_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut2}
416 | | | ... | ${dut2_vif1_idx}
417 | | | ${dut2_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut2}
418 | | | ... | ${dut2_vif2_idx}
419 | | | Set Test Variable | ${dut1-vhost-${number}-if1_mac}
420 | | | ... | ${dut1_vif1_mac}
421 | | | Set Test Variable | ${dut1-vhost-${number}-if2_mac}
422 | | | ... | ${dut1_vif2_mac}
423 | | | Set Test Variable | ${dut2-vhost-${number}-if1_mac}
424 | | | ... | ${dut2_vif1_mac}
425 | | | Set Test Variable | ${dut2-vhost-${number}-if2_mac}
426 | | | ... | ${dut2_vif2_mac}
427 | | | ${qemu_id}= | Set Variable If | ${number} < 10 | 0${number}
428 | | | ... | ${number}
429 | | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if1}
430 | | | ... | ${ip_net_vif1}.2 | 52:54:00:00:${qemu_id}:01
431 | | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if2}
432 | | | ... | ${ip_net_vif2}.2 | 52:54:00:00:${qemu_id}:02
433 | | | Add arp on dut | ${dut2} | ${dut2-vhost-${number}-if1}
434 | | | ... | ${ip_net_vif1}.2 | 52:54:00:00:${qemu_id}:01
435 | | | Add arp on dut | ${dut2} | ${dut2-vhost-${number}-if2}
436 | | | ... | ${ip_net_vif2}.2 | 52:54:00:00:${qemu_id}:02
437 | | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | ${ip_net_vif1}.2
438 | | | ... | ${dut1-vhost-${number}-if1} | vrf=${fib_table_1}
439 | | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | ${ip_net_vif2}.2
440 | | | ... | ${dut1-vhost-${number}-if2} | vrf=${fib_table_2}
441 | | | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | ${ip_net_vif1}.2
442 | | | ... | ${dut2-vhost-${number}-if1} | vrf=${fib_table_1}
443 | | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | ${ip_net_vif2}.2
444 | | | ... | ${dut2-vhost-${number}-if2} | vrf=${fib_table_2}
445
446 | Initialize IPv4 policer 2r3c-${t} in 3-node circular topology
447 | | [Documentation]
448 | | ... | Setup of 2r3c color-aware or color-blind policer with dst ip match
449 | | ... | on all DUT nodes in 3-node circular topology. Policer is applied on
450 | | ... | links TG - DUT1 and DUT2 - TG.
451 | | ...
452 | | ${dscp}= | DSCP AF22
453 | | Policer Set Name | policer1
454 | | Policer Set CIR | ${cir}
455 | | Policer Set EIR | ${eir}
456 | | Policer Set CB | ${cb}
457 | | Policer Set EB | ${eb}
458 | | Policer Set Rate Type pps
459 | | Policer Set Round Type Closest
460 | | Policer Set Type 2R3C 2698
461 | | Policer Set Conform Action Transmit
462 | | Policer Set Exceed Action Mark and Transmit | ${dscp}
463 | | Policer Set Violate Action Transmit
464 | | Policer Enable Color Aware
465 | | Run Keyword If | ${t} == 'ca' | Policer Enable Color Aware
466 | | Policer Classify Set Precolor Exceed
467 | | Policer Set Node | ${dut1}
468 | | Policer Classify Set Interface | ${dut1_if1}
469 | | Policer Classify Set Match IP | 20.20.20.2 | ${False}
470 | | Policer Set Configuration
471 | | Policer Set Node | ${dut2}
472 | | Policer Classify Set Interface | ${dut2_if2}
473 | | Policer Classify Set Match IP | 10.10.10.2 | ${False}
474 | | Policer Set Configuration
475
476 | Initialize IPv6 forwarding in 2-node circular topology
477 | | [Documentation]
478 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node circular
479 | | ... | topology. Get the interface MAC addresses and setup neighbour on all
480 | | ... | VPP interfaces. Setup IPv6 addresses with /128 prefixes on all
481 | | ... | interfaces.
482 | | ...
483 | | Set interfaces in path up
484 | | ${prefix}= | Set Variable | 64
485 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
486 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
487 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:1::1 | ${prefix}
488 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:2::1 | ${prefix}
489 | | Suppress ICMPv6 router advertisement message | ${nodes}
490 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
491 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:2::2 | ${tg1_if2_mac}
492
493 | Initialize IPv6 forwarding in 3-node circular topology
494 | | [Documentation]
495 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
496 | | ... | topology. Get the interface MAC addresses and setup neighbour on all
497 | | ... | VPP interfaces. Setup IPv6 addresses with /128 prefixes on all
498 | | ... | interfaces. Set routing on both DUT nodes with prefix /64 and
499 | | ... | next hop of neighbour DUT interface IPv6 address.
500 | | ...
501 | | Set interfaces in path up
502 | | ${prefix}= | Set Variable | 64
503 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
504 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
505 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
506 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
507 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:1::1 | ${prefix}
508 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:3::1 | ${prefix}
509 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:3::2 | ${prefix}
510 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | 2001:2::1 | ${prefix}
511 | | Suppress ICMPv6 router advertisement message | ${nodes}
512 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
513 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
514 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:3::2 | ${dut2_if1_mac}
515 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:3::1 | ${dut1_if2_mac}
516 | | Vpp Route Add | ${dut1} | 2001:2::0 | ${prefix} | 2001:3::2 | ${dut1_if2}
517 | | Vpp Route Add | ${dut2} | 2001:1::0 | ${prefix} | 2001:3::1 | ${dut2_if1}
518
519 | Initialize IPv6 forwarding with scaling in 3-node circular topology
520 | | [Documentation]
521 | | ... | Custom setup of IPv6 topology with scalability of ip routes on all
522 | | ... | DUT nodes in 3-node circular topology
523 | | ...
524 | | ... | *Arguments:*
525 | | ... | - ${count} - IP route count. Type: integer
526 | | ...
527 | | ... | *Return:*
528 | | ... | - No value returned
529 | | ...
530 | | ... | *Example:*
531 | | ...
532 | | ... | \| Initialize IPv6 forwarding with scaling in 3-node circular \
533 | | ... | topology \| 100000 \|
534 | | ...
535 | | [Arguments] | ${count}
536 | | ...
537 | | Set interfaces in path up
538 | | ${subn_prefix}= | Set Variable | 64
539 | | ${host_prefix}= | Set Variable | 128
540 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:3::1 | ${subn_prefix}
541 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:4::1 | ${subn_prefix}
542 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:4::2 | ${subn_prefix}
543 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | 2001:5::1 | ${subn_prefix}
544 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
545 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
546 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
547 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
548 | | Suppress ICMPv6 router advertisement message | ${nodes}
549 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:3::2 | ${tg1_if1_mac}
550 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:4::2 | ${dut2_if1_mac}
551 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:4::1 | ${dut1_if2_mac}
552 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:5::2 | ${tg1_if2_mac}
553 | | Vpp Route Add | ${dut1} | 2001:2::0 | ${host_prefix} | 2001:4::2
554 | | ... | interface=${dut1_if2} | count=${count}
555 | | Vpp Route Add | ${dut1} | 2001:1::0 | ${host_prefix} | 2001:3::2
556 | | ... | interface=${dut1_if1} | count=${count}
557 | | Vpp Route Add | ${dut2} | 2001:1::0 | ${host_prefix} | 2001:4::1
558 | | ... | interface=${dut2_if1} | count=${count}
559 | | Vpp Route Add | ${dut2} | 2001:2::0 | ${host_prefix} | 2001:5::2
560 | | ... | interface=${dut2_if2} | count=${count}
561
562 | Initialize IPv6 iAcl whitelist in 3-node circular topology
563 | | [Documentation]
564 | | ... | Creates classify L3 table on DUTs. IPv6 iAcl security whitelist
565 | | ... | ingress /64 filter entries applied on links TG - DUT1 and DUT2 - TG.
566 | | ...
567 | | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3
568 | | ... | ${dut1} | ip6 | dst
569 | | And Vpp Configures Classify Session L3
570 | | ... | ${dut1} | permit | ${table_idx} | ${skip_n} | ${match_n}
571 | | ... | ip6 | dst | 2001:2::2
572 | | And Vpp Enable Input Acl Interface
573 | | ... | ${dut1} | ${dut1_if1} | ip6 | ${table_idx}
574 | | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3
575 | | ... | ${dut2} | ip6 | dst
576 | | And Vpp Configures Classify Session L3
577 | | ... | ${dut2} | permit | ${table_idx} | ${skip_n} | ${match_n}
578 | | ... | ip6 | dst | 2001:1::2
579 | | And Vpp Enable Input Acl Interface
580 | | ... | ${dut2} | ${dut2_if2} | ip6 | ${table_idx}
581
582 | Initialize IPv6 forwarding over SRv6 with encapsulation with '${n}' x SID '${prepos}' decapsulation in 3-node circular topology
583 | | [Documentation]
584 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
585 | | ... | topology. Get the interface MAC addresses and setup neighbours on all
586 | | ... | VPP interfaces. Setup IPv6 addresses on all interfaces. Set segment
587 | | ... | routing for IPv6 for required number of SIDs and configure IPv6 routes
588 | | ... | on both DUT nodes.
589 | | ...
590 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
591 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
592 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
593 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
594 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_if1_ip6} | ${prefix}
595 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_if2_ip6} | ${prefix}
596 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_if1_ip6} | ${prefix}
597 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_if2_ip6} | ${prefix}
598 | | Suppress ICMPv6 router advertisement message | ${nodes}
599 | | :FOR | ${number} | IN RANGE | 2 | ${dst_addr_nr}+2
600 | | | ${hexa_nr}= | Convert To Hex | ${number}
601 | | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | ${tg_if1_ip6_subnet}${hexa_nr}
602 | | | ... | ${tg1_if1_mac}
603 | | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | ${tg_if2_ip6_subnet}${hexa_nr}
604 | | | ... | ${tg1_if2_mac}
605 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_if1_ip6} | ${dut2_if1_mac}
606 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_if2_ip6} | ${dut1_if2_mac}
607 | | ${sid1}= | Set Variable If
608 | | ... | "${n}" == "1" | ${dut2_sid1}
609 | | ... | "${n}" == "2" | ${dut2_sid1_1}
610 | | ${sid2}= | Set Variable If
611 | | ... | "${n}" == "1" | ${dut1_sid2}
612 | | ... | "${n}" == "2" | ${dut1_sid2_1}
613 | | Vpp Route Add | ${dut1} | ${sid1} | ${sid_prefix} | ${dut2_if1_ip6}
614 | | ... | ${dut1_if2}
615 | | Vpp Route Add | ${dut2} | ${sid2} | ${sid_prefix} | ${dut1_if2_ip6}
616 | | ... | ${dut2_if1}
617 # Configure SRv6 for direction0
618 | | Set SR Encaps Source Address on DUT | ${dut1} | ${dut1_sid1}
619 | | @{sid_list_dir0}= | Run Keyword If | "${n}" == "1"
620 | | ... | Create List | ${dut2_sid1}
621 | | ... | ELSE IF | "${n}" == "2"
622 | | ... | Create List | ${dut2_sid1_1} | ${dut2_sid1_2}
623 | | Configure SR Policy on DUT | ${dut1} | ${dut1_bsid} | encap
624 | | ... | @{sid_list_dir0}
625 | | Configure SR Steer on DUT | ${dut1} | L3 | ${dut1_bsid}
626 | | ... | ip_addr=${tg_if2_ip6_subnet} | prefix=${sid_prefix}
627 | | Run Keyword If | "${n}" == "1"
628 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.dx6
629 | | ... | interface=${dut2_if2} | next_hop=${tg_if2_ip6_subnet}2
630 | | Run Keyword If | "${n}" == "2"
631 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1_1} | end
632 | | Run Keyword If | "${n}" == "2" and "${prepos}" != "without"
633 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1_2} | end.dx6
634 | | ... | interface=${dut2_if2} | next_hop=${tg_if2_ip6_subnet}2
635 | | Run Keyword If | "${n}" == "2" and "${prepos}" == "without"
636 | | ... | Vpp Route Add | ${dut2} | ${dut2_sid1_2} | ${sid_prefix}
637 | | ... | ${tg_if2_ip6_subnet}2 | ${dut2_if2}
638 # Configure SRv6 for direction1
639 | | Set SR Encaps Source Address on DUT | ${dut2} | ${dut2_sid2}
640 | | @{sid_list_dir1}= | Run Keyword If | "${n}" == "1"
641 | | ... | Create List | ${dut1_sid2}
642 | | ... | ELSE IF | "${n}" == "2"
643 | | ... | Create List | ${dut1_sid2_1} | ${dut1_sid2_2}
644 | | Configure SR Policy on DUT | ${dut2} | ${dut2_bsid} | encap
645 | | ... | @{sid_list_dir1}
646 | | Configure SR Steer on DUT | ${dut2} | L3 | ${dut2_bsid}
647 | | ... | ip_addr=${tg_if1_ip6_subnet} | prefix=${sid_prefix}
648 | | Run Keyword If | "${n}" == "1"
649 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.dx6
650 | | ... | interface=${dut1_if1} | next_hop=${tg_if1_ip6_subnet}2
651 | | Run Keyword If | "${n}" == "2"
652 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2_1} | end
653 | | Run Keyword If | "${n}" == "2" and "${prepos}" != "without"
654 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2_2} | end.dx6
655 | | ... | interface=${dut1_if1} | next_hop=${tg_if1_ip6_subnet}2
656 | | Run Keyword If | "${n}" == "2" and "${prepos}" == "without"
657 | | ... | Vpp Route Add | ${dut1} | ${dut1_sid2_2} | ${sid_prefix}
658 | | ... | ${tg_if1_ip6_subnet}2 | ${dut1_if1}
659 | | Set interfaces in path up
660
661 | Initialize IPv6 forwarding over SRv6 with endpoint to SR-unaware Service Function via '${behavior}' behaviour in 3-node circular topology
662 | | [Documentation]
663 | | ... | Create pair of Memif interfaces on all defined VPP nodes. Set UP
664 | | ... | state on VPP interfaces in path on nodes in 3-node circular topology.
665 | | ... | Get the interface MAC addresses and setup neighbours on all VPP
666 | | ... | interfaces. Setup IPv6 addresses on all interfaces. Set segment
667 | | ... | routing for IPv6 with defined behaviour function and configure IPv6
668 | | ... | routes on both DUT nodes.
669 | | ...
670 | | ... | *Note:*
671 | | ... | KW uses test variable ${rxq_count_int} set by KW Add worker threads
672 | | ... | and rxqueues to all DUTs
673 | | ...
674 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
675 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
676 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
677 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
678 | | ${sock1}= | Set Variable | memif-DUT1_VNF
679 | | ${sock2}= | Set Variable | memif-DUT2_VNF
680 | | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock1}
681 | | ... | ${1} | dut1-memif-1-if1 | dut1-memif-1-if2 | ${rxq_count_int}
682 | | ... | ${rxq_count_int}
683 | | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if1}
684 | | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if2}
685 | | Set up memif interfaces on DUT node | ${dut2} | ${sock2} | ${sock2}
686 | | ... | ${1} | dut2-memif-1-if1 | dut2-memif-1-if2 | ${rxq_count_int}
687 | | ... | ${rxq_count_int}
688 | | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if1}
689 | | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if2}
690 | | ${duts}= | Get Matches | ${nodes} | DUT*
691 | | :FOR | ${dut} | IN | @{duts}
692 | | | Show Memif | ${nodes['${dut}']}
693 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_if1_ip6} | ${prefix}
694 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_if2_ip6} | ${prefix}
695 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1-memif-1-if1}
696 | | ... | ${dut1-memif-1-if1_ip6} | ${prefix}
697 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1-memif-1-if2}
698 | | ... | ${dut1-memif-1-if2_ip6} | ${prefix}
699 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_if1_ip6} | ${prefix}
700 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_if2_ip6} | ${prefix}
701 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2-memif-1-if1}
702 | | ... | ${dut2-memif-1-if1_ip6} | ${prefix}
703 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2-memif-1-if2}
704 | | ... | ${dut2-memif-1-if2_ip6} | ${prefix}
705 | | Suppress ICMPv6 router advertisement message | ${nodes}
706 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_if1_ip6} | ${dut2_if1_mac}
707 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_if2_ip6} | ${dut1_if2_mac}
708 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | ${tg_if1_ip6_subnet}2
709 | | ... | ${tg1_if1_mac}
710 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | ${tg_if2_ip6_subnet}2
711 | | ... | ${tg1_if2_mac}
712 | | ${dut1-memif-1-if2_mac}= | Get Interface MAC | ${dut1} | memif2
713 | | ${dut2-memif-1-if2_mac}= | Get Interface MAC | ${dut2} | memif2
714 | | Add Ip Neighbor | ${dut1} | ${dut1-memif-1-if1} | ${dut1_nh}
715 | | ... | ${dut1-memif-1-if2_mac}
716 | | Add Ip Neighbor | ${dut2} | ${dut2-memif-1-if1} | ${dut2_nh}
717 | | ... | ${dut2-memif-1-if2_mac}
718 | | Vpp Route Add | ${dut1} | ${dut2_sid1} | ${sid_prefix} | ${dut2_if1_ip6}
719 | | ... | ${dut1_if2}
720 | | Vpp Route Add | ${dut1} | ${out_sid2_1} | ${sid_prefix}
721 | | ... | ${tg_if1_ip6_subnet}2 | ${dut1_if1}
722 | | Vpp Route Add | ${dut2} | ${dut1_sid2} | ${sid_prefix} | ${dut1_if2_ip6}
723 | | ... | ${dut2_if1}
724 | | Vpp Route Add | ${dut2} | ${out_sid1_1} | ${sid_prefix}
725 | | ... | ${tg_if2_ip6_subnet}2 | ${dut2_if2}
726 # Configure SRv6 for direction0 on DUT1
727 | | Set SR Encaps Source Address on DUT | ${dut1} | ${dut1_sid1}
728 | | @{sid_list_dir0}= | Create List | ${dut2_sid1} | ${out_sid1_1}
729 | | ... | ${out_sid1_2}
730 | | Configure SR Policy on DUT | ${dut1} | ${dut1_bsid} | encap
731 | | ... | @{sid_list_dir0}
732 | | Configure SR Steer on DUT | ${dut1} | L3 | ${dut1_bsid}
733 | | ... | ip_addr=${tg_if2_ip6_subnet} | prefix=${sid_prefix}
734 # Configure SRv6 for direction1 on DUT2
735 | | Set SR Encaps Source Address on DUT | ${dut2} | ${dut2_sid2}
736 | | @{sid_list_dir1}= | Create List | ${dut1_sid2} | ${out_sid2_1}
737 | | ... | ${out_sid2_2}
738 | | Configure SR Policy on DUT | ${dut2} | ${dut2_bsid} | encap
739 | | ... | @{sid_list_dir1}
740 | | Configure SR Steer on DUT | ${dut2} | L3 | ${dut2_bsid}
741 | | ... | ip_addr=${tg_if1_ip6_subnet} | prefix=${sid_prefix}
742 # Configure SRv6 for direction0 on DUT2
743 | | ${dut2_out_if}= | Get Interface Name | ${dut2} | memif1
744 | | ${dut2_in_if}= | Get Interface Name | ${dut2} | memif2
745 | | Remove Values From List | ${sid_list_dir0} | ${dut2_sid1}
746 | | Run Keyword If | "${behavior}" == "static_proxy"
747 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.as
748 | | ... | ${NONE} | ${dut2_nh} | ${NONE} | ${dut2_out_if} | ${dut2_in_if}
749 | | ... | ${dut1_sid1} | @{sid_list_dir0}
750 | | ... | ELSE IF | "${behavior}" == "dynamic_proxy"
751 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.ad
752 | | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
753 | | ... | ELSE IF | "${behavior}" == "masquerading"
754 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.am
755 | | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
756 | | ... | ELSE | Fail | Unsupported behaviour: ${behavior}
757 # Configure SRv6 for direction1 on DUT1
758 | | ${dut1_out_if}= | Get Interface Name | ${dut1} | memif1
759 | | ${dut1_in_if}= | Get Interface Name | ${dut1} | memif2
760 | | Remove Values From List | ${sid_list_dir1} | ${dut1_sid2}
761 | | Run Keyword If | "${behavior}" == "static_proxy"
762 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.as
763 | | ... | ${NONE} | ${dut1_nh} | ${NONE} | ${dut1_out_if} | ${dut1_in_if}
764 | | ... | ${dut2_sid2} | @{sid_list_dir1}
765 | | ... | ELSE IF | "${behavior}" == "dynamic_proxy"
766 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.ad
767 | | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
768 | | ... | ELSE IF | "${behavior}" == "masquerading"
769 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.am
770 | | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
771 | | ... | ELSE | Fail | Unsupported behaviour: ${behavior}
772 | | Set interfaces in path up
773
774 | Initialize L2 patch
775 | | [Documentation]
776 | | ... | Setup L2 patch topology by cross connecting two interfaces on
777 | | ... | each DUT. Interfaces are brought up.
778 | | ...
779 | | Set interfaces in path up
780 | | ${duts}= | Get Matches | ${nodes} | DUT*
781 | | :FOR | ${dut} | IN | @{duts}
782 | | | Configure L2patch | ${nodes['${dut}']} | ${${dut}_if1} | ${${dut}_if2}
783
784 | Initialize L2 xconnect in 2-node circular topology
785 | | [Documentation]
786 | | ... | Setup L2 xconnect topology by cross connecting two interfaces on
787 | | ... | each DUT. Interfaces are brought up.
788 | | ...
789 | | Set interfaces in path up
790 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1_if2}
791
792 | Initialize L2 xconnect in 3-node circular topology
793 | | [Documentation]
794 | | ... | Setup L2 xconnect topology by cross connecting two interfaces on
795 | | ... | each DUT. Interfaces are brought up.
796 | | ... |
797 | | Set interfaces in path up
798 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1_if2}
799 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
800
801 | Initialize L2 xconnect with VXLANoIPv4 in 3-node circular topology
802 | | [Documentation]
803 | | ... | Setup L2 xconnect topology with VXLANoIPv4 by cross connecting
804 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
805 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
806 | | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as
807 | | ... | interfaces.
808 | | ...
809 | | Set interfaces in path up
810 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1 | 24
811 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2 | 24
812 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
813 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
814 | | Add arp on dut | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac}
815 | | Add arp on dut | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac}
816 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
817 | | ... | 172.16.0.1 | 172.16.0.2
818 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1s_vxlan}
819 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
820 | | ... | 172.16.0.2 | 172.16.0.1
821 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${dut2s_vxlan}
822
823 | Initialize L2 xconnect with Vhost-User on node
824 | | [Documentation]
825 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
826 | | ... | defined VPP node. Add each Vhost-User interface into L2 cross-connect
827 | | ... | with with physical inteface or Vhost-User interface of another VM.
828 | | ...
829 | | ... | *Arguments:*
830 | | ... | - dut - DUT node. Type: string
831 | | ... | - vm_count - VM count. Type: integer
832 | | ...
833 | | ... | *Note:*
834 | | ... | Socket paths for VM are defined in following format:
835 | | ... | - /tmp/sock-${VM_ID}-1
836 | | ... | - /tmp/sock-${VM_ID}-2
837 | | ...
838 | | ... | *Example:*
839 | | ...
840 | | ... | \| Initialize L2 xconnect with Vhost-User on node \| DUT1 \| 1 \|
841 | | ...
842 | | [Arguments] | ${dut} | ${vm_count}=${1}
843 | | ...
844 | | :FOR | ${number} | IN RANGE | 1 | ${vm_count}+1
845 | | | ${sock1}= | Set Variable | /tmp/sock-${number}-1
846 | | | ${sock2}= | Set Variable | /tmp/sock-${number}-2
847 | | | ${prev_index}= | Evaluate | ${number}-1
848 | | | Configure vhost interfaces for L2BD forwarding | ${nodes['${dut}']}
849 | | | ... | ${sock1} | ${sock2} | ${dut}-vhost-${number}-if1
850 | | | ... | ${dut}-vhost-${number}-if2
851 | | | ${dut_xconnect_if1}= | Set Variable If | ${number}==1 | ${${dut}_if1}
852 | | | ... | ${${dut}-vhost-${prev_index}-if2}
853 | | | Configure L2XC | ${nodes['${dut}']} | ${dut_xconnect_if1}
854 | | | ... | ${${dut}-vhost-${number}-if1}
855 | | | Run Keyword If | ${number}==${vm_count} | Configure L2XC
856 | | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${number}-if2} | ${${dut}_if2}
857 | | All VPP Interfaces Ready Wait | ${nodes}
858
859 | Initialize L2 xconnect with Vhost-User
860 | | [Documentation]
861 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
862 | | ... | all VPP nodes. Add each Vhost-User interface into L2 cross-connect
863 | | ... | with with physical inteface or Vhost-User interface of another VM.
864 | | ...
865 | | ... | *Arguments:*
866 | | ... | - vm_count - VM count. Type: integer
867 | | ...
868 | | ... | *Example:*
869 | | ...
870 | | ... | \| Initialize L2 xconnect with Vhost-User \| 1 \|
871 | | ...
872 | | [Arguments] | ${vm_count}=${1}
873 | | ...
874 | | ${duts}= | Get Matches | ${nodes} | DUT*
875 | | :FOR | ${dut} | IN | @{duts}
876 | | | Initialize L2 xconnect with Vhost-User on node | ${dut}
877 | | | ... | vm_count=${vm_count}
878
879 | Initialize L2 xconnect with Vhost-User and VLAN in 3-node circular topology
880 | | [Documentation]
881 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Cross
882 | | ... | connect each Vhost interface with one physical interface.
883 | | ... | Setup VLAN between DUTs. All interfaces are brought up.
884 | | ...
885 | | ... | *Arguments:*
886 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
887 | | ... | - sock2 - Socket path for second Vhost-User interface. Type: string
888 | | ... | - subid - ID of the sub-interface to be created. Type: string
889 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
890 | | ...
891 | | ... | *Example:*
892 | | ...
893 | | ... | \| L2 xconnect with Vhost-User and VLAN initialized in a 3-node\
894 | | ... | circular topology \| /tmp/sock1 \| /tmp/sock2 \| 10 \| pop-1 \|
895 | | ...
896 | | [Arguments] | ${sock1} | ${sock2} | ${subid} | ${tag_rewrite}
897 | | ...
898 | | Set interfaces in path up
899 | | Initialize VLAN dot1q sub-interfaces in 3-node circular topology
900 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
901 | | Configure L2 tag rewrite method on interfaces
902 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
903 | | ... | ${tag_rewrite}
904 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
905 | | ... | ${sock1} | ${sock2}
906 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1}
907 | | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2}
908 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
909 | | ... | ${sock1} | ${sock2}
910 | | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1}
911 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2}
912
913 | Initialize L2 xconnect with Vhost-User and VLAN with DPDK link bonding in 3-node circular topology
914 | | [Documentation]
915 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Setup VLAN
916 | | ... | on BondEthernet interfaces between DUTs. Cross connect one Vhost
917 | | ... | interface with physical interface towards TG and other Vhost interface
918 | | ... | with VLAN sub-interface. All interfaces are brought up.
919 | | ...
920 | | ... | *Arguments:*
921 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
922 | | ... | - sock2 - Socket path for second Vhost-User interface. Type: string
923 | | ... | - subid - ID of the sub-interface to be created. Type: string
924 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
925 | | ...
926 | | ... | *Example:*
927 | | ...
928 | | ... | \| Initialize L2 xconnect with Vhost-User and VLAN with DPDK link\
929 | | ... | bonding in 3-node circular topology \| /tmp/sock1 \| /tmp/sock2 \
930 | | ... | \| 10 \| pop-1 \|
931 | | ...
932 | | [Arguments] | ${sock1} | ${sock2} | ${subid} | ${tag_rewrite}
933 | | ...
934 | | Set interfaces in path up
935 | | Add DPDK bonded ethernet interfaces to topology file in 3-node single link topology
936 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
937 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
938 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
939 | | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1}
940 | | Initialize VLAN dot1q sub-interfaces in 3-node circular topology
941 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
942 | | ... | ${subid}
943 | | Configure L2 tag rewrite method on interfaces
944 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
945 | | ... | ${tag_rewrite}
946 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
947 | | ... | ${sock1} | ${sock2}
948 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1}
949 | | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2}
950 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
951 | | ... | ${sock1} | ${sock2}
952 | | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1}
953 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2}
954 | | All VPP Interfaces Ready Wait | ${nodes}
955
956 | Initialize L2 xconnect with Vhost-User and VLAN with VPP link bonding in 3-node circular topology
957 | | [Documentation]
958 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Create one
959 | | ... | link bonding (BondEthernet) interface on both VPP nodes. Enslave one
960 | | ... | physical interface towards next DUT by BondEthernet interface. Setup
961 | | ... | VLAN on BondEthernet interfaces between DUTs. Cross connect one Vhost
962 | | ... | interface with physical interface towards TG and other Vhost interface
963 | | ... | with VLAN sub-interface. All interfaces are brought up.
964 | | ...
965 | | ... | *Arguments:*
966 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
967 | | ... | - sock2 - Socket path for second Vhost-User interface. Type: string
968 | | ... | - subid - ID of the sub-interface to be created. Type: string
969 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
970 | | ... | - bond_mode - Link bonding mode. Type: string
971 | | ... | - lb_mode - Load balance mode. Type: string
972 | | ...
973 | | ... | *Example:*
974 | | ...
975 | | ... | \| Initialize L2 xconnect with Vhost-User and VLAN with VPP link\
976 | | ... | bonding in 3-node circular topology \| /tmp/sock1 \| /tmp/sock2 \
977 | | ... | \| 10 \| pop-1 \| \| xor \| l34 \|
978 | | ...
979 | | [Arguments] | ${sock1} | ${sock2} | ${subid} | ${tag_rewrite} | ${bond_mode}
980 | | ... | ${lb_mode}
981 | | ...
982 | | Set interfaces in path up
983 | | ${dut1_eth_bond_if1}= | VPP Create Bond Interface | ${dut1} | ${bond_mode}
984 | | ... | ${lb_mode}
985 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
986 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
987 | | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2}
988 | | ... | ${dut1_eth_bond_if1}
989 | | ${dut2_eth_bond_if1}= | VPP Create Bond Interface | ${dut2} | ${bond_mode}
990 | | ... | ${lb_mode}
991 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
992 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
993 | | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1}
994 | | ... | ${dut2_eth_bond_if1}
995 | | VPP Show Bond Data On All Nodes | ${nodes} | details=${TRUE}
996 | | Initialize VLAN dot1q sub-interfaces in 3-node circular topology
997 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
998 | | ... | ${subid}
999 | | Configure L2 tag rewrite method on interfaces
1000 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1001 | | ... | ${tag_rewrite}
1002 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1003 | | ... | ${sock1} | ${sock2}
1004 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1}
1005 | | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2}
1006 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1007 | | ... | ${sock1} | ${sock2}
1008 | | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1}
1009 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2}
1010
1011 | Initialize L2 bridge domain in 2-node circular topology
1012 | | [Documentation]
1013 | | ... | Setup L2 DB topology by adding two interfaces on DUT into BD
1014 | | ... | that is created automatically with index 1. Learning is enabled.
1015 | | ... | Interfaces are brought up.
1016 | | ...
1017 | | ... | *Arguments:*
1018 | | ... | - bd_id - Bridge domain ID. Type: integer
1019 | | ...
1020 | | ... | *Example:*
1021 | | ...
1022 | | ... | \| Initialize L2 bridge domain in 2-node circular topology \| 1 \|
1023 | | ...
1024 | | [Arguments] | ${bd_id}=${1}
1025 | | ...
1026 | | Set interfaces in path up
1027 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id}
1028 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id}
1029
1030 | Initialize L2 bridge domain in 3-node circular topology
1031 | | [Documentation]
1032 | | ... | Setup L2 DB topology by adding two interfaces on each DUT into BD
1033 | | ... | that is created automatically with index 1. Learning is enabled.
1034 | | ... | Interfaces are brought up.
1035 | | ...
1036 | | ... | *Arguments:*
1037 | | ... | - bd_id - Bridge domain ID. Type: integer
1038 | | ...
1039 | | ... | *Example:*
1040 | | ...
1041 | | ... | \| Initialize L2 bridge domain in 3-node circular topology \| 1 \|
1042 | | ...
1043 | | [Arguments] | ${bd_id}=${1}
1044 | | ...
1045 | | Set interfaces in path up
1046 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id}
1047 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id}
1048 | | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${bd_id}
1049 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id}
1050
1051 | Configure IPv4 ACLs
1052 | | [Documentation]
1053 | | ... | Configure ACL with required number of not-hitting permit ACEs plus two
1054 | | ... | hitting ACEs for both traffic directions.
1055 | | ...
1056 | | ... | *Arguments:*
1057 | | ... | - dut_node - DUT node. Type: dictionary
1058 | | ... | - dut_if1 - DUT node interface1 name (Optional). Type: string
1059 | | ... | - dut_if2 - DUT node interface2 name (Optional). Type: string
1060 | | ...
1061 | | ... | *Example:*
1062 | | ...
1063 | | ... | \| Configure IPv4 ACLs \| ${nodes['DUT1']} \| GigabitEthernet0/7/0 \
1064 | | ... | \| GigabitEthernet0/8/0 \|
1065 | | ...
1066 | | ... | _NOTE:_ This KW uses following test case variables:
1067 | | ... | - ${src_ip_start} - Source IP address start. Type: string
1068 | | ... | - ${dst_ip_start} - Destination IP address start. Type: string
1069 | | ... | - ${ip_step} - IP address step. Type: string
1070 | | ... | - ${sport_start} - Source port number start. Type: string
1071 | | ... | - ${dport_start} - Destination port number start. Type: string
1072 | | ... | - ${port_step} - Port number step. Type: string
1073 | | ... | - ${no_hit_aces_number} - Number of not-hitting ACEs to be configured.
1074 | | ... | Type: integer
1075 | | ... | - ${acl_apply_type} - To what path apply the ACL - input or output.
1076 | | ... | Type: string
1077 | | ... | - ${acl_action} - Action for the rule - deny, permit, permit+reflect.
1078 | | ... | Type: string
1079 | | ... | - ${trex_stream1_subnet} - IP subnet used by T-Rex in direction 0->1.
1080 | | ... | Type: string
1081 | | ... | - ${trex_stream2_subnet} - IP subnet used by T-Rex in direction 1->0.
1082 | | ... | Type: string
1083 | | ...
1084 | | [Arguments] | ${dut} | ${dut_if1}=${NONE} | ${dut_if2}=${NONE}
1085 | | ${src_ip_int} = | Evaluate
1086 | | ... | int(ipaddress.ip_address(unicode($src_ip_start))) - $ip_step
1087 | | ... | modules=ipaddress
1088 | | ${dst_ip_int} = | Evaluate
1089 | | ... | int(ipaddress.ip_address(unicode($dst_ip_start))) - $ip_step
1090 | | ... | modules=ipaddress
1091 | | ${ip_limit} = | Set Variable | 255.255.255.255
1092 | | ${ip_limit_int} = | Evaluate
1093 | | ... | int(ipaddress.ip_address(unicode($ip_limit))) | modules=ipaddress
1094 | | ${sport}= | Evaluate | $sport_start - $port_step
1095 | | ${dport}= | Evaluate | $dport_start - $port_step
1096 | | ${port_limit}= | Set Variable | ${65535}
1097 | | ${acl}= | Set Variable | ipv4 permit
1098 | | :FOR | ${nr} | IN RANGE | 0 | ${no_hit_aces_number}
1099 | | | ${src_ip_int} = | Evaluate | $src_ip_int + $ip_step
1100 | | | ${dst_ip_int} = | Evaluate | $dst_ip_int + $ip_step
1101 | | | ${sport}= | Evaluate | $sport + $port_step
1102 | | | ${dport}= | Evaluate | $dport + $port_step
1103 | | | ${ipv4_limit_reached}= | Set Variable If
1104 | | | ... | $src_ip_int > $ip_limit_int or $src_ip_int > $ip_limit_int
1105 | | | ... | ${TRUE}
1106 | | | ${udp_limit_reached}= | Set Variable If
1107 | | | ... | $sport > $port_limit or $dport > $port_limit | ${TRUE}
1108 | | | Run Keyword If | $ipv4_limit_reached is True | Log
1109 | | | ... | Can't do more iterations - IPv4 address limit has been reached.
1110 | | | ... | WARN
1111 | | | Run Keyword If | $udp_limit_reached is True | Log
1112 | | | ... | Can't do more iterations - UDP port limit has been reached.
1113 | | | ... | WARN
1114 | | | ${src_ip} = | Run Keyword If | $ipv4_limit_reached is True
1115 | | | ... | Set Variable | ${ip_limit}
1116 | | | ... | ELSE | Evaluate | str(ipaddress.ip_address($src_ip_int))
1117 | | | ... | modules=ipaddress
1118 | | | ${dst_ip} = | Run Keyword If | $ipv4_limit_reached is True
1119 | | | ... | Set Variable | ${ip_limit}
1120 | | | ... | ELSE | Evaluate | str(ipaddress.ip_address($dst_ip_int))
1121 | | | ... | modules=ipaddress
1122 | | | ${sport}= | Set Variable If | ${sport} > $port_limit | $port_limit
1123 | | | ... | ${sport}
1124 | | | ${dport}= | Set Variable If | ${dport} > $port_limit | $port_limit
1125 | | | ... | ${dport}
1126 | | | ${acl}= | Catenate | ${acl} | src ${src_ip}/32 dst ${dst_ip}/32
1127 | | | ... | sport ${sport} | dport ${dport},
1128 | | | Exit For Loop If
1129 | | | ... | $ipv4_limit_reached is True or $udp_limit_reached is True
1130 | | ${acl}= | Catenate | ${acl}
1131 | | ... | ipv4 ${acl_action} src ${trex_stream1_subnet},
1132 | | ... | ipv4 ${acl_action} src ${trex_stream2_subnet}
1133 | | Add Replace Acl Multi Entries | ${dut} | rules=${acl}
1134 | | @{acl_list}= | Create List | ${0}
1135 | | Run Keyword If | 'input' in $acl_apply_type and $dut_if1 is not None
1136 | | ... | Set Acl List For Interface | ${dut} | ${dut_if1} | input | ${acl_list}
1137 | | Run Keyword If | 'input' in $acl_apply_type and $dut_if2 is not None
1138 | | ... | Set Acl List For Interface | ${dut} | ${dut_if2} | input | ${acl_list}
1139 | | Run Keyword If | 'output' in $acl_apply_type and $dut_if1 is not None
1140 | | ... | Set Acl List For Interface | ${dut} | ${dut_if1} | output
1141 | | ... | ${acl_list}
1142 | | Run Keyword If | 'output' in $acl_apply_type and $dut_if2 is not None
1143 | | ... | Set Acl List For Interface | ${dut} | ${dut_if2} | output
1144 | | ... | ${acl_list}
1145
1146 | Initialize L2 bridge domain with IPv4 ACLs on DUT1 in 3-node circular topology
1147 | | [Documentation]
1148 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
1149 | | ... | domain that is created automatically with index 1. Learning is
1150 | | ... | enabled. Interfaces are brought up. Apply required ACL rules to DUT1
1151 | | ... | interfaces.
1152 | | ...
1153 | | ... | *Arguments:*
1154 | | ... | _None_
1155 | | ...
1156 | | ... | *Example:*
1157 | | ...
1158 | | ... | \| Initialize L2 bridge domain with IPv4 ACLs on DUT1 in 3-node \
1159 | | ... | circular topology \|
1160 | | ...
1161 | | ... | _NOTE:_ This KW uses following test case variables:
1162 | | ... | - ${dut1} - DUT1 node.
1163 | | ... | - ${dut2} - DUT2 node.
1164 | | ... | - ${dut1_if1} - DUT1 interface towards TG.
1165 | | ... | - ${dut1_if2} - DUT1 interface towards DUT2.
1166 | | ... | - ${dut2_if1} - DUT2 interface towards DUT1.
1167 | | ... | - ${dut2_if2} - DUT2 interface towards TG.
1168 | | ...
1169 | | Set interfaces in path up
1170 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1_if2}
1171 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
1172 | | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
1173
1174 | Initialize IPv4 routing for '${ip_nr}' addresses with IPv4 ACLs on DUT1 in 3-node circular topology
1175 | | [Documentation]
1176 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
1177 | | ... | topology. Get the interface MAC addresses and setup ARP on all VPP
1178 | | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG links and
1179 | | ... | /30 prefix on DUT1-DUT2 link. Set routing on both DUT nodes with
1180 | | ... | prefix /24 and next hops of neighbour DUT interface IPv4 address.
1181 | | ... | Apply required ACL rules to DUT1 interfaces.
1182 | | ...
1183 | | ... | *Arguments:*
1184 | | ... | - ip_nr - Number of IPs to be used. Type: integer or string
1185 | | ...
1186 | | ... | *Example:*
1187 | | ...
1188 | | ... | \| Initialize IPv4 routing for '10' addresses with IPv4 ACLs on DUT1 \
1189 | | ... | in 3-node circular topology \|
1190 | | ...
1191 | | ... | _NOTE:_ This KW uses following test case variables:
1192 | | ... | - ${dut1} - DUT1 node.
1193 | | ... | - ${dut2} - DUT2 node.
1194 | | ... | - ${dut1_if1} - DUT1 interface towards TG.
1195 | | ... | - ${dut1_if2} - DUT1 interface towards DUT2.
1196 | | ... | - ${dut2_if1} - DUT2 interface towards DUT1.
1197 | | ... | - ${dut2_if2} - DUT2 interface towards TG.
1198 | | ...
1199 | | Set interfaces in path up
1200 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1201 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1202 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1203 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1204 | | :FOR | ${number} | IN RANGE | 2 | ${ip_nr}+2
1205 | | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.${number}
1206 | | | ... | ${tg1_if1_mac}
1207 | | | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.${number}
1208 | | | ... | ${tg1_if2_mac}
1209 | | Add arp on dut | ${dut1} | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
1210 | | Add arp on dut | ${dut2} | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
1211 | | Configure IP addresses on interfaces
1212 | | ... | ${dut1} | ${dut1_if1} | 10.10.10.1 | 24
1213 | | ... | ${dut1} | ${dut1_if2} | 1.1.1.1 | 30
1214 | | ... | ${dut2} | ${dut2_if1} | 1.1.1.2 | 30
1215 | | ... | ${dut2} | ${dut2_if2} | 20.20.20.1 | 24
1216 | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 1.1.1.2 | ${dut1_if2}
1217 | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | 1.1.1.1 | ${dut2_if1}
1218 | | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
1219
1220 | Configure MACIP ACLs
1221 | | [Documentation]
1222 | | ... | Configure MACIP ACL with required number of not-hitting permit ACEs
1223 | | ... | plus two hitting ACEs for both traffic directions.
1224 | | ...
1225 | | ... | *Arguments:*
1226 | | ... | - dut_node - DUT node. Type: dictionary
1227 | | ... | - dut_if1 - DUT node interface1 name (Optional). Type: string
1228 | | ... | - dut_if2 - DUT node interface2 name (Optional). Type: string
1229 | | ...
1230 | | ... | *Example:*
1231 | | ...
1232 | | ... | \| Configure MACIP ACLs \| ${nodes['DUT1']} \| GigabitEthernet0/7/0 \
1233 | | ... | \| GigabitEthernet0/8/0 \|
1234 | | ...
1235 | | ... | _NOTE:_ This KW uses following test case variables:
1236 | | ... | - ${src_ip_start} - Source IP address start. Type: string
1237 | | ... | - ${ip_step} - IP address step. Type: string
1238 | | ... | - ${src_mac_start} - Source MAC address start in format with colons.
1239 | | ... | Type: string
1240 | | ... | - ${src_mac_step} - Source MAC address step. Type: string
1241 | | ... | - ${src_mac_mask} - Source MAC address mask. 00:00:00:00:00:00 is a
1242 | | ... | wildcard mask. Type: string
1243 | | ... | - ${no_hit_aces_number} - Number of not-hitting ACEs to be configured.
1244 | | ... | Type: integer
1245 | | ... | - ${acl_action} - Action for the rule - deny, permit, permit+reflect.
1246 | | ... | Type: string
1247 | | ... | - ${tg_stream1_subnet} - IP subnet used by TG in direction 0->1.
1248 | | ... | Type: string
1249 | | ... | - ${tg_stream2_subnet} - IP subnet used by TG in direction 1->0.
1250 | | ... | Type: string
1251 | | ... | - ${tg_stream1_mac} - Source MAC address of traffic stream 1.
1252 | | ... | Type: string
1253 | | ... | - ${tg_stream2_mac} - Source MAC address of traffic stream 2.
1254 | | ... | Type: string
1255 | | ... | - ${tg_mac_mask} - MAC address mask for traffic streams.
1256 | | ... | 00:00:00:00:00:00 is a wildcard mask. Type: string
1257 | | ...
1258 | | [Arguments] | ${dut} | ${dut_if1}=${NONE} | ${dut_if2}=${NONE}
1259 | | ...
1260 | | ${src_ip_int} = | IP To Int | ${src_ip_start}
1261 | | ${src_ip_int} = | Evaluate | ${src_ip_int} - ${ip_step}
1262 | | ...
1263 | | ${ip_limit} = | Set Variable | 255.255.255.255
1264 | | ${ip_limit_int} = | IP To Int | ${ip_limit}
1265 | | ...
1266 | | ${src_mac_int} = | Mac To Int | ${src_mac_start}
1267 | | ${src_mac_int} = | Evaluate | ${src_mac_int} - ${src_mac_step}
1268 | | ...
1269 | | ${mac_limit} = | Set Variable | ff:ff:ff:ff:ff:ff
1270 | | ${mac_limit_int} = | Mac To Int | ${mac_limit}
1271 | | ...
1272 | | ${acl}= | Set Variable | ipv4 permit
1273 | | :FOR | ${nr} | IN RANGE | 0 | ${no_hit_aces_number}
1274 | | | ${src_ip_int} = | Evaluate | ${src_ip_int} + ${ip_step}
1275 | | | ${src_mac_int} = | Evaluate | ${src_mac_int} + ${src_mac_step}
1276 | | | ${ipv4_limit_reached}= | Set Variable If
1277 | | | ... | ${src_ip_int} > ${ip_limit_int} | ${TRUE}
1278 | | | ${mac_limit_reached}= | Set Variable If
1279 | | | ... | ${src_mac_int} > ${mac_limit_int} | ${TRUE}
1280 | | | Run Keyword If | '${ipv4_limit_reached}' == '${TRUE}' | Log
1281 | | | ... | Can't do more iterations - IPv4 address limit has been reached.
1282 | | | ... | WARN
1283 | | | Run Keyword If | '${mac_limit_reached}' == '${TRUE}' | Log
1284 | | | ... | Can't do more iterations - MAC address limit has been reached.
1285 | | | ... | WARN
1286 | | | ${src_ip} = | Run Keyword If | '${ipv4_limit_reached}' == '${TRUE}'
1287 | | | ... | Set Variable | ${ip_limit}
1288 | | | ... | ELSE | Int To IP | ${src_ip_int}
1289 | | | ${src_mac}= | Run Keyword If | '${mac_limit_reached}' == '${TRUE}'
1290 | | | ... | Set Variable | ${mac_limit}
1291 | | | ... | ELSE | Int To Mac | ${src_mac_int}
1292 | | | ${acl}= | Catenate | ${acl} | ip ${src_ip}/32
1293 | | | ... | mac ${src_mac} | mask ${src_mac_mask},
1294 | | | Exit For Loop If | '${ipv4_limit_reached}' == '${TRUE}' or '${mac_limit_reached}' == '${TRUE}'
1295 | | ${acl0}= | Catenate | ${acl}
1296 | | ... | ipv4 ${acl_action} ip ${tg_stream1_subnet} mac ${tg_stream1_mac}
1297 | | ... | mask ${tg_mac_mask}
1298 | | ${acl1}= | Catenate | ${acl}
1299 | | ... | ipv4 ${acl_action} ip ${tg_stream2_subnet} mac ${tg_stream2_mac}
1300 | | ... | mask ${tg_mac_mask}
1301 | | Add Macip Acl Multi Entries | ${dut} | rules=${acl0}
1302 | | Add Macip Acl Multi Entries | ${dut} | rules=${acl1}
1303 | | ${acl_idx}= | Set Variable | 0
1304 | | Run Keyword Unless | '${dut_if1}' == '${NONE}'
1305 | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if1} | add | ${acl_idx}
1306 | | ${acl_idx}= | Set Variable | 1
1307 | | Run Keyword Unless | '${dut_if2}' == '${NONE}'
1308 | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if2} | add | ${acl_idx}
1309
1310 | Initialize L2 bridge domain with MACIP ACLs on DUT1 in 3-node circular topology
1311 | | [Documentation]
1312 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
1313 | | ... | domain that is created automatically with index 1. Learning is
1314 | | ... | enabled. Interfaces are brought up. Apply required MACIP ACL rules to
1315 | | ... | DUT1 interfaces.
1316 | | ...
1317 | | ... | *Arguments:*
1318 | | ... | _None_
1319 | | ...
1320 | | ... | *Example:*
1321 | | ...
1322 | | ... | \| Initialize L2 bridge domain with MACIP ACLs on DUT1 in 3-node \
1323 | | ... | circular topology \|
1324 | | ...
1325 | | ... | _NOTE 1:_ This KW uses following test case variables:
1326 | | ... | - ${tg} - TG node.
1327 | | ... | - ${dut1} - DUT1 node.
1328 | | ... | - ${dut2} - DUT2 node.
1329 | | ... | - ${tg_if1} - TG interface towards DUT1.
1330 | | ... | - ${tg_if2} - TG interface towards DUT2.
1331 | | ... | - ${dut1_if1} - DUT1 interface towards TG.
1332 | | ... | - ${dut1_if2} - DUT1 interface towards DUT2.
1333 | | ... | - ${dut2_if1} - DUT2 interface towards DUT1.
1334 | | ... | - ${dut2_if2} - DUT2 interface towards TG.
1335 | | ...
1336 | | Set interfaces in path up
1337 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1_if2}
1338 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
1339 | | Configure MACIP ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
1340
1341 | Initialize L2 bridge domains with Vhost-User on node
1342 | | [Documentation]
1343 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
1344 | | ... | defined VPP node. Add each Vhost-User interface into L2 bridge
1345 | | ... | domains with learning enabled with physical inteface or Vhost-User
1346 | | ... | interface of another VM.
1347 | | ...
1348 | | ... | *Arguments:*
1349 | | ... | - dut - DUT node. Type: string
1350 | | ... | - vm_count - VM count. Type: integer
1351 | | ...
1352 | | ... | *Note:*
1353 | | ... | Socket paths for VM are defined in following format:
1354 | | ... | - /tmp/sock-${VM_ID}-1
1355 | | ... | - /tmp/sock-${VM_ID}-2
1356 | | ...
1357 | | ... | *Example:*
1358 | | ...
1359 | | ... | \| Initialize L2 bridge domains with Vhost-User on node \| DUT1 \
1360 | | ... | \| 1 \|
1361 | | ...
1362 | | [Arguments] | ${dut} | ${vm_count}=${1}
1363 | | ...
1364 | | ${bd_id2}= | Evaluate | ${vm_count}+1
1365 | | Add interface to bridge domain | ${nodes['${dut}']}
1366 | | ... | ${${dut}_if1} | ${1}
1367 | | Add interface to bridge domain | ${nodes['${dut}']}
1368 | | ... | ${${dut}_if2} | ${bd_id2}
1369 | | :FOR | ${number} | IN RANGE | 1 | ${vm_count}+1
1370 | | | ${sock1}= | Set Variable | /tmp/sock-${number}-1
1371 | | | ${sock2}= | Set Variable | /tmp/sock-${number}-2
1372 | | | Configure vhost interfaces for L2BD forwarding | ${nodes['${dut}']}
1373 | | | ... | ${sock1} | ${sock2} | ${dut}-vhost-${number}-if1
1374 | | | ... | ${dut}-vhost-${number}-if2
1375 | | | ${bd_id2}= | Evaluate | ${number}+1
1376 | | | Add interface to bridge domain | ${nodes['${dut}']}
1377 | | | ... | ${${dut}-vhost-${number}-if1} | ${number}
1378 | | | Add interface to bridge domain | ${nodes['${dut}']}
1379 | | | ... | ${${dut}-vhost-${number}-if2} | ${bd_id2}
1380 | | All VPP Interfaces Ready Wait | ${nodes}
1381
1382 | Initialize L2 bridge domains with Vhost-User
1383 | | [Documentation]
1384 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on all
1385 | | ... | defined VPP nodes. Add each Vhost-User interface into L2 bridge
1386 | | ... | domains with learning enabled with physical inteface or Vhost-User
1387 | | ... | interface of another VM.
1388 | | ...
1389 | | ... | *Arguments:*
1390 | | ... | - vm_count - VM count. Type: integer
1391 | | ...
1392 | | ... | *Example:*
1393 | | ...
1394 | | ... | \| Initialize L2 bridge domains with Vhost-User \| 1 \|
1395 | | ...
1396 | | [Arguments] | ${vm_count}=${1}
1397 | | ...
1398 | | ${duts}= | Get Matches | ${nodes} | DUT*
1399 | | :FOR | ${dut} | IN | @{duts}
1400 | | | Initialize L2 bridge domains with Vhost-User on node | ${dut}
1401 | | | ... | vm_count=${vm_count}
1402
1403 | Initialize L2 bridge domain with VXLANoIPv4 in 3-node circular topology
1404 | | [Documentation]
1405 | | ... | Setup L2 bridge domain topology with VXLANoIPv4 by connecting
1406 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
1407 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
1408 | | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as
1409 | | ... | interfaces.
1410 | | ...
1411 | | Set interfaces in path up
1412 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1
1413 | | ... | 24
1414 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2
1415 | | ... | 24
1416 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1417 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1418 | | Add arp on dut | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac}
1419 | | Add arp on dut | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac}
1420 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
1421 | | ... | 172.16.0.1 | 172.16.0.2
1422 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
1423 | | ... | 172.16.0.2 | 172.16.0.1
1424 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1s_vxlan}
1425 | | Configure L2BD forwarding | ${dut2} | ${dut2_if2} | ${dut2s_vxlan}
1426
1427 | Initialize L2 bridge domains with Vhost-User and VXLANoIPv4 in 3-node circular topology
1428 | | [Documentation]
1429 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
1430 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1431 | | ... | with physical inteface.
1432 | | ... | Setup VXLANoIPv4 between DUTs by connecting physical and vxlan
1433 | | ... | interfaces on each DUT. All interfaces are brought up.
1434 | | ... | IPv4 addresses with prefix /24 are configured on interfaces between
1435 | | ... | DUTs. VXLAN sub-interfaces has same IPv4 address as interfaces.
1436 | | ...
1437 | | ... | *Arguments:*
1438 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1439 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1440 | | ... | - sock1 - Sock path for first Vhost-User interface. Type: string
1441 | | ... | - sock2 - Sock path for second Vhost-User interface. Type: string
1442 | | ...
1443 | | ... | *Example:*
1444 | | ...
1445 | | ... | \| L2 bridge domains with Vhost-User and VXLANoIPv4 initialized in a\
1446 | | ... | 3-node circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \|
1447 | | ...
1448 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2}
1449 | | ...
1450 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1
1451 | | ... | 24
1452 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2
1453 | | ... | 24
1454 | | Set interfaces in path up
1455 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
1456 | | ... | 172.16.0.1 | 172.16.0.2
1457 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
1458 | | ... | 172.16.0.2 | 172.16.0.1
1459 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1460 | | ... | ${sock1} | ${sock2}
1461 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1462 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1463 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1464 | | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${bd_id2}
1465 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1466 | | ... | ${sock1} | ${sock2}
1467 | | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${bd_id1}
1468 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
1469 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
1470 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1471
1472 | Init L2 bridge domains with single DUT with Vhost-User and VXLANoIPv4 in 3-node circular topology
1473 | | [Documentation]
1474 | | ... | Create two Vhost-User interfaces on one VPP node. Add each
1475 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1476 | | ... | one connected to physical interface, the other to VXLAN.
1477 | | ... | Setup VXLANoIPv4 between DUTs and TG by connecting physical and vxlan
1478 | | ... | interfaces on the DUT. All interfaces are brought up.
1479 | | ... | IPv4 addresses with prefix /24 are configured on interfaces between
1480 | | ... | DUT and TG.
1481 | | ...
1482 | | ... | *Arguments:*
1483 | | ... | - dut1_address - Address of physical interface on DUT1. Type: string
1484 | | ... | - dut1_address_subnet - Subnet of the address of physical interface on
1485 | | ... |                         DUT1. Type: string
1486 | | ... | - dut2_address - Address of physical interface on DUT2. Type: string
1487 | | ... | - dut2_address_subnet - Subnet of the address of physical interface on
1488 | | ... |                         DUT2. Type: string
1489 | | ... | - dut1_gw - Address of the _gateway_ to which the traffic will be
1490 | | ... |             forwarded on DUT1. Type: string
1491 | | ... | - dut2_gw - Address of the _gateway_ to which the traffic will be
1492 | | ... |             forwarded on DUT2. Type: string
1493 | | ... | - dut1_vxlans - List of VXLAN params to be configured on DUT1.
1494 | | ... |                 Type: list of dicts, dict params vni, vtep
1495 | | ... | - dut2_vxlans - List of VXLAN params to be configured on DUT2.
1496 | | ... |                 Type: list of dicts, dict params vni, vtep
1497 | | ... | - dut1_route_subnet - Subnet address to forward to  _gateway_ on DUT1.
1498 | | ... |                       Type: string
1499 | | ... | - dut1_route_mask - Subnet address mask to forward to  _gateway_
1500 | | ... |                     on DUT1. Type: string
1501 | | ... | - dut2_route_subnet - Subnet address to forward to  _gateway_ on DUT2.
1502 | | ... |                       Type: string
1503 | | ... | - dut2_route_mask - Subnet address mask to forward to  _gateway_
1504 | | ... |                     on DUT2. Type: string
1505 | | ...
1506 | | ... | *Example:*
1507 | | ...
1508 | | [Arguments] | ${dut1_address} | ${dut1_address_subnet} |
1509 | | ... | ${dut2_address} | ${dut2_address_subnet} | ${dut1_gw} | ${dut2_gw} |
1510 | | ... | ${dut1_vxlans} | ${dut2_vxlans} | ${dut1_route_subnet} |
1511 | | ... | ${dut1_route_mask} | ${dut2_route_subnet} | ${dut2_route_mask}
1512 | | ...
1513 | | Set interfaces in path up
1514 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} |
1515 | | ... | ${dut1_address} | ${dut1_address_subnet}
1516 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} |
1517 | | ... | ${dut2_address} | ${dut2_address_subnet}
1518 | | ${dut1_bd_id1}= | Set Variable | 1
1519 | | ${dut1_bd_id2}= | Set Variable | 2
1520 | | ${dut2_bd_id1}= | Set Variable | 1
1521 | | :FOR | ${vxlan} | IN | @{dut1_vxlans}
1522 | | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | ${vxlan.vni}
1523 | | | ... | ${dut1_address} | ${vxlan.vtep}
1524 | | | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${dut1_bd_id1}
1525 | | :FOR | ${vxlan} | IN | @{dut2_vxlans}
1526 | | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | ${vxlan.vni}
1527 | | | ... | ${dut2_address} | ${vxlan.vtep}
1528 | | | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${dut2_bd_id1}
1529 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1530 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1531 | | Add arp on dut | ${dut1} | ${dut1_if1} | ${dut1_gw} | ${tg_if1_mac}
1532 | | Add arp on dut | ${dut2} | ${dut2_if2} | ${dut2_gw} | ${tg_if2_mac}
1533 | | Vpp Route Add | ${dut1} | ${dut1_route_subnet} | ${dut1_route_mask}
1534 | | ... | ${dut1_gw} | ${dut1_if1}
1535 | | Vpp Route Add | ${dut2} | ${dut2_route_subnet} | ${dut2_route_mask}
1536 | | ... | ${dut2_gw} | ${dut2_if2}
1537 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${dut1_bd_id2}
1538 | | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${dut2_bd_id1}
1539 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${dut1_bd_id1}
1540 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${dut1_bd_id2}
1541
1542 | Initialize L2 bridge domains with VLAN dot1q sub-interfaces in a 3-node circular topology
1543 | | [Documentation]
1544 | | ... | Setup L2 bridge domain topology with learning enabled with VLAN
1545 | | ... | between DUTs by connecting physical and vlan interfaces on each DUT.
1546 | | ... | All interfaces are brought up.
1547 | | ...
1548 | | ... | *Arguments:*
1549 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1550 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1551 | | ... | - subid - ID of the sub-interface to be created. Type: string
1552 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1553 | | ...
1554 | | ... | _NOTE:_ This KW uses following test case variables:
1555 | | ... | - ${dut1} - DUT1 node.
1556 | | ... | - ${dut2} - DUT2 node.
1557 | | ... | - ${dut1_if2} - DUT1 interface towards DUT2.
1558 | | ... | - ${dut2_if1} - DUT2 interface towards DUT1.
1559 | | ...
1560 | | ... | *Example:*
1561 | | ...
1562 | | ... | \| Initialize L2 bridge domains with VLAN dot1q sub-interfaces
1563 | | ... | in a 3-node circular topology \| 1 \| 2 \| 10 \| pop-1 \|
1564 | | ...
1565 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
1566 | | ...
1567 | | Set interfaces in path up
1568 | | Initialize VLAN dot1q sub-interfaces in 3-node circular topology
1569 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
1570 | | Configure L2 tag rewrite method on interfaces
1571 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1572 | | ... | ${tag_rewrite}
1573 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1574 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id1}
1575 | | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id2}
1576 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1577
1578 | Initialize L2 bridge domains with Vhost-User and VLAN in a 3-node circular topology
1579 | | [Documentation]
1580 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
1581 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1582 | | ... | with physical inteface.
1583 | | ... | Setup VLAN between DUTs. All interfaces are brought up.
1584 | | ...
1585 | | ... | *Arguments:*
1586 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1587 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1588 | | ... | - sock1 - Sock path for first Vhost-User interface. Type: string
1589 | | ... | - sock2 - Sock path for second Vhost-User interface. Type: string
1590 | | ... | - subid - ID of the sub-interface to be created. Type: string
1591 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1592 | | ...
1593 | | ... | *Example:*
1594 | | ...
1595 | | ... | \| L2 bridge domains with Vhost-User and VLAN initialized in a 3-node\
1596 | | ... | circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \| 10 \
1597 | | ... | \| pop-1 \|
1598 | | ...
1599 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2} | ${subid}
1600 | | ... | ${tag_rewrite}
1601 | | ...
1602 | | Set interfaces in path up
1603 | | Initialize VLAN dot1q sub-interfaces in 3-node circular topology
1604 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
1605 | | Configure L2 tag rewrite method on interfaces
1606 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1607 | | ... | ${tag_rewrite}
1608 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1609 | | ... | ${sock1} | ${sock2}
1610 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1611 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1612 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1613 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
1614 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1615 | | ... | ${sock1} | ${sock2}
1616 | | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id1}
1617 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
1618 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
1619 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1620
1621 | Initialize L2 bridge domains with Vhost-User and VLAN with DPDK link bonding in a 3-node circular topology
1622 | | [Documentation]
1623 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Setup VLAN
1624 | | ... | on BondEthernet interfaces between DUTs. Add one Vhost-User interface
1625 | | ... | into L2 bridge domains with learning enabled with physical interface
1626 | | ... | towards TG and other Vhost-User interface into L2 bridge domains with
1627 | | ... | learning enabled with VLAN sub-interface. All interfaces are brought
1628 | | ... | up.
1629 | | ...
1630 | | ... | *Arguments:*
1631 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1632 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1633 | | ... | - sock1 - Sock path for first Vhost-User interface. Type: string
1634 | | ... | - sock2 - Sock path for second Vhost-User interface. Type: string
1635 | | ... | - subid - ID of the sub-interface to be created. Type: string
1636 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1637 | | ...
1638 | | ... | *Example:*
1639 | | ...
1640 | | ... | \| Initialize L2 bridge domains with Vhost-User and VLAN with DPDK\
1641 | | ... | link bonding in a 3-node circular topology \| 1 \| 2 \| /tmp/sock1 \
1642 | | ... | \| /tmp/sock2 \| 10 \| pop-1 \|
1643 | | ...
1644 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2} | ${subid}
1645 | | ... | ${tag_rewrite}
1646 | | ...
1647 | | Set interfaces in path up
1648 | | Add DPDK bonded ethernet interfaces to topology file in 3-node single link topology
1649 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
1650 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
1651 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
1652 | | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1}
1653 | | Initialize VLAN dot1q sub-interfaces in 3-node circular topology
1654 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
1655 | | ... | ${subid}
1656 | | Configure L2 tag rewrite method on interfaces
1657 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1658 | | ... | ${tag_rewrite}
1659 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1660 | | ... | ${sock1} | ${sock2}
1661 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1662 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1663 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1664 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
1665 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1666 | | ... | ${sock1} | ${sock2}
1667 | | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id1}
1668 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
1669 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
1670 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1671
1672 | Initialize L2 bridge domains with Vhost-User and VLAN with VPP link bonding in a 3-node circular topology
1673 | | [Documentation]
1674 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Create one
1675 | | ... | link bonding (BondEthernet) interface on both VPP nodes. Enslave one
1676 | | ... | physical interface towards next DUT by BondEthernet interface. Setup
1677 | | ... | VLAN on BondEthernet interfaces between DUTs. Add one Vhost-User
1678 | | ... | interface into L2 bridge domains with learning enabled with physical
1679 | | ... | interface towards TG and other Vhost-User interface into L2 bridge
1680 | | ... | domains with learning enabled with VLAN sub-interface. All interfaces
1681 | | ... | are brought up.
1682 | | ...
1683 | | ... | *Arguments:*
1684 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1685 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1686 | | ... | - sock1 - Sock path for first Vhost-User interface. Type: string
1687 | | ... | - sock2 - Sock path for second Vhost-User interface. Type: string
1688 | | ... | - subid - ID of the sub-interface to be created. Type: string
1689 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1690 | | ... | - bond_mode - Link bonding mode. Type: string
1691 | | ... | - lb_mode - Load balance mode. Type: string
1692 | | ...
1693 | | ... | *Example:*
1694 | | ...
1695 | | ... | \| Initialize L2 bridge domains with Vhost-User and VLAN with VPP\
1696 | | ... | link bonding in a 3-node circular topology \| 1 \| 2 \| /tmp/sock1 \
1697 | | ... | \| /tmp/sock2 \| 10 \| pop-1 \| xor \| l34 \|
1698 | | ...
1699 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2} | ${subid}
1700 | | ... | ${tag_rewrite} | ${bond_mode} | ${lb_mode}
1701 | | ...
1702 | | Set interfaces in path up
1703 | | ${dut1_eth_bond_if1}= | VPP Create Bond Interface | ${dut1} | ${bond_mode}
1704 | | ... | ${lb_mode}
1705 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
1706 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
1707 | | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2}
1708 | | ... | ${dut1_eth_bond_if1}
1709 | | ${dut2_eth_bond_if1}= | VPP Create Bond Interface | ${dut2} | ${bond_mode}
1710 | | ... | ${lb_mode}
1711 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
1712 | | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1}
1713 | | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1}
1714 | | ... | ${dut2_eth_bond_if1}
1715 | | VPP Show Bond Data On All Nodes | ${nodes} | details=${TRUE}
1716 | | Initialize VLAN dot1q sub-interfaces in 3-node circular topology
1717 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
1718 | | ... | ${subid}
1719 | | Configure L2 tag rewrite method on interfaces
1720 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1721 | | ... | ${tag_rewrite}
1722 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1723 | | ... | ${sock1} | ${sock2}
1724 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1725 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1726 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1727 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
1728 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1729 | | ... | ${sock1} | ${sock2}
1730 | | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id1}
1731 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
1732 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
1733 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1734
1735 | Add PCI devices to all DUTs
1736 | | [Documentation]
1737 | | ... | Add PCI devices to VPP configuration file.
1738 | | ...
1739 | | ${duts}= | Get Matches | ${nodes} | DUT*
1740 | | :FOR | ${dut} | IN | @{duts}
1741 | | | ${if1_pci}= | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1}
1742 | | | ${if2_pci}= | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2}
1743 | | | Run keyword | ${dut}.Add DPDK Dev | ${if1_pci} | ${if2_pci}
1744 | | | Set Test Variable | ${${dut}_if1_pci} | ${if1_pci}
1745 | | | Set Test Variable | ${${dut}_if2_pci} | ${if2_pci}
1746
1747 | Add single PCI device to all DUTs
1748 | | [Documentation]
1749 | | ... | Add single (first) PCI device on DUT1 and single (last) PCI device on
1750 | | ... | DUT2 to VPP configuration file.
1751 | | ...
1752 | | ${duts}= | Get Matches | ${nodes} | DUT*
1753 | | :FOR | ${dut} | IN | @{duts}
1754 | | | ${if1_pci}= | Run Keyword If | '${dut}' == 'DUT1' | Get Interface PCI Addr
1755 | | | ... | ${nodes['${dut}']} | ${${dut}_if1} | ELSE | Get Interface PCI Addr
1756 | | | ... | ${nodes['${dut}']} | ${${dut}_if2}
1757 | | | Run keyword | ${dut}.Add DPDK Dev | ${if1_pci}
1758 | | | Set Test Variable | ${${dut}_if1_pci} | ${if1_pci}
1759
1760 | Add VLAN Strip Offload switch off between DUTs in 3-node single link topology
1761 | | [Documentation]
1762 | | ... | Add VLAN Strip Offload switch off on PCI devices between DUTs to VPP
1763 | | ... | configuration file.
1764 | | ...
1765 | | Run keyword | DUT1.Add DPDK Dev Parameter | ${dut1_if2_pci}
1766 | | ... | vlan-strip-offload | off
1767 | | Run keyword | DUT2.Add DPDK Dev Parameter | ${dut2_if1_pci}
1768 | | ... | vlan-strip-offload | off
1769
1770 | Add DPDK bonded ethernet interfaces to DUTs in 3-node single link topology
1771 | | [Documentation]
1772 | | ... | Add DPDK bonded Ethernet interfaces with mode XOR and transmit policy
1773 | | ... | l34 to VPP configuration file.
1774 | | ...
1775 | | Run keyword | DUT1.Add DPDK Eth Bond Dev | 0 | 2 | l34 | ${dut1_if2_pci}
1776 | | Run keyword | DUT2.Add DPDK Eth Bond Dev | 0 | 2 | l34 | ${dut2_if1_pci}
1777
1778 | Add DPDK bonded ethernet interfaces to topology file in 3-node single link topology
1779 | | Add Bond Eth Interface | ${dut1} | ${dut1_eth_bond_if1_name}
1780 | | Add Bond Eth Interface | ${dut2} | ${dut2_eth_bond_if1_name}
1781
1782 | Configure guest VM with dpdk-testpmd connected via vhost-user
1783 | | [Documentation]
1784 | | ... | Start QEMU guest with two vhost-user interfaces and interconnecting\
1785 | | ... | DPDK testpmd.
1786 | | ...
1787 | | ... | *Arguments:*
1788 | | ... | - dut - DUT node to start guest VM on. Type: dictionary
1789 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
1790 | | ... | - sock2 - Socket path for second Vhost-User interface.
1791 | | ... | Type: string
1792 | | ... | - vm_name - QemuUtil instance name. Type: string
1793 | | ... | - qemu_id - Qemu Id when starting more then one guest VM on DUT
1794 | | ... | node. Type: integer
1795 | | ... | - jumbo - Set True if jumbo frames are used in the test.
1796 | | ... | Type: bool
1797 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: int
1798 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
1799 | | ... | Type: bool
1800 | | ...
1801 | | ... | *Note:*
1802 | | ... | KW uses test variables \${rxq_count_int}, \${thr_count_int} and
1803 | | ... | \${cpu_count_int} set by "Add worker threads and rxqueues to all DUTs"
1804 | | ...
1805 | | ... | *Example:*
1806 | | ...
1807 | | ... | \| Configure guest VM with dpdk-testpmd connected via vhost-user \
1808 | | ... | \| ${nodes['DUT1']} \| /tmp/sock-2-1 \| /tmp/sock-2-2 \| DUT1_VM2 \
1809 | | ... | \| qemu_id=${2} \|
1810 | | ...
1811 | | [Arguments] | ${dut} | ${sock1} | ${sock2} | ${vm_name} | ${qemu_id}=${1}
1812 | | ... | ${jumbo}=${False} | ${perf_qemu_qsz}=${256}
1813 | | ... | ${use_tuned_cfs}=${False}
1814 | | ...
1815 | | Import Library | resources.libraries.python.QemuUtils | qemu_id=${qemu_id}
1816 | | ... | WITH NAME | ${vm_name}
1817 | | Run keyword | ${vm_name}.Qemu Set Node | ${nodes['${dut}']}
1818 | | ${serial_port}= | Evaluate | ${qemu_id} + ${4555}
1819 | | Run keyword | ${vm_name}.Qemu Set Serial Port | ${serial_port}
1820 | | ${ssh_fwd_port}= | Evaluate | ${qemu_id} + ${10021}
1821 | | Run keyword | ${vm_name}.Qemu Set Ssh Fwd Port | ${ssh_fwd_port}
1822 | | ${dut_numa}= | Get interfaces numa node | ${nodes['${dut}']}
1823 | | ... | ${${dut}_if1} | ${${dut}_if2}
1824 # Compute CPU placement for VM based on expected DUT placement.
1825 | | ${os_cpus}= | Set Variable | ${1}
1826 | | ${dut_main_cpus}= | Set Variable | ${1}
1827 | | ${dut_wk_cpus}= | Set Variable | ${cpu_count_int}
1828 | | ${vm_cpus}= | Evaluate | ${dut_wk_cpus} + ${dut_main_cpus}
1829 | | ${skip_dut}= | Evaluate | ${dut_wk_cpus} + ${dut_main_cpus} + ${os_cpus}
1830 | | ${skip_cpu}= | Evaluate | ${skip_dut} + (${qemu_id} - ${1}) * ${vm_cpus}
1831 | | ${qemu_cpus}= | Cpu slice of list per node | ${nodes['${dut}']}
1832 | | ... | ${dut_numa} | skip_cnt=${skip_cpu} | cpu_cnt=${vm_cpus}
1833 | | ... | smt_used=${smt_used}
1834 | | ${vm_thrs}= | Get Length | ${qemu_cpus}
1835 | | Run keyword | ${vm_name}.Qemu Set Queue Count | ${rxq_count_int}
1836 | | Run keyword | ${vm_name}.Qemu Set Queue Size | ${perf_qemu_qsz}
1837 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
1838 | | ... | jumbo_frames=${jumbo}
1839 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
1840 | | ... | jumbo_frames=${jumbo}
1841 | | ${apply_patch}= | Set Variable | ${False}
1842 | | ${perf_qemu_path}= | Set Variable If | ${apply_patch}
1843 | | ... | ${perf_qemu_path}-patch/bin/
1844 | | ... | ${perf_qemu_path}-base/bin/
1845 | | Run Keyword If | ${qemu_build} | ${vm_name}.Build QEMU | ${nodes['${dut}']}
1846 | | ... | apply_patch=${False}
1847 | | Run keyword | ${vm_name}.Qemu Set Path | ${perf_qemu_path}
1848 | | Run keyword | ${vm_name}.Qemu Set Smp | ${vm_thrs} | ${vm_thrs} | 1 | 1
1849 | | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
1850 | | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image}
1851 | | ${vm}= | Run keyword | ${vm_name}.Qemu Start
1852 | | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus}
1853 | | Run keyword If | ${use_tuned_cfs} | ${vm_name}.Qemu Set Scheduler Policy
1854 | | ${max_pkt_len}= | Set Variable If | ${jumbo} | 9000 | ${EMPTY}
1855 | | ${testpmd_cpus}= | Evaluate | ${thr_count_int} + ${1}
1856 | | ${testpmd_cpus}= | Cpu list per node str | ${nodes['${dut}']} | ${0}
1857 | | ... | cpu_cnt=${testpmd_cpus}
1858 | | Dpdk Testpmd Start | ${vm} | eal_corelist=${testpmd_cpus}
1859 | | ... | eal_mem_channels=4 | pmd_fwd_mode=io | pmd_disable_hw_vlan=${TRUE}
1860 | | ... | pmd_rxd=${perf_qemu_qsz} | pmd_txd=${perf_qemu_qsz}
1861 | | ... | pmd_rxq=${rxq_count_int} | pmd_txq=${rxq_count_int}
1862 | | ... | pmd_max_pkt_len=${max_pkt_len}
1863 | | Return From Keyword | ${vm}
1864
1865 | Configure guest VMs with dpdk-testpmd connected via vhost-user on node
1866 | | [Documentation]
1867 | | ... | Start ${vm_count} QEMU guests with two vhost-user interfaces and\
1868 | | ... | interconnecting DPDK testpmd for defined number of VMs on all defined\
1869 | | ... | VPP nodes.
1870 | | ...
1871 | | ... | *Arguments:*
1872 | | ... | - dut - DUT node to start guest VM on. Type: dictionary
1873 | | ... | - vm_count - Number of guest VMs. Type: int
1874 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
1875 | | ... | in the test. Type: boolean
1876 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: int
1877 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
1878 | | ... | Type: bool
1879 | | ...
1880 | | ... | *Example:*
1881 | | ...
1882 | | ... | \| Configure guest VMs with dpdk-testpmd connected via \
1883 | | ... | vhost-user on node \| DUT1 \| 1 \| False \| 256 \|
1884 | | ...
1885 | | [Arguments] | ${dut} | ${vm_count}=${1} | ${jumbo}=${False} |
1886 | | ... | ${perf_qemu_qsz}=${256} | ${use_tuned_cfs}=${False}
1887 | | ...
1888 | | :FOR | ${number} | IN RANGE | 1 | ${vm_count}+1
1889 | | | ${sock1}= | Set Variable | /tmp/sock-${number}-1
1890 | | | ${sock2}= | Set Variable | /tmp/sock-${number}-2
1891 | | | ${vm}=
1892 | | | ... | Configure guest VM with dpdk-testpmd connected via vhost-user
1893 | | | ... | ${dut} | ${sock1} | ${sock2} | ${dut}_VM${number}
1894 | | | ... | qemu_id=${number} | jumbo=${jumbo} | perf_qemu_qsz=${perf_qemu_qsz}
1895 | | | ... | use_tuned_cfs=${use_tuned_cfs}
1896 | | | Set To Dictionary | ${${dut}_vm_refs} | ${dut}_VM${number} | ${vm}
1897
1898 | Configure guest VMs with dpdk-testpmd connected via vhost-user
1899 | | [Documentation]
1900 | | ... | Start ${vm_count} QEMU guests with two vhost-user interfaces and\
1901 | | ... | interconnecting DPDK testpmd defined number of VMs on all defined VPP\
1902 | | ... | nodes.
1903 | | ...
1904 | | ... | *Arguments:*
1905 | | ... | - vm_count - Number of guest VMs. Type: int
1906 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
1907 | | ... | in the test. Type: boolean
1908 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: int
1909 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
1910 | | ... | Type: bool
1911 | | ...
1912 | | ... | *Example:*
1913 | | ...
1914 | | ... | \| Configure guest VMs with dpdk-testpmd connected via vhost-user\
1915 | | ... | \| 1 \| False \| 256 \|
1916 | | ...
1917 | | [Arguments] | ${vm_count}=${1} | ${jumbo}=${False} | ${perf_qemu_qsz}=${256}
1918 | | ... | ${use_tuned_cfs}=${False}
1919 | | ...
1920 | | ${duts}= | Get Matches | ${nodes} | DUT*
1921 | | :FOR | ${dut} | IN | @{duts}
1922 | | | Configure guest VMs with dpdk-testpmd connected via vhost-user on node
1923 | | | ... | ${dut} | vm_count=${vm_count} | jumbo=${jumbo}
1924 | | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${False}
1925
1926 | Configure guest VM with dpdk-testpmd-mac connected via vhost-user
1927 | | [Documentation]
1928 | | ... | Start QEMU guest with two vhost-user interfaces and interconnecting\
1929 | | ... | DPDK testpmd.
1930 | | ...
1931 | | ... | *Arguments:*
1932 | | ... | - dut - DUT node to start guest VM on. Type: dictionary
1933 | | ... | - sock1 - Socket path for first Vhost-User interface.
1934 | | ... | Type: string
1935 | | ... | - sock2 - Socket path for second Vhost-User interface.
1936 | | ... | Type: string
1937 | | ... | - vm_name - QemuUtil instance name. Type: string
1938 | | ... | - eth0_mac - MAC address of first Vhost interface. Type: string
1939 | | ... | - eth1_mac - MAC address of second Vhost interface. Type: string
1940 | | ... | - qemu_id - Qemu Id when starting more then one guest VM on DUT
1941 | | ... | node. Type: integer
1942 | | ... | - jumbo - Set True if jumbo frames are used in the test.
1943 | | ... | Type: bool
1944 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: int
1945 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
1946 | | ... | Type: bool
1947 | | ...
1948 | | ... | *Note:*
1949 | | ... | KW uses test variables \${rxq_count_int}, \${thr_count_int} and
1950 | | ... | \${cpu_count_int} set by "Add worker threads and rxqueues to all DUTs"
1951 | | ...
1952 | | ... | *Example:*
1953 | | ...
1954 | | ... | \| Configure guest VM with dpdk-testpmd-mac connected via vhost-user \
1955 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \
1956 | | ... | \| 00:00:00:00:00:01 \| 00:00:00:00:00:02 \|
1957 | | ...
1958 | | [Arguments] | ${dut} | ${sock1} | ${sock2} | ${vm_name}
1959 | | ... | ${eth0_mac} | ${eth1_mac} | ${qemu_id}=${1} | ${jumbo}=${False}
1960 | | ... | ${perf_qemu_qsz}=${256} | ${use_tuned_cfs}=${False}
1961 | | ...
1962 | | Import Library | resources.libraries.python.QemuUtils | qemu_id=${qemu_id}
1963 | | ... | WITH NAME | ${vm_name}
1964 | | Run keyword | ${vm_name}.Qemu Set Node | ${nodes['${dut}']}
1965 | | ${serial_port}= | Evaluate | ${qemu_id} + ${4555}
1966 | | Run keyword | ${vm_name}.Qemu Set Serial Port | ${serial_port}
1967 | | ${ssh_fwd_port}= | Evaluate | ${qemu_id} + ${10021}
1968 | | Run keyword | ${vm_name}.Qemu Set Ssh Fwd Port | ${ssh_fwd_port}
1969 | | ${dut_numa}= | Get interfaces numa node | ${nodes['${dut}']}
1970 | | ... | ${${dut}_if1} | ${${dut}_if2}
1971 # Compute CPU placement for VM based on expected DUT placement.
1972 | | ${os_cpus}= | Set Variable | ${1}
1973 | | ${dut_main_cpus}= | Set Variable | ${1}
1974 | | ${dut_wk_cpus}= | Set Variable | ${cpu_count_int}
1975 | | ${vm_cpus}= | Evaluate | ${dut_wk_cpus} + ${dut_main_cpus}
1976 | | ${skip_dut}= | Evaluate | ${dut_wk_cpus} + ${dut_main_cpus} + ${os_cpus}
1977 | | ${skip_cpu}= | Evaluate | ${skip_dut} + (${qemu_id} - ${1}) * ${vm_cpus}
1978 | | ${qemu_cpus}= | Cpu slice of list per node | ${nodes['${dut}']}
1979 | | ... | ${dut_numa} | skip_cnt=${skip_cpu} | cpu_cnt=${vm_cpus}
1980 | | ... | smt_used=${smt_used}
1981 | | ${vm_thrs}= | Get Length | ${qemu_cpus}
1982 | | Run keyword | ${vm_name}.Qemu Set Queue Count | ${rxq_count_int}
1983 | | Run keyword | ${vm_name}.Qemu Set Queue Size | ${perf_qemu_qsz}
1984 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
1985 | | ... | jumbo_frames=${jumbo}
1986 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
1987 | | ... | jumbo_frames=${jumbo}
1988 | | ${apply_patch}= | Set Variable | ${False}
1989 | | ${perf_qemu_path}= | Set Variable If | ${apply_patch}
1990 | | ... | ${perf_qemu_path}-patch/bin/
1991 | | ... | ${perf_qemu_path}-base/bin/
1992 | | Run Keyword If | ${qemu_build} | ${vm_name}.Build QEMU | ${nodes['${dut}']}
1993 | | ... | apply_patch=${False}
1994 | | Run keyword | ${vm_name}.Qemu Set Path | ${perf_qemu_path}
1995 | | Run keyword | ${vm_name}.Qemu Set Smp | ${vm_thrs} | ${vm_thrs} | 1 | 1
1996 | | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
1997 | | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image}
1998 | | ${vm}= | Run keyword | ${vm_name}.Qemu Start
1999 | | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus}
2000 | | Run keyword If | ${use_tuned_cfs} | ${vm_name}.Qemu Set Scheduler Policy
2001 | | ${max_pkt_len}= | Set Variable If | ${jumbo} | 9000 | ${EMPTY}
2002 | | ${testpmd_cpus}= | Evaluate | ${thr_count_int} + ${1}
2003 | | ${testpmd_cpus}= | Cpu list per node str | ${nodes['${dut}']} | ${0}
2004 | | ... | cpu_cnt=${testpmd_cpus}
2005 | | Dpdk Testpmd Start | ${vm} | eal_corelist=${testpmd_cpus}
2006 | | ... | eal_mem_channels=4 | pmd_fwd_mode=mac | pmd_eth_peer_0=0,${eth0_mac}
2007 | | ... | pmd_eth_peer_1=1,${eth1_mac} | pmd_disable_hw_vlan=${TRUE}
2008 | | ... | pmd_rxd=${perf_qemu_qsz} | pmd_txd=${perf_qemu_qsz}
2009 | | ... | pmd_rxq=${rxq_count_int} | pmd_txq=${rxq_count_int}
2010 | | ... | pmd_max_pkt_len=${max_pkt_len}
2011 | | Return From Keyword | ${vm}
2012
2013 | Configure guest VMs with dpdk-testpmd-mac connected via vhost-user on node
2014 | | [Documentation]
2015 | | ... | Start ${vm_count} QEMU guests with two vhost-user interfaces and\
2016 | | ... | interconnecting DPDK testpmd with fwd mode set to mac rewrite for\
2017 | | ... | defined number of VMs on all defined VPP nodes.
2018 | | ...
2019 | | ... | *Arguments:*
2020 | | ... | - dut - DUT node to start guest VM on. Type: dictionary
2021 | | ... | - vm_count} - Number of guest VMs. Type: int
2022 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
2023 | | ... | in the test. Type: boolean
2024 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: int
2025 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2026 | | ... | Type: bool
2027 | | ...
2028 | | ... | _NOTE:_ This KW expects following test case variables to be set:
2029 | | ... | - cpu_count_int - Number of Physical CPUs allocated for DUT.
2030 | | ...
2031 | | ... | *Example:*
2032 | | ...
2033 | | ... | \| Configure guest VMs with dpdk-testpmd-mac connected via \
2034 | | ... | vhost-user on node \| DUT1 \| 1 \| False \| 256 \|
2035 | | ...
2036 | | [Arguments] | ${dut} | ${vm_count}=${1} | ${jumbo}=${False} |
2037 | | ... | ${perf_qemu_qsz}=${256} | ${use_tuned_cfs}=${False}
2038 | | ...
2039 | | :FOR | ${number} | IN RANGE | 1 | ${vm_count}+1
2040 | | | ${sock1}= | Set Variable | /tmp/sock-${number}-1
2041 | | | ${sock2}= | Set Variable | /tmp/sock-${number}-2
2042 | | | ${vm}=
2043 | | | ... | Configure guest VM with dpdk-testpmd-mac connected via vhost-user
2044 | | | ... | ${dut} | ${sock1} | ${sock2} | ${dut}_VM${number}
2045 | | | ... | ${${dut}-vhost-${number}-if1_mac}
2046 | | | ... | ${${dut}-vhost-${number}-if2_mac} | qemu_id=${number}
2047 | | | ... | jumbo=${jumbo} | perf_qemu_qsz=${perf_qemu_qsz}
2048 | | | ... | use_tuned_cfs=${use_tuned_cfs}
2049 | | | Set To Dictionary | ${${dut}_vm_refs} | ${dut}_VM${number} | ${vm}
2050
2051 | Configure guest VMs with dpdk-testpmd-mac connected via vhost-user
2052 | | [Documentation]
2053 | | ... | Start ${vm_count} QEMU guests with two vhost-user interfaces and\
2054 | | ... | interconnecting DPDK testpmd with fwd mode set to mac rewrite for\
2055 | | ... | defined number of VMs on all defined VPP nodes.
2056 | | ...
2057 | | ... | *Arguments:*
2058 | | ... | - vm_count - Number of guest VMs. Type: int
2059 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
2060 | | ... | in the test. Type: boolean
2061 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: int
2062 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2063 | | ... | Type: bool
2064 | | ...
2065 | | ... | *Example:*
2066 | | ...
2067 | | ... | \| Configure guest VMs with dpdk-testpmd-mac connected via vhost-user\
2068 | | ... | \| 1 \| False \| 256 \|
2069 | | ...
2070 | | [Arguments] | ${vm_count}=${1} | ${jumbo}=${False} | ${perf_qemu_qsz}=${256}
2071 | | ... | ${use_tuned_cfs}=${False}
2072 | | ...
2073 | | ${duts}= | Get Matches | ${nodes} | DUT*
2074 | | :FOR | ${dut} | IN | @{duts}
2075 | | | Configure guest VMs with dpdk-testpmd-mac connected via vhost-user on node
2076 | | | ... | ${dut} | vm_count=${vm_count} | jumbo=${jumbo}
2077 | | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${False}
2078
2079 | Configure guest VM with linux bridge connected via vhost-user
2080 | | [Documentation]
2081 | | ... | Start QEMU guest with two vhost-user interfaces and interconnecting\
2082 | | ... | linux bridge.
2083 | | ...
2084 | | ... | *Arguments:*
2085 | | ... | - dut - DUT node to start guest VM on. Type: dictionary
2086 | | ... | - sock1 - Socket path for first Vhost-User interface.
2087 | | ... | Type: string
2088 | | ... | - sock2 - Socket path for second Vhost-User interface.
2089 | | ... | Type: string
2090 | | ... | - vm_name - QemuUtil instance name. Type: string
2091 | | ... | - skip_cnt - number of cpus which will be skipped. Type: int
2092 | | ...
2093 | | ... | _NOTE:_ This KW expects following test case variables to be set:
2094 | | ... | - cpu_count_int - Number of Physical CPUs allocated for DUT.
2095 | | ...
2096 | | ... | *Example:*
2097 | | ...
2098 | | ... | \| Configure guest VM with linux bridge connected via vhost-user \
2099 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \| ${6} \|
2100 | | ...
2101 | | [Arguments] | ${dut} | ${sock1} | ${sock2} | ${vm_name} | ${skip_cnt}=${6}
2102 | | ... | ${count}=${5}
2103 | | ...
2104 | | Import Library | resources.libraries.python.QemuUtils
2105 | | ... | WITH NAME | ${vm_name}
2106 | | Run keyword | ${vm_name}.Qemu Set Node | ${dut}
2107 | | ${dut_numa}= | Get interfaces numa node | ${dut}
2108 | | ... | ${dut1_if1} | ${dut1_if2}
2109 | | ${vm_phy_cpus}= | Evaluate | ${cpu_count_int} + ${1}
2110 | | ${skip_cnt}= | Evaluate | ${skip} + (${qemu_id} - ${1}) * ${vm_phy_cpus}
2111 | | ${qemu_cpus}= | Cpu slice of list per node | ${dut} | ${dut_numa}
2112 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${vm_phy_cpus} | smt_used=${smt_used}
2113 | | ${vm_thr_cpus}= | Get Length | ${qemu_cpus}
2114 | | Run keyword | ${vm_name}.Qemu Set Queue Size | ${perf_qemu_qsz}
2115 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
2116 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
2117 | | ${apply_patch}= | Set Variable | ${False}
2118 | | ${perf_qemu_path}= | Set Variable If | ${apply_patch}
2119 | | ... | ${perf_qemu_path}-patch/bin/
2120 | | ... | ${perf_qemu_path}-base/bin/
2121 | | Run Keyword If | ${qemu_build} | ${vm_name}.Build QEMU | ${dut}
2122 | | ... | apply_patch=${apply_patch}
2123 | | Run keyword | ${vm_name}.Qemu Set Path | ${perf_qemu_path}
2124 | | Run keyword | ${vm_name}.Qemu Set Smp | ${vm_thr_cpus} | ${vm_thr_cpus}
2125 | | ... | 1 | 1
2126 | | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
2127 | | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image}
2128 | | ${vm}= | Run keyword | ${vm_name}.Qemu Start
2129 | | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus}
2130 | | ${br}= | Set Variable | br0
2131 | | ${vhost1}= | Get Vhost User If Name By Sock | ${vm} | ${sock1}
2132 | | ${vhost2}= | Get Vhost User If Name By Sock | ${vm} | ${sock2}
2133 | | Linux Add Bridge | ${vm} | ${br} | ${vhost1} | ${vhost2}
2134 | | Set Interface State | ${vm} | ${vhost1} | up | if_type=name
2135 | | Set Interface State | ${vm} | ${vhost2} | up | if_type=name
2136 | | Set Interface State | ${vm} | ${br} | up | if_type=name
2137 | | Return From Keyword | ${vm}
2138
2139 | Initialize LISP IPv4 forwarding in 3-node circular topology
2140 | | [Documentation] | Custom setup of IPv4 addresses on all DUT nodes and TG \
2141 | | ... | Don`t set route.
2142 | | ...
2143 | | ... | *Arguments:*
2144 | | ... | -${dut1_dut2_address} - Ip address from DUT1 to DUT2. Type: string
2145 | | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string
2146 | | ... | -${dut2_dut1_address} - Ip address from DUT2 to DUT1. Type: string
2147 | | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string
2148 | | ... | -${duts_prefix} - ip prefix. Type: int
2149 | | ...
2150 | | ... | *Return:*
2151 | | ... | - No value returned
2152 | | ...
2153 | | ... | *Example:*
2154 | | ... | \| Initialize LISP IPv4 forwarding in 3-node circular topology \
2155 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
2156 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
2157 | | ...
2158 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
2159 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${duts_prefix}
2160 | | ...
2161 | | Set interfaces in path up
2162 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2163 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2164 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2165 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2166 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
2167 | | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_dut1_address}
2168 | | ... | ${dut2_if1_mac}
2169 | | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_dut2_address}
2170 | | ... | ${dut1_if2_mac}
2171 | | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
2172 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
2173 | | ... | ${dut1_tg_address} | ${duts_prefix}
2174 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
2175 | | ... | ${dut1_dut2_address} | ${duts_prefix}
2176 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
2177 | | ... | ${dut2_dut1_address} | ${duts_prefix}
2178 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2}
2179 | | ... | ${dut2_tg_address} | ${duts_prefix}
2180
2181 | Initialize LISP GPE IPv4 over IPsec in 3-node circular topology
2182 | | [Documentation] | Setup Lisp GPE IPv4 forwarding over IPsec.
2183 | | ...
2184 | | ... | *Arguments:*
2185 | | ... | -${encr_alg} - Encryption algorithm. Type: string
2186 | | ... | -${auth_alg} - Authentication algorithm. Type: string
2187 | | ...
2188 | | ... | *Return:*
2189 | | ... | - No value returned
2190 | | ...
2191 | | ... | *Example:*
2192 | | ... | \| Initialize LISP GPE IPv4 over IPsec in 3-node circular topology\
2193 | | ... | \| ${encr_alg} \| ${auth_alg}
2194 | | ...
2195 | | [Arguments] | ${encr_alg} | ${auth_alg}
2196 | | ...
2197 | | Generate keys for IPSec | ${encr_alg} | ${auth_alg}
2198 | | Initialize LISP IPv4 forwarding in 3-node circular topology
2199 | | ... | ${dut1_to_dut2_ip4} | ${dut1_to_tg_ip4} | ${dut2_to_dut1_ip4}
2200 | | ... | ${dut2_to_tg_ip4} | ${prefix4}
2201 | | Configure LISP GPE topology in 3-node circular topology
2202 | | ... | ${dut1} | ${dut1_if2} | ${NONE}
2203 | | ... | ${dut2} | ${dut2_if1} | ${NONE}
2204 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
2205 | | ... | ${dut1_ip4_static_adjacency} | ${dut2_ip4_static_adjacency}
2206 | | Configure manual keyed connection for IPSec
2207 | | ... | ${dut1} | ${dut1_if2} | ${encr_alg} | ${encr_key}
2208 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
2209 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
2210 | | Configure manual keyed connection for IPSec
2211 | | ... | ${dut2} | ${dut2_if1} | ${encr_alg} | ${encr_key}
2212 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
2213 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
2214
2215 | Initialize LISP IPv6 forwarding in 3-node circular topology
2216 | | [Documentation] | Custom setup of IPv6 topology on all DUT nodes \
2217 | | ... | Don`t set route.
2218 | | ...
2219 | | ... | *Arguments:*
2220 | | ... | -${dut1_dut2_address} - Ip address from DUT1 to DUT2. Type: string
2221 | | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string
2222 | | ... | -${dut2_dut1_address} - Ip address from DUT2 to DUT1. Type: string
2223 | | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string
2224 | | ... | -${duts_prefix} - ip prefix. Type: int
2225 | | ...
2226 | | ... | *Return:*
2227 | | ... | - No value returned
2228 | | ...
2229 | | ... | *Example:*
2230 | | ... | \| Initialize LISP IPv6 forwarding in 3-node circular topology \
2231 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
2232 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
2233 | | ...
2234 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
2235 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${prefix}
2236 | | ...
2237 | | Set interfaces in path up
2238 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2239 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2240 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2241 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2242 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_tg_address}
2243 | | ... | ${prefix}
2244 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_dut2_address}
2245 | | ... | ${prefix}
2246 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_dut1_address}
2247 | | ... | ${prefix}
2248 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_tg_address}
2249 | | ... | ${prefix}
2250 | | Suppress ICMPv6 router advertisement message | ${nodes}
2251 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
2252 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
2253 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_dut1_address}
2254 | | ... | ${dut2_if1_mac}
2255 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_dut2_address}
2256 | | ... | ${dut1_if2_mac}
2257
2258 | Initialize LISP IPv4 over IPv6 forwarding in 3-node circular topology
2259 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
2260 | | ... | Don`t set route.
2261 | | ...
2262 | | ... | *Arguments:*
2263 | | ... | - ${dut1_dut2_ip6_address} - IPv6 address from DUT1 to DUT2.
2264 | | ... | Type: string
2265 | | ... | - ${dut1_tg_ip4_address} - IPv4 address from DUT1 to tg. Type: string
2266 | | ... | - ${dut2_dut1_ip6_address} - IPv6 address from DUT2 to DUT1.
2267 | | ... | Type: string
2268 | | ... | - ${dut1_tg_ip4_address} - IPv4 address from DUT1 to tg. Type: string
2269 | | ... | - ${prefix4} - IPv4 prefix. Type: int
2270 | | ... | - ${prefix6} - IPv6 prefix. Type: int
2271 | | ...
2272 | | ... | *Return:*
2273 | | ... | - No value returned
2274 | | ...
2275 | | ... | *Example:*
2276 | | ... | \| Lisp IPv4 over IPv6 forwarding initialized in a 3-node circular \
2277 | | ... | topology \| ${dut1_dut2_ip6_address} \| ${dut1_tg_ip4_address} \
2278 | | ... | \| ${dut2_dut1_ip6_address} \| ${dut2_tg_ip4_address} \
2279 | | ... | \| ${prefix4} \| ${prefix6} \|
2280 | | ...
2281 | | [Arguments] | ${dut1_dut2_ip6_address} | ${dut1_tg_ip4_address}
2282 | | ... | ${dut2_dut1_ip6_address} | ${dut2_tg_ip4_address}
2283 | | ... | ${prefix4} | ${prefix6}
2284 | | ...
2285 | | Set interfaces in path up
2286 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2287 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2288 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2289 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2290 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
2291 | | ... | ${dut1_tg_ip4_address} | ${prefix4}
2292 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_dut2_ip6_address}
2293 | | ... | ${prefix6}
2294 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_dut1_ip6_address}
2295 | | ... | ${prefix6}
2296 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2}
2297 | | ... | ${dut2_tg_ip4_address} | ${prefix4}
2298 | | Suppress ICMPv6 router advertisement message | ${nodes}
2299 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
2300 | | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
2301 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip6_address}
2302 | | ... | ${dut2_if1_mac}
2303 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip6_address}
2304 | | ... | ${dut1_if2_mac}
2305
2306 | Initialize LISP IPv6 over IPv4 forwarding in 3-node circular topology
2307 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
2308 | | ... | Don`t set route.
2309 | | ...
2310 | | ... | *Arguments:*
2311 | | ... | - ${dut1_dut2_ip4_address} - IPv4 address from DUT1 to DUT2.
2312 | | ... | Type: string
2313 | | ... | - ${dut1_tg_ip6_address} - IPv6 address from DUT1 to tg. Type: string
2314 | | ... | - ${dut2_dut1_ip4_address} - IPv4 address from DUT2 to DUT1.
2315 | | ... | Type: string
2316 | | ... | - ${dut1_tg_ip6_address} - IPv6 address from DUT1 to tg. Type: string
2317 | | ... | - ${prefix4} - IPv4 prefix. Type: int
2318 | | ... | - ${prefix6} - IPv6 prefix. Type: int
2319 | | ...
2320 | | ... | *Return:*
2321 | | ... | - No value returned
2322 | | ...
2323 | | ... | *Example:*
2324 | | ... | \| Lisp IPv6 over IPv4 forwarding initialized in a 3-node circular \
2325 | | ... | topology \| ${dut1_dut2_ip4_address} \| ${dut1_tg_ip6_address} \
2326 | | ... | \| ${dut2_dut1_ip4_address} \| ${dut2_tg_ip6_address} \
2327 | | ... | \| ${prefix6} \| ${prefix4} \|
2328 | | ...
2329 | | [Arguments] | ${dut1_dut2_ip4_address} | ${dut1_tg_ip6_address}
2330 | | ... | ${dut2_dut1_ip4_address} | ${dut2_tg_ip6_address}
2331 | | ... | ${prefix6} | ${prefix4}
2332 | | ...
2333 | | Set interfaces in path up
2334 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2335 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2336 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2337 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2338 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_tg_ip6_address}
2339 | | ... | ${prefix6}
2340 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
2341 | | ... | ${dut1_dut2_ip4_address} | ${prefix4}
2342 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
2343 | | ... | ${dut2_dut1_ip4_address} | ${prefix4}
2344 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_tg_ip6_address}
2345 | | ... | ${prefix6}
2346 | | Suppress ICMPv6 router advertisement message | ${nodes}
2347 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
2348 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
2349 | | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip4_address}
2350 | | ... | ${dut2_if1_mac}
2351 | | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip4_address}
2352 | | ... | ${dut1_if2_mac}
2353
2354 | Initialize NAT44 in 3-node circular topology
2355 | | [Documentation] | Initialization of 3-node topology with NAT44 between DUTs:
2356 | | ... | - set interfaces up
2357 | | ... | - set IP addresses
2358 | | ... | - set ARP
2359 | | ... | - create routes
2360 | | ... | - set NAT44 - only on DUT1
2361 | | ...
2362 | | Set interfaces in path up
2363 | | ...
2364 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 10.0.0.1 | 20
2365 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 11.0.0.1 | 20
2366 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 11.0.0.2 | 20
2367 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 12.0.0.1 | 20
2368 | | ...
2369 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2370 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2371 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2372 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2373 | | ...
2374 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.0.0.2 | ${tg_if1_mac}
2375 | | Add arp on dut | ${dut1} | ${dut1_if2} | 11.0.0.2 | ${dut2_if1_mac}
2376 | | Add arp on dut | ${dut2} | ${dut2_if1} | 11.0.0.1 | ${dut1_if2_mac}
2377 | | Add arp on dut | ${dut2} | ${dut2_if2} | 12.0.0.2 | ${tg_if2_mac}
2378 | | ...
2379 | | Vpp Route Add | ${dut1} | 12.0.0.2 | 32 | 11.0.0.2 | ${dut1_if2}
2380 | | Vpp Route Add | ${dut1} | 20.0.0.0 | 18 | 10.0.0.2 | ${dut1_if1}
2381 | | Vpp Route Add | ${dut2} | 12.0.0.0 | 24 | 12.0.0.2 | ${dut2_if2}
2382 | | Vpp Route Add | ${dut2} | 200.0.0.0 | 30 | 11.0.0.1 | ${dut2_if1}
2383 | | ...
2384 | | Configure inside and outside interfaces
2385 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if2}
2386 | | Configure deterministic mode for NAT44
2387 | | ... | ${dut1} | 20.0.0.0 | 18 | 200.0.0.0 | 30
2388
2389 | Initialize L2 xconnect with memif pairs on DUT node
2390 | | [Documentation]
2391 | | ... | Create pairs of Memif interfaces on DUT node. Cross connect each Memif
2392 | | ... | interface with one physical interface or virtual interface to create
2393 | | ... | a chain accross DUT node.
2394 | | ...
2395 | | ... | *Arguments:*
2396 | | ... | - ${dut} - DUT node. Type: dictionary
2397 | | ... | - ${count} - Number of memif pairs (containers). Type: integer
2398 | | ...
2399 | | ... | *Note:*
2400 | | ... | Socket paths for Memif are defined in following format:
2401 | | ... | - /tmp/memif-${dut}_VNF${number}-${sid}
2402 | | ...
2403 | | ... | KW uses test variable ${rxq_count_int} set by KW Add worker threads
2404 | | ... | and rxqueues to all DUTs
2405 | | ...
2406 | | ... | *Example:*
2407 | | ...
2408 | | ... | \| Initialize L2 xconnect with memif pairs on DUT node \| ${dut} \
2409 | | ... | \| ${1} \|
2410 | | ...
2411 | | [Arguments] | ${dut} | ${count}
2412 | | ...
2413 | | :FOR | ${number} | IN RANGE | 1 | ${count}+1
2414 | | | ${sock1}= | Set Variable | memif-${dut}_VNF
2415 | | | ${sock2}= | Set Variable | memif-${dut}_VNF
2416 | | | ${prev_index}= | Evaluate | ${number}-1
2417 | | | Set up memif interfaces on DUT node | ${nodes['${dut}']}
2418 | | | ... | ${sock1} | ${sock2} | ${number} | ${dut}-memif-${number}-if1
2419 | | | ... | ${dut}-memif-${number}-if2 | ${rxq_count_int} | ${rxq_count_int}
2420 | | | ${xconnect_if1}= | Set Variable If | ${number}==1 | ${${dut}_if1}
2421 | | | ... | ${${dut}-memif-${prev_index}-if2}
2422 | | | Configure L2XC | ${nodes['${dut}']} | ${xconnect_if1}
2423 | | | ... | ${${dut}-memif-${number}-if1}
2424 | | | Run Keyword If | ${number}==${count} | Configure L2XC
2425 | | | ... | ${nodes['${dut}']} | ${${dut}-memif-${number}-if2} | ${${dut}_if2}
2426
2427 | Initialize L2 xconnect with memif pairs
2428 | | [Documentation]
2429 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Cross
2430 | | ... | connect each Memif interface with one physical interface or virtual
2431 | | ... | interface to create a chain accross DUT node.
2432 | | ...
2433 | | ... | *Arguments:*
2434 | | ... | - ${count} - Number of memif pairs (containers). Type: integer
2435 | | ...
2436 | | ... | *Example:*
2437 | | ...
2438 | | ... | \| Initialize L2 xconnect with memif pairs \| ${1} \|
2439 | | ...
2440 | | [Arguments] | ${count}=${1}
2441 | | ...
2442 | | ${duts}= | Get Matches | ${nodes} | DUT*
2443 | | :FOR | ${dut} | IN | @{duts}
2444 | | | Initialize L2 xconnect with memif pairs on DUT node | ${dut} | ${count}
2445 | | Set interfaces in path up
2446 | | Show Memif on all DUTs | ${nodes}
2447
2448 | Initialize L2 Bridge Domain with memif pairs on DUT node
2449 | | [Documentation]
2450 | | ... | Create pairs of Memif interfaces on DUT node. Put each Memif interface
2451 | | ... | to separate L2 bridge domain with one physical or virtual interface
2452 | | ... | to create a chain accross DUT node.
2453 | | ...
2454 | | ... | *Arguments:*
2455 | | ... | - ${dut} - DUT node. Type: dictionary
2456 | | ... | - ${count} - Number of memif pairs (containers). Type: integer
2457 | | ...
2458 | | ... | *Note:*
2459 | | ... | Socket paths for Memif are defined in following format:
2460 | | ... | - /tmp/memif-${dut}_VNF${number}-${sid}
2461 | | ...
2462 | | ... | *Example:*
2463 | | ...
2464 | | ... | \| Initialize L2 Bridge Domain with memif pairs on DUT node \
2465 | | ... | \| ${dut} \| ${1} \|
2466 | | ...
2467 | | [Arguments] | ${dut} | ${count}
2468 | | ...
2469 | | ${bd_id2}= | Evaluate | ${count}+1
2470 | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1} | ${1}
2471 | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if2}
2472 | | ... | ${bd_id2}
2473 | | :FOR | ${number} | IN RANGE | 1 | ${count}+1
2474 | | | ${sock1}= | Set Variable | memif-${dut}_VNF
2475 | | | ${sock2}= | Set Variable | memif-${dut}_VNF
2476 | | | Set up memif interfaces on DUT node | ${nodes['${dut}']}
2477 | | | ... | ${sock1} | ${sock2} | ${number} | ${dut}-memif-${number}-if1
2478 | | | ... | ${dut}-memif-${number}-if2 | ${rxq_count_int} | ${rxq_count_int}
2479 | | | ${bd_id2}= | Evaluate | ${number}+1
2480 | | | Add interface to bridge domain | ${nodes['${dut}']}
2481 | | | ... | ${${dut}-memif-${number}-if1} | ${number}
2482 | | | Add interface to bridge domain | ${nodes['${dut}']}
2483 | | | ... | ${${dut}-memif-${number}-if2} | ${bd_id2}
2484
2485 | Initialize L2 Bridge Domain with memif pairs
2486 | | [Documentation]
2487 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
2488 | | ... | Memif interface to separate L2 bridge domain with one physical or
2489 | | ... | virtual interface to create a chain accross DUT node.
2490 | | ...
2491 | | ... | *Arguments:*
2492 | | ... | - ${count} - Number of memif pairs (containers). Type: integer
2493 | | ...
2494 | | ... | *Example:*
2495 | | ...
2496 | | ... | \| Initialize L2 Bridge Domain with memif pairs \| ${1} \|
2497 | | ...
2498 | | [Arguments] | ${count}=${1}
2499 | | ...
2500 | | ${duts}= | Get Matches | ${nodes} | DUT*
2501 | | :FOR | ${dut} | IN | @{duts}
2502 | | | Initialize L2 Bridge Domain with memif pairs on DUT node | ${dut}
2503 | | | ... | ${count}
2504 | | Set interfaces in path up
2505 | | Show Memif on all DUTs | ${nodes}
2506
2507 | Initialize L2 xconnect for single memif
2508 | | [Documentation]
2509 | | ... | Create single Memif interface on all defined VPP nodes. Cross
2510 | | ... | connect Memif interface with one physical interface.
2511 | | ...
2512 | | ... | *Arguments:*
2513 | | ... | - ${number} - Memif ID. Type: integer
2514 | | ...
2515 | | ... | *Note:*
2516 | | ... | Socket paths for Memif are defined in following format:
2517 | | ... | - /tmp/memif-DUT1_VNF${number}-${sid}
2518 | | ...
2519 | | ... | KW uses test variable ${rxq_count_int} set by KW Add worker threads
2520 | | ... | and rxqueues to all DUTs
2521 | | ...
2522 | | ... | *Example:*
2523 | | ...
2524 | | ... | \| Initialize L2 xconnect for single memif \| 1 \|
2525 | | ...
2526 | | [Arguments] | ${number}=${1}
2527 | | ...
2528 | | ${duts}= | Get Matches | ${nodes} | DUT*
2529 | | :FOR | ${dut} | IN | @{duts}
2530 | | | ${sock}= | Set Variable | memif-${dut}_VNF
2531 | | | Set up single memif interface on DUT node | ${nodes['${dut}']} | ${sock}
2532 | | | ... | ${number} | ${dut}-memif-${number}-if1 | ${rxq_count_int}
2533 | | | ... | ${rxq_count_int}
2534 | | | Configure L2XC | ${nodes['${dut}']} | ${${dut}_if1}
2535 | | | ... | ${${dut}-memif-${number}-if1}
2536 | | Set interfaces in path up
2537 | | Show Memif on all DUTs | ${nodes}
2538
2539 | Initialize L2 Bridge Domain for single memif
2540 | | [Documentation]
2541 | | ... | Create single Memif interface on all defined VPP nodes. Put Memif
2542 | | ... | interface to separate L2 bridge domain with one physical interface.
2543 | | ...
2544 | | ... | *Arguments:*
2545 | | ... | - ${number} - Memif ID. Type: integer
2546 | | ...
2547 | | ... | *Note:*
2548 | | ... | Socket paths for Memif are defined in following format:
2549 | | ... | - /tmp/memif-DUT1_VNF${number}-${sid}
2550 | | ...
2551 | | ... | KW uses test variable ${rxq_count_int} set by KW Add worker threads
2552 | | ... | and rxqueues to all DUTs
2553 | | ...
2554 | | ... | *Example:*
2555 | | ...
2556 | | ... | \| Initialize L2 Bridge Domain for single memif \| 1 \|
2557 | | ...
2558 | | [Arguments] | ${number}=${1}
2559 | | ...
2560 | | ${duts}= | Get Matches | ${nodes} | DUT*
2561 | | :FOR | ${dut} | IN | @{duts}
2562 | | | ${sock}= | Set Variable | memif-${dut}_VNF
2563 | | | Set up single memif interface on DUT node | ${nodes['${dut}']} | ${sock}
2564 | | | ... | ${number} | ${dut}-memif-${number}-if1 | ${rxq_count_int}
2565 | | | ... | ${rxq_count_int}
2566 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1}
2567 | | | ... | ${number}
2568 | | | Add interface to bridge domain | ${nodes['${dut}']}
2569 | | | ... | ${${dut}-memif-${number}-if1} | ${number}
2570 | | Set interfaces in path up
2571 | | Show Memif on all DUTs | ${nodes}
2572
2573 | Configure ACLs on a single interface
2574 | | [Documentation]
2575 | | ... | Configure ACL
2576 | | ...
2577 | | ... | *Arguments:*
2578 | | ... | - dut - DUT node. Type: string
2579 | | ... | - dut_if - DUT node interface name. Type: string
2580 | | ... | - acl_apply_type - To what path apply the ACL - input or output.
2581 | | ... | - acl_action - Action for the rule - deny, permit, permit+reflect.
2582 | | ... | - subnets - Subnets to apply the specific ACL. Type: list
2583 | | ...
2584 | | ... | *Example:*
2585 | | ...
2586 | | ... | \| Configure ACLs on a single interface \| ${nodes['DUT1']}
2587 | | ... | \| ... \| GigabitEthernet0/7/0 \| input \| permit | 0.0.0.0/0
2588 | | ...
2589 | | [Arguments] | ${dut} | ${dut_if} | ${acl_apply_type} | ${acl_action}
2590 | | ... | @{subnets}
2591 | | Set Test variable | ${acl} | ${EMPTY}
2592 | | :FOR | ${subnet} | IN | @{subnets}
2593 | | | ${acl} = | Run Keyword If | '${acl}' == '${EMPTY}'
2594 | | | ... | Set Variable | ipv4 ${acl_action} src ${subnet}
2595 | | | ... | ELSE
2596 | | | ... | Catenate | SEPARATOR=, | ${acl}
2597 | | | ... | ipv4 ${acl_action} src ${subnet}
2598 | | Add Replace Acl Multi Entries | ${dut} | rules=${acl}
2599 | | @{acl_list} = | Create List | ${0}
2600 | | Set Acl List For Interface | ${dut} | ${dut_if} | ${acl_apply_type}
2601 | | ... | ${acl_list}