1 # Copyright (c) 2019 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
15 | Library | Collections
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/l2/tagging.robot
36 | Resource | resources/libraries/robot/overlay/srv6.robot
37 | Documentation | Performance suite keywords - configuration.
40 | Set interfaces in path up
42 | | ... | *Set UP state on VPP interfaces in path on all DUT nodes and set
43 | | ... | maximal MTU.*
45 # TODO: Rework KW to set all interfaces in path UP and set MTU (including
46 # software interfaces. Run KW at the start phase of VPP setup to split
47 # from other "functional" configuration. This will allow modularity of this
49 | | ${duts}= | Get Matches | ${nodes} | DUT*
50 | | :FOR | ${dut} | IN | @{duts}
51 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
52 | | | ... | Variable Should Exist | ${${dut}_if1}
53 | | | Run Keyword If | '${if1_status}' == 'PASS'
54 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1} | up
56 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_1} | up
57 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
58 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_2} | up
59 | | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
60 | | | ... | Variable Should Exist | ${${dut}_if2}
61 | | | Run Keyword If | '${if2_status}' == 'PASS'
62 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2} | up
64 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2_1} | up
65 | | | Run Keyword Unless | '${if2_status}' == 'PASS'
66 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2_2} | up
67 | | All VPP Interfaces Ready Wait | ${nodes}
68 | | ${duts}= | Get Matches | ${nodes} | DUT*
69 | | :FOR | ${dut} | IN | @{duts}
70 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
71 | | | ... | Variable Should Exist | ${${dut}_if1}
72 | | | Run Keyword If | '${if1_status}' == 'PASS'
73 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1}
75 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_1}
76 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
77 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_2}
78 | | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
79 | | | ... | Variable Should Exist | ${${dut}_if2}
80 | | | Run Keyword If | '${if2_status}' == 'PASS'
81 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2}
83 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2_1}
84 | | | Run Keyword Unless | '${if2_status}' == 'PASS'
85 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2_2}
86 | | All VPP Interfaces Ready Wait | ${nodes}
88 | Set single interfaces in path up
90 | | ... | *Set UP state on single VPP interfaces in path on all DUT nodes and set
91 | | ... | maximal MTU.*
93 # TODO: Rework KW to set all interfaces in path UP and set MTU (including
94 # software interfaces. Run KW at the start phase of VPP setup to split
95 # from other "functional" configuration. This will allow modularity of this
97 | | ${duts}= | Get Matches | ${nodes} | DUT*
98 | | :FOR | ${dut} | IN | @{duts}
99 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
100 | | | ... | Variable Should Exist | ${${dut}_if1}
101 | | | Run Keyword If | '${if1_status}' == 'PASS'
102 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1} | up
104 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_1} | up
105 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
106 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_2} | up
107 | | All VPP Interfaces Ready Wait | ${nodes}
108 | | ${duts}= | Get Matches | ${nodes} | DUT*
109 | | :FOR | ${dut} | IN | @{duts}
110 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
111 | | | ... | Variable Should Exist | ${${dut}_if1}
112 | | | Run Keyword If | '${if1_status}' == 'PASS'
113 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1}
115 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_1}
116 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
117 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_2}
118 | | All VPP Interfaces Ready Wait | ${nodes}
120 | Initialize AVF interfaces
122 | | ... | Initialize AVF interfaces on each DUT. Interfaces are brought up.
124 | | ${duts}= | Get Matches | ${nodes} | DUT*
125 | | :FOR | ${dut} | IN | @{duts}
126 | | | ${if1_pci}= | Get Interface PCI Addr | ${nodes['${dut}']}
127 | | | ... | ${${dut}_if1_vf0}
128 | | | ${if2_pci}= | Get Interface PCI Addr | ${nodes['${dut}']}
129 | | | ... | ${${dut}_if2_vf0}
130 | | | ${dut_eth_vf_if1}= | VPP Create AVF Interface | ${nodes['${dut}']}
131 | | | ... | ${if1_pci} | ${rxq_count_int}
132 | | | ${dut_eth_vf_if2}= | VPP Create AVF Interface | ${nodes['${dut}']}
133 | | | ... | ${if2_pci} | ${rxq_count_int}
134 | | | Set Test Variable | ${${dut}_if1} | ${dut_eth_vf_if1}
135 | | | Set Test Variable | ${${dut}_if2} | ${dut_eth_vf_if2}
136 | | Set interfaces in path up
138 | Initialize IPSec in 3-node circular topology
140 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
141 | | ... | topology. Get the interface MAC addresses and setup ARP on all VPP
142 | | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG and
143 | | ... | DUT1-DUT2 links. Set routing for encrypted traffic on both DUT nodes
144 | | ... | with prefix /8 and next hop of neighbour DUT or TG interface IPv4
147 | | Set interfaces in path up
148 | | VPP Show Crypto Device Mapping | ${dut1}
149 | | VPP Show Crypto Device Mapping | ${dut2}
150 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
151 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
152 | | ${dut1_if1_mac}= | Get Interface MAC | ${dut1} | ${dut1_if1}
153 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
154 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
155 | | ${dut2_if2_mac}= | Get Interface MAC | ${dut2} | ${dut2_if2}
156 | | Set Test Variable | ${tg_if1_mac}
157 | | Set Test Variable | ${tg_if2_mac}
158 | | Set Test Variable | ${dut1_if1_mac}
159 | | Set Test Variable | ${dut1_if2_mac}
160 | | Set Test Variable | ${dut2_if1_mac}
161 | | Set Test Variable | ${dut2_if2_mac}
162 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
163 | | ... | ${dut1_if1_ip4} | 24
164 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
165 | | ... | ${dut1_if2_ip4} | 24
166 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
167 | | ... | ${dut2_if1_ip4} | 24
168 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2}
169 | | ... | ${dut2_if2_ip4} | 24
170 | | Add arp on dut | ${dut1} | ${dut1_if1} | ${tg_if1_ip4} | ${tg_if1_mac}
171 | | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_if1_ip4} | ${dut2_if1_mac}
172 | | Add arp on dut | ${dut2} | ${dut2_if2} | ${tg_if2_ip4} | ${tg_if2_mac}
173 | | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_if2_ip4} | ${dut1_if2_mac}
174 | | Vpp Route Add | ${dut1} | ${laddr_ip4} | 8 | gateway=${tg_if1_ip4}
175 | | ... | interface=${dut1_if1}
176 | | Vpp Route Add | ${dut2} | ${raddr_ip4} | 8 | gateway=${tg_if2_ip4}
177 | | ... | interface=${dut2_if2}
179 | Initialize IPv4 forwarding in circular topology
181 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node
182 | | ... | circular topology. Get the interface MAC addresses and setup ARP on
183 | | ... | all VPP interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG
184 | | ... | links. In case of 3-node topology setup IPv4 adresses with /30 prefix
185 | | ... | on DUT1-DUT2 link and set routing on both DUT nodes with prefix /24
186 | | ... | and next hop of neighbour DUT interface IPv4 address.
188 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
189 | | ... | Variable Should Exist | ${dut2}
191 | | Set interfaces in path up
193 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
194 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
195 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
196 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
197 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
198 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
200 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
201 | | Run Keyword If | '${dut2_status}' == 'PASS'
202 | | ... | Add arp on dut | ${dut1} | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
203 | | Run Keyword If | '${dut2_status}' == 'PASS'
204 | | ... | Add arp on dut | ${dut2} | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
205 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
206 | | ... | Set Variable | ${dut2}
207 | | ... | ELSE | Set Variable | ${dut1}
208 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
209 | | ... | Set Variable | ${dut2_if2}
210 | | ... | ELSE | Set Variable | ${dut1_if2}
211 | | Add arp on dut | ${dut} | ${dut_if2} | 20.20.20.2 | ${tg1_if2_mac}
213 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
214 | | ... | 10.10.10.1 | 24
215 | | Run Keyword If | '${dut2_status}' == 'PASS'
216 | | ... | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
217 | | ... | 1.1.1.1 | 30
218 | | Run Keyword If | '${dut2_status}' == 'PASS'
219 | | ... | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
220 | | ... | 1.1.1.2 | 30
221 | | Configure IP addresses on interfaces | ${dut} | ${dut_if2}
222 | | ... | 20.20.20.1 | 24
224 | | Run Keyword If | '${dut2_status}' == 'PASS'
225 | | ... | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | gateway=1.1.1.2
226 | | ... | interface=${dut1_if2}
227 | | Run Keyword If | '${dut2_status}' == 'PASS'
228 | | ... | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=1.1.1.1
229 | | ... | interface=${dut2_if1}
231 | Initialize IPv4 forwarding with scaling in circular topology
233 | | ... | Custom setup of IPv4 topology with scalability of ip routes on all
234 | | ... | DUT nodes in 2-node / 3-node circular topology
236 | | ... | *Arguments:*
237 | | ... | - count - IP route count. Type: integer
240 | | ... | - No value returned
244 | | ... | \| Initialize IPv4 forwarding with scaling in 3-node circular \
245 | | ... | topology \| 100000 \|
247 | | [Arguments] | ${count}
249 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
250 | | ... | Variable Should Exist | ${dut2}
252 | | Set interfaces in path up
254 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
255 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
256 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
257 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
258 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
259 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
260 | | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac}
261 | | Run Keyword If | '${dut2_status}' == 'PASS'
262 | | ... | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac}
263 | | Run Keyword If | '${dut2_status}' == 'PASS'
264 | | ... | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac}
265 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
266 | | ... | Set Variable | ${dut2}
267 | | ... | ELSE | Set Variable | ${dut1}
268 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
269 | | ... | Set Variable | ${dut2_if2}
270 | | ... | ELSE | Set Variable | ${dut1_if2}
271 | | Add arp on dut | ${dut} | ${dut_if2} | 3.3.3.1 | ${tg1_if2_mac}
272 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30
273 | | Run Keyword If | '${dut2_status}' == 'PASS'
274 | | ... | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1
276 | | Run Keyword If | '${dut2_status}' == 'PASS'
277 | | ... | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2
279 | | Configure IP addresses on interfaces | ${dut} | ${dut_if2} | 3.3.3.2 | 30
280 | | Vpp Route Add | ${dut1} | 10.0.0.0 | 32 | gateway=1.1.1.1
281 | | ... | interface=${dut1_if1} | count=${count}
282 | | Run Keyword If | '${dut2_status}' == 'PASS'
283 | | ... | Vpp Route Add | ${dut1} | 20.0.0.0 | 32 | gateway=2.2.2.2
284 | | ... | interface=${dut1_if2} | count=${count}
285 | | Run Keyword If | '${dut2_status}' == 'PASS'
286 | | ... | Vpp Route Add | ${dut2} | 10.0.0.0 | 32 | gateway=2.2.2.1
287 | | ... | interface=${dut2_if1} | count=${count}
288 | | Vpp Route Add | ${dut} | 20.0.0.0 | 32 | gateway=3.3.3.1
289 | | ... | interface=${dut_if2} | count=${count}
291 | Initialize IPv4 forwarding with vhost in 2-node circular topology
293 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
294 | | ... | VPP node. Set UP state of all VPP interfaces in path. Create
295 | | ... | vm_count+1 FIB tables on DUT with multipath routing. Assign each
296 | | ... | Virtual interface to FIB table with Physical interface or Virtual
297 | | ... | interface on both nodes. Setup IPv4 addresses with /30 prefix on
298 | | ... | DUT-TG links. Set routing on DUT nodes in all FIB tables with prefix
299 | | ... | /24 and next hop of neighbour IPv4 address. Setup ARP on all VPP
300 | | ... | interfaces.
302 | | ... | *Arguments:*
303 | | ... | - vm_count - Number of guest VMs. Type: integer
306 | | ... | Socket paths for VM are defined in following format:
307 | | ... | - /tmp/sock-${VM_ID}-1
308 | | ... | - /tmp/sock-${VM_ID}-2
312 | | ... | \| IPv4 forwarding with Vhost-User initialized in a 2-node circular\
313 | | ... | topology \| 1 \|
315 | | [Arguments] | ${vm_count}=${1}
317 | | Set interfaces in path up
318 | | ${fib_table_1}= | Set Variable | ${101}
319 | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${vm_count}
320 | | Add Fib Table | ${dut1} | ${fib_table_1}
321 | | And Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | vrf=${fib_table_1}
322 | | ... | gateway=1.1.1.2 | interface=${dut1_if1} | multipath=${TRUE}
323 | | Add Fib Table | ${dut1} | ${fib_table_2}
324 | | And Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | vrf=${fib_table_2}
325 | | ... | gateway=2.2.2.2 | interface=${dut1_if2} | multipath=${TRUE}
326 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if1} | ${fib_table_1}
327 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if2} | ${fib_table_2}
328 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30
329 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30
330 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
331 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
332 | | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac}
333 | | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${tg1_if2_mac}
334 | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | gateway=1.1.1.1
335 | | ... | interface=${dut1_if1} | vrf=${fib_table_1}
336 | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | gateway=2.2.2.2
337 | | ... | interface=${dut1_if2} | vrf=${fib_table_2}
338 | | ${ip_base_start}= | Set Variable | ${4}
339 | | :FOR | ${number} | IN RANGE | 1 | ${vm_count}+1
340 | | | ${sock1}= | Set Variable | /var/run/vpp/sock-${number}-1
341 | | | ${sock2}= | Set Variable | /var/run/vpp/sock-${number}-2
342 | | | ${fib_table_1}= | Evaluate | ${100}+${number}
343 | | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${1}
344 | | | ${ip_base_vif1}= | Evaluate | ${ip_base_start}+(${number}-1)*2
345 | | | ${ip_base_vif2}= | Evaluate | ${ip_base_vif1}+1
346 | | | ${ip_net_vif1}= | Set Variable
347 | | | ... | ${ip_base_vif1}.${ip_base_vif1}.${ip_base_vif1}
348 | | | ${ip_net_vif2}= | Set Variable
349 | | | ... | ${ip_base_vif2}.${ip_base_vif2}.${ip_base_vif2}
350 | | | Configure vhost interfaces for L2BD forwarding | ${dut1}
351 | | | ... | ${sock1} | ${sock2} | dut1-vhost-${number}-if1
352 | | | ... | dut1-vhost-${number}-if2
353 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if1} | up
354 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if2} | up
355 | | | Add Fib Table | ${dut1} | ${fib_table_1}
356 | | | And Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | vrf=${fib_table_1}
357 | | | ... | gateway=${ip_net_vif1}.1 | interface=${dut1-vhost-${number}-if1}
358 | | | ... | multipath=${TRUE}
359 | | | Add Fib Table | ${dut1} | ${fib_table_2}
360 | | | And Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | vrf=${fib_table_2}
361 | | | ... | gateway=${ip_net_vif2}.2 | interface=${dut1-vhost-${number}-if2}
362 | | | ... | multipath=${TRUE}
363 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if1}
364 | | | ... | ${fib_table_1}
365 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if2}
366 | | | ... | ${fib_table_2}
367 | | | Configure IP addresses on interfaces
368 | | | ... | ${dut1} | ${dut1-vhost-${number}-if1} | ${ip_net_vif1}.1 | 30
369 | | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | ${ip_net_vif2}.1 | 30
370 | | | ${dut1_vif1_idx}= | Get Interface SW Index | ${dut1}
371 | | | ... | ${dut1-vhost-${number}-if1}
372 | | | ${dut1_vif2_idx}= | Get Interface SW Index | ${dut1}
373 | | | ... | ${dut1-vhost-${number}-if2}
374 | | | ${dut1_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut1}
375 | | | ... | ${dut1_vif1_idx}
376 | | | ${dut1_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut1}
377 | | | ... | ${dut1_vif2_idx}
378 | | | Set Test Variable | ${dut1-vhost-${number}-if1_mac}
379 | | | ... | ${dut1_vif1_mac}
380 | | | Set Test Variable | ${dut1-vhost-${number}-if2_mac}
381 | | | ... | ${dut1_vif2_mac}
382 | | | ${qemu_id}= | Set Variable If | ${number} < 10 | 0${number}
383 | | | ... | ${number}
384 | | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if1}
385 | | | ... | ${ip_net_vif1}.2 | 52:54:00:00:${qemu_id}:01
386 | | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if2}
387 | | | ... | ${ip_net_vif2}.2 | 52:54:00:00:${qemu_id}:02
388 | | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | gateway=${ip_net_vif1}.2
389 | | | ... | interface=${dut1-vhost-${number}-if1} | vrf=${fib_table_1}
390 | | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | gateway=${ip_net_vif2}.2
391 | | | ... | interface=${dut1-vhost-${number}-if2} | vrf=${fib_table_2}
393 | Initialize IPv4 forwarding with vhost in 3-node circular topology
395 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on all
396 | | ... | VPP nodes. Set UP state of all VPP interfaces in path. Create
397 | | ... | vm_count+1 FIB tables on each DUT with multipath routing. Assign
398 | | ... | each Virtual interface to FIB table with Physical interface or Virtual
399 | | ... | interface on both nodes. Setup IPv4 addresses with /30 prefix on
400 | | ... | DUT-TG links and /30 prefix on DUT1-DUT2 link. Set routing on all DUT
401 | | ... | nodes in all FIB tables with prefix /24 and next hop of neighbour IPv4
402 | | ... | address. Setup ARP on all VPP interfaces.
404 | | ... | *Arguments:*
405 | | ... | - vm_count - Number of guest VMs. Type: integer
408 | | ... | Socket paths for VM are defined in following format:
409 | | ... | - /tmp/sock-\${VM_ID}-1
410 | | ... | - /tmp/sock-\${VM_ID}-2
414 | | ... | \| IPv4 forwarding with Vhost-User initialized in a 3-node circular\
415 | | ... | topology \| 1 \|
417 | | [Arguments] | ${vm_count}=${1}
419 | | Set interfaces in path up
420 | | ${fib_table_1}= | Set Variable | ${101}
421 | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${vm_count}
422 | | Add Fib Table | ${dut1} | ${fib_table_1}
423 | | And Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | vrf=${fib_table_1}
424 | | ... | gateway=1.1.1.2 | interface=${dut1_if1} | multipath=${TRUE}
425 | | Add Fib Table | ${dut1} | ${fib_table_2}
426 | | And Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | vrf=${fib_table_2}
427 | | ... | gateway=2.2.2.2 | interface=${dut1_if2} | multipath=${TRUE}
428 | | Add Fib Table | ${dut2} | ${fib_table_1}
429 | | And Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | vrf=${fib_table_1}
430 | | ... | gateway=2.2.2.1 | interface=${dut2_if1} | multipath=${TRUE}
431 | | Add Fib Table | ${dut2} | ${fib_table_2}
432 | | And Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | vrf=${fib_table_2}
433 | | ... | gateway=3.3.3.2 | interface=${dut2_if2} | multipath=${TRUE}
434 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if1} | ${fib_table_1}
435 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if2} | ${fib_table_2}
436 | | Assign Interface To Fib Table | ${dut2} | ${dut2_if1} | ${fib_table_1}
437 | | Assign Interface To Fib Table | ${dut2} | ${dut2_if2} | ${fib_table_2}
438 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30
439 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30
440 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2 | 30
441 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 3.3.3.1 | 30
442 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
443 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
444 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
445 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
446 | | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac}
447 | | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac}
448 | | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac}
449 | | Add arp on dut | ${dut2} | ${dut2_if2} | 3.3.3.2 | ${tg1_if2_mac}
450 | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | gateway=1.1.1.1
451 | | ... | interface=${dut1_if1} | vrf=${fib_table_1}
452 | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | gateway=2.2.2.2
453 | | ... | interface=${dut1_if2} | vrf=${fib_table_2}
454 | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=2.2.2.1
455 | | ... | interface=${dut2_if1} | vrf=${fib_table_1}
456 | | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | gateway=3.3.3.2
457 | | ... | interface=${dut2_if2} | vrf=${fib_table_2}
458 | | ${ip_base_start}= | Set Variable | ${4}
459 | | :FOR | ${number} | IN RANGE | 1 | ${vm_count}+1
460 | | | ${sock1}= | Set Variable | /var/run/vpp/sock-${number}-1
461 | | | ${sock2}= | Set Variable | /var/run/vpp/sock-${number}-2
462 | | | ${fib_table_1}= | Evaluate | ${100}+${number}
463 | | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${1}
464 | | | ${ip_base_vif1}= | Evaluate | ${ip_base_start}+(${number}-1)*2
465 | | | ${ip_base_vif2}= | Evaluate | ${ip_base_vif1}+1
466 | | | ${ip_net_vif1}= | Set Variable
467 | | | ... | ${ip_base_vif1}.${ip_base_vif1}.${ip_base_vif1}
468 | | | ${ip_net_vif2}= | Set Variable
469 | | | ... | ${ip_base_vif2}.${ip_base_vif2}.${ip_base_vif2}
470 | | | Configure vhost interfaces for L2BD forwarding | ${dut1}
471 | | | ... | ${sock1} | ${sock2} | dut1-vhost-${number}-if1
472 | | | ... | dut1-vhost-${number}-if2
473 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if1} | up
474 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if2} | up
475 | | | Configure vhost interfaces for L2BD forwarding | ${dut2}
476 | | | ... | ${sock1} | ${sock2} | dut2-vhost-${number}-if1
477 | | | ... | dut2-vhost-${number}-if2
478 | | | Set Interface State | ${dut2} | ${dut2-vhost-${number}-if1} | up
479 | | | Set Interface State | ${dut2} | ${dut2-vhost-${number}-if2} | up
480 | | | Add Fib Table | ${dut1} | ${fib_table_1}
481 | | | And Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | vrf=${fib_table_1}
482 | | | ... | gateway=${ip_net_vif1}.1 | interface=${dut1-vhost-${number}-if1}
483 | | | ... | multipath=${TRUE}
484 | | | Add Fib Table | ${dut1} | ${fib_table_2}
485 | | | And Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | vrf=${fib_table_2}
486 | | | ... | gateway=${ip_net_vif2}.2 | interface=${dut1-vhost-${number}-if2}
487 | | | ... | multipath=${TRUE}
488 | | | Add Fib Table | ${dut2} | ${fib_table_1}
489 | | | And Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | vrf=${fib_table_1}
490 | | | ... | gateway=${ip_net_vif1}.1 | interface=${dut2-vhost-${number}-if1}
491 | | | ... | multipath=${TRUE}
492 | | | Add Fib Table | ${dut2} | ${fib_table_2}
493 | | | And Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | vrf=${fib_table_2}
494 | | | ... | gateway=${ip_net_vif2}.2 | interface=${dut2-vhost-${number}-if2}
495 | | | ... | multipath=${TRUE}
496 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if1}
497 | | | ... | ${fib_table_1}
498 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if2}
499 | | | ... | ${fib_table_2}
500 | | | Assign Interface To Fib Table | ${dut2} | ${dut2-vhost-${number}-if1}
501 | | | ... | ${fib_table_1}
502 | | | Assign Interface To Fib Table | ${dut2} | ${dut2-vhost-${number}-if2}
503 | | | ... | ${fib_table_2}
504 | | | Configure IP addresses on interfaces
505 | | | ... | ${dut1} | ${dut1-vhost-${number}-if1} | ${ip_net_vif1}.1 | 30
506 | | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | ${ip_net_vif2}.1 | 30
507 | | | ... | ${dut2} | ${dut2-vhost-${number}-if1} | ${ip_net_vif1}.1 | 30
508 | | | ... | ${dut2} | ${dut2-vhost-${number}-if2} | ${ip_net_vif2}.1 | 30
509 | | | ${dut1_vif1_idx}= | Get Interface SW Index | ${dut1}
510 | | | ... | ${dut1-vhost-${number}-if1}
511 | | | ${dut1_vif2_idx}= | Get Interface SW Index | ${dut1}
512 | | | ... | ${dut1-vhost-${number}-if2}
513 | | | ${dut2_vif1_idx}= | Get Interface SW Index | ${dut2}
514 | | | ... | ${dut2-vhost-${number}-if1}
515 | | | ${dut2_vif2_idx}= | Get Interface SW Index | ${dut2}
516 | | | ... | ${dut2-vhost-${number}-if2}
517 | | | ${dut1_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut1}
518 | | | ... | ${dut1_vif1_idx}
519 | | | ${dut1_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut1}
520 | | | ... | ${dut1_vif2_idx}
521 | | | ${dut2_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut2}
522 | | | ... | ${dut2_vif1_idx}
523 | | | ${dut2_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut2}
524 | | | ... | ${dut2_vif2_idx}
525 | | | Set Test Variable | ${dut1-vhost-${number}-if1_mac}
526 | | | ... | ${dut1_vif1_mac}
527 | | | Set Test Variable | ${dut1-vhost-${number}-if2_mac}
528 | | | ... | ${dut1_vif2_mac}
529 | | | Set Test Variable | ${dut2-vhost-${number}-if1_mac}
530 | | | ... | ${dut2_vif1_mac}
531 | | | Set Test Variable | ${dut2-vhost-${number}-if2_mac}
532 | | | ... | ${dut2_vif2_mac}
533 | | | ${qemu_id}= | Set Variable If | ${number} < 10 | 0${number}
534 | | | ... | ${number}
535 | | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if1}
536 | | | ... | ${ip_net_vif1}.2 | 52:54:00:00:${qemu_id}:01
537 | | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if2}
538 | | | ... | ${ip_net_vif2}.2 | 52:54:00:00:${qemu_id}:02
539 | | | Add arp on dut | ${dut2} | ${dut2-vhost-${number}-if1}
540 | | | ... | ${ip_net_vif1}.2 | 52:54:00:00:${qemu_id}:01
541 | | | Add arp on dut | ${dut2} | ${dut2-vhost-${number}-if2}
542 | | | ... | ${ip_net_vif2}.2 | 52:54:00:00:${qemu_id}:02
543 | | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | gateway=${ip_net_vif1}.2
544 | | | ... | interface=${dut1-vhost-${number}-if1} | vrf=${fib_table_1}
545 | | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | gateway=${ip_net_vif2}.2
546 | | | ... | interface=${dut1-vhost-${number}-if2} | vrf=${fib_table_2}
547 | | | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | gateway=${ip_net_vif1}.2
548 | | | ... | interface=${dut2-vhost-${number}-if1} | vrf=${fib_table_1}
549 | | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=${ip_net_vif2}.2
550 | | | ... | interface=${dut2-vhost-${number}-if2} | vrf=${fib_table_2}
552 | Initialize IPv4 forwarding with VLAN dot1q sub-interfaces in circular topology
554 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node
555 | | ... | circular topology. In case of 3-node topology create VLAN
556 | | ... | sub-interfaces between DUTs. In case of 2-node topology create VLAN
557 | | ... | sub-interface on dut1-if2 interface. Get the interface MAC addresses
558 | | ... | and setup ARPs. Setup IPv4 addresses with /30 prefix on DUT-TG links
559 | | ... | and set routing with prefix /30. In case of 3-node set IPv4 adresses
560 | | ... | with /30 prefix on VLAN and set routing on both DUT nodes with prefix
561 | | ... | /30. Set next hop of neighbour DUT interface IPv4 address. All
562 | | ... | interfaces are brought up.
564 | | ... | *Arguments:*
565 | | ... | - tg_if1_net - TG interface 1 IP subnet used by traffic generator.
566 | | ... | Type: integer
567 | | ... | - tg_if2_net - TG interface 2 IP subnet used by traffic generator.
568 | | ... | Type: integer
569 | | ... | - subid - ID of the sub-interface to be created. Type: string
570 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
572 | | ... | _NOTE:_ This KW uses following test case variables:
573 | | ... | - dut1 - DUT1 node.
574 | | ... | - dut2 - DUT2 node.
575 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
576 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
580 | | ... | \| Initialize IPv4 forwarding with VLAN dot1q sub-interfaces\
581 | | ... | in circular topology \| 10.10.10.0 \| 20.20.20.0 \| 10 \| pop-1 \|
583 | | [Arguments] | ${tg_if1_net} | ${tg_if2_net} | ${subid} | ${tag_rewrite}
585 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
586 | | ... | Variable Should Exist | ${dut2}
588 | | Set interfaces in path up
590 | | Run Keyword If | '${dut2_status}' == 'PASS'
591 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
592 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
593 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
594 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
595 | | Run Keyword If | '${dut2_status}' == 'PASS'
596 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
597 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
598 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
599 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
601 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
602 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
603 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
604 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
605 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
606 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
607 | | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac}
608 | | Run Keyword If | '${dut2_status}' == 'PASS'
609 | | ... | Add arp on dut | ${dut1} | ${subif_index_1} | 2.2.2.2
610 | | ... | ${dut2_if1_mac}
611 | | Run Keyword If | '${dut2_status}' == 'PASS'
612 | | ... | Add arp on dut | ${dut2} | ${subif_index_2} | 2.2.2.1
613 | | ... | ${dut1_if2_mac}
614 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
615 | | ... | Set Variable | ${dut2}
616 | | ... | ELSE | Set Variable | ${dut1}
617 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
618 | | ... | Set Variable | ${dut2_if2}
619 | | ... | ELSE | Set Variable | ${subif_index_1}
620 | | Add arp on dut | ${dut} | ${dut_if2} | 3.3.3.1 | ${tg1_if2_mac}
621 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30
622 | | Run Keyword If | '${dut2_status}' == 'PASS'
623 | | ... | Configure IP addresses on interfaces | ${dut1} | ${subif_index_1}
624 | | ... | 2.2.2.1 | 30
625 | | Run Keyword If | '${dut2_status}' == 'PASS'
626 | | ... | Configure IP addresses on interfaces | ${dut2} | ${subif_index_2}
627 | | ... | 2.2.2.2 | 30
628 | | Configure IP addresses on interfaces | ${dut} | ${dut_if2} | 3.3.3.2 | 30
629 | | Vpp Route Add | ${dut1} | ${tg_if1_net} | 30 | gateway=1.1.1.1
630 | | ... | interface=${dut1_if1}
631 | | Run Keyword If | '${dut2_status}' == 'PASS'
632 | | ... | Vpp Route Add | ${dut1} | ${tg_if2_net} | 30 | gateway=2.2.2.2
633 | | ... | interface=${subif_index_1}
634 | | Run Keyword If | '${dut2_status}' == 'PASS'
635 | | ... | Vpp Route Add | ${dut2} | ${tg_if1_net} | 30 | gateway=2.2.2.1
636 | | ... | interface=${subif_index_2}
637 | | Vpp Route Add | ${dut} | ${tg_if2_net} | 30 | gateway=3.3.3.1
638 | | ... | interface=${dut_if2}
640 | Initialize IPv4 policer 2r3c-${t} in circular topology
642 | | ... | Setup of 2r3c color-aware or color-blind policer with dst ip match
643 | | ... | on all DUT nodes in 2-node / 3-node circular topology. Policer is
644 | | ... | applied on links TG - DUTx.
646 | | ${dscp}= | DSCP AF22
647 | | Policer Set Name | policer1
648 | | Policer Set CIR | ${cir}
649 | | Policer Set EIR | ${eir}
650 | | Policer Set CB | ${cb}
651 | | Policer Set EB | ${eb}
652 | | Policer Set Rate Type pps
653 | | Policer Set Round Type Closest
654 | | Policer Set Type 2R3C 2698
655 | | Policer Set Conform Action Transmit
656 | | Policer Set Exceed Action Mark and Transmit | ${dscp}
657 | | Policer Set Violate Action Transmit
658 | | Policer Enable Color Aware
659 | | Run Keyword If | ${t} == 'ca' | Policer Enable Color Aware
660 | | Policer Classify Set Precolor Exceed
661 | | Policer Set Node | ${dut1}
662 | | Policer Classify Set Interface | ${dut1_if1}
663 | | Policer Classify Set Match IP | 20.20.20.2 | ${False}
664 | | Policer Set Configuration
665 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
666 | | ... | Variable Should Exist | ${dut2}
667 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
668 | | ... | Set Variable | ${dut2}
669 | | ... | ELSE | Set Variable | ${dut1}
670 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
671 | | ... | Set Variable | ${dut2_if2}
672 | | ... | ELSE | Set Variable | ${dut1_if2}
673 | | Run Keyword Unless | '${dut2_status}' == 'PASS'
674 | | ... | Policer Set Name | policer2
675 | | Policer Set Node | ${dut}
676 | | Policer Classify Set Interface | ${dut_if2}
677 | | Policer Classify Set Match IP | 10.10.10.2 | ${False}
678 | | Policer Set Configuration
680 | Initialize IPv6 forwarding in 2-node circular topology
682 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node circular
683 | | ... | topology. Get the interface MAC addresses and setup neighbour on all
684 | | ... | VPP interfaces. Setup IPv6 addresses with /128 prefixes on all
685 | | ... | interfaces.
687 | | Set interfaces in path up
688 | | ${prefix}= | Set Variable | 64
689 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
690 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
691 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:1::1 | ${prefix}
692 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:2::1 | ${prefix}
693 | | Suppress ICMPv6 router advertisement message | ${nodes}
694 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
695 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:2::2 | ${tg1_if2_mac}
697 | Initialize IPv6 forwarding in 3-node circular topology
699 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
700 | | ... | topology. Get the interface MAC addresses and setup neighbour on all
701 | | ... | VPP interfaces. Setup IPv6 addresses with /128 prefixes on all
702 | | ... | interfaces. Set routing on both DUT nodes with prefix /64 and
703 | | ... | next hop of neighbour DUT interface IPv6 address.
705 | | Set interfaces in path up
706 | | ${prefix}= | Set Variable | 64
707 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
708 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
709 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
710 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
711 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:1::1 | ${prefix}
712 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:3::1 | ${prefix}
713 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:3::2 | ${prefix}
714 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | 2001:2::1 | ${prefix}
715 | | Suppress ICMPv6 router advertisement message | ${nodes}
716 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
717 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
718 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:3::2 | ${dut2_if1_mac}
719 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:3::1 | ${dut1_if2_mac}
720 | | Vpp Route Add | ${dut1} | 2001:2::0 | ${prefix} | gateway=2001:3::2
721 | | ... | interface=${dut1_if2}
722 | | Vpp Route Add | ${dut2} | 2001:1::0 | ${prefix} | gateway=2001:3::1
723 | | ... | interface=${dut2_if1}
725 | Initialize IPv6 forwarding with scaling in circular topology
727 | | ... | Custom setup of IPv6 topology with scalability of ip routes on all
728 | | ... | DUT nodes in 2-node / 3-node circular topology
730 | | ... | *Arguments:*
731 | | ... | - count - IP route count. Type: integer
734 | | ... | - No value returned
738 | | ... | \| Initialize IPv6 forwarding with scaling in circular \
739 | | ... | topology \| 100000 \|
741 | | [Arguments] | ${count}
743 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
744 | | ... | Variable Should Exist | ${dut2}
746 | | Set interfaces in path up
748 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
749 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
750 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
751 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
752 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
753 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
754 | | ${prefix}= | Set Variable | 64
755 | | ${host_prefix}= | Set Variable | 128
756 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:3::1 | ${prefix}
757 | | Run Keyword If | '${dut2_status}' == 'PASS'
758 | | ... | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:4::1 | ${prefix}
759 | | Run Keyword If | '${dut2_status}' == 'PASS'
760 | | ... | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:4::2 | ${prefix}
761 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
762 | | ... | Set Variable | ${dut2}
763 | | ... | ELSE | Set Variable | ${dut1}
764 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
765 | | ... | Set Variable | ${dut2_if2}
766 | | ... | ELSE | Set Variable | ${dut1_if2}
767 | | VPP Set If IPv6 Addr | ${dut} | ${dut_if2} | 2001:5::1 | ${prefix}
768 | | Suppress ICMPv6 router advertisement message | ${nodes}
769 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:3::2 | ${tg1_if1_mac}
770 | | Run Keyword If | '${dut2_status}' == 'PASS'
771 | | ... | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:4::2 | ${dut2_if1_mac}
772 | | Run Keyword If | '${dut2_status}' == 'PASS'
773 | | ... | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:4::1 | ${dut1_if2_mac}
774 | | Add Ip Neighbor | ${dut} | ${dut_if2} | 2001:5::2 | ${tg1_if2_mac}
775 | | Vpp Route Add | ${dut1} | 2001:1::0 | ${host_prefix} | gateway=2001:3::2
776 | | ... | interface=${dut1_if1} | count=${count}
777 | | Run Keyword If | '${dut2_status}' == 'PASS'
778 | | ... | Vpp Route Add | ${dut1} | 2001:2::0 | ${host_prefix}
779 | | ... | gateway=2001:4::2 | interface=${dut1_if2} | count=${count}
780 | | Run Keyword If | '${dut2_status}' == 'PASS'
781 | | ... | Vpp Route Add | ${dut2} | 2001:1::0 | ${host_prefix}
782 | | ... | gateway=2001:4::1 | interface=${dut2_if1} | count=${count}
783 | | Vpp Route Add | ${dut} | 2001:2::0 | ${host_prefix} | gateway=2001:5::2
784 | | ... | interface=${dut_if2} | count=${count}
786 | Initialize IPv6 forwarding with VLAN dot1q sub-interfaces in circular topology
788 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node
789 | | ... | circular topology. In case of 3-node topology create VLAN
790 | | ... | sub-interfaces between DUTs. In case of 2-node topology create VLAN
791 | | ... | sub-interface on dut1-if2 interface. Get the interface MAC addresses
792 | | ... | and setup ARPs. Setup IPv6 addresses with /64 prefix on DUT-TG links
793 | | ... | and set routing with prefix /64. In case of 3-node set IPv6 adresses
794 | | ... | with /64 prefix on VLAN and set routing on both DUT nodes with prefix
795 | | ... | /64. Set next hop of neighbour DUT interface IPv6 address. All
796 | | ... | interfaces are brought up.
798 | | ... | *Arguments:*
799 | | ... | - tg_if1_net - TG interface 1 IPv6 subnet used by traffic generator.
800 | | ... | Type: integer
801 | | ... | - tg_if2_net - TG interface 2 IPv6 subnet used by traffic generator.
802 | | ... | Type: integer
803 | | ... | - subid - ID of the sub-interface to be created. Type: string
804 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
806 | | ... | _NOTE:_ This KW uses following test case variables:
807 | | ... | - dut1 - DUT1 node.
808 | | ... | - dut2 - DUT2 node.
809 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
810 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
814 | | ... | \| Initialize IPv6 forwarding with VLAN dot1q sub-interfaces\
815 | | ... | in circular topology \| 2001:1::0 \| 2001:2::0 \| 10 \| pop-1 \|
817 | | [Arguments] | ${tg_if1_net} | ${tg_if2_net} | ${subid} | ${tag_rewrite}
819 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
820 | | ... | Variable Should Exist | ${dut2}
822 | | Set interfaces in path up
824 | | Run Keyword If | '${dut2_status}' == 'PASS'
825 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
826 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
827 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
828 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
829 | | Run Keyword If | '${dut2_status}' == 'PASS'
830 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
831 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
832 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
833 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
835 | | ${prefix}= | Set Variable | 64
836 | | ${host_prefix}= | Set Variable | 64
837 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
838 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
839 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
840 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
841 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
842 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
843 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2002:1::1 | ${tg1_if1_mac}
844 | | Run Keyword If | '${dut2_status}' == 'PASS'
845 | | ... | Add Ip Neighbor | ${dut1} | ${subif_index_1} | 2002:2::2
846 | | ... | ${dut2_if1_mac}
847 | | Run Keyword If | '${dut2_status}' == 'PASS'
848 | | ... | Add Ip Neighbor | ${dut2} | ${subif_index_2} | 2002:2::1
849 | | ... | ${dut1_if2_mac}
850 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
851 | | ... | Set Variable | ${dut2}
852 | | ... | ELSE | Set Variable | ${dut1}
853 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
854 | | ... | Set Variable | ${dut2_if2}
855 | | ... | ELSE | Set Variable | ${subif_index_1}
856 | | Add Ip Neighbor | ${dut} | ${dut_if2} | 2002:3::1 | ${tg1_if2_mac}
857 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2002:1::2 | ${prefix}
858 | | Run Keyword If | '${dut2_status}' == 'PASS'
859 | | ... | VPP Set If IPv6 Addr | ${dut1} | ${subif_index_1} | 2002:2::1
861 | | Run Keyword If | '${dut2_status}' == 'PASS'
862 | | ... | VPP Set If IPv6 Addr | ${dut2} | ${subif_index_2} | 2002:2::2
864 | | VPP Set If IPv6 Addr | ${dut} | ${dut_if2} | 2002:3::2 | ${prefix}
865 | | Suppress ICMPv6 router advertisement message | ${nodes}
866 | | Vpp Route Add | ${dut1} | ${tg_if1_net} | ${host_prefix}
867 | | ... | gateway=2002:1::1 | interface=${dut1_if1}
868 | | Run Keyword If | '${dut2_status}' == 'PASS'
869 | | ... | Vpp Route Add | ${dut1} | ${tg_if2_net} | ${host_prefix}
870 | | ... | gateway=2002:2::2 | interface=${subif_index_1}
871 | | Run Keyword If | '${dut2_status}' == 'PASS'
872 | | ... | Vpp Route Add | ${dut2} | ${tg_if1_net} | ${host_prefix}
873 | | ... | gateway=2002:2::1 | interface=${subif_index_2}
874 | | Vpp Route Add | ${dut} | ${tg_if2_net} | ${host_prefix}
875 | | ... | gateway=2002:3::1 | interface=${dut_if2}
877 | Initialize IPv6 iAcl whitelist in 3-node circular topology
879 | | ... | Creates classify L3 table on DUTs. IPv6 iAcl security whitelist
880 | | ... | ingress /64 filter entries applied on links TG - DUT1 and DUT2 - TG.
882 | | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3
883 | | ... | ${dut1} | ip6 | dst
884 | | And Vpp Configures Classify Session L3
885 | | ... | ${dut1} | permit | ${table_idx} | ${skip_n} | ${match_n}
886 | | ... | ip6 | dst | 2001:2::2
887 | | And Vpp Enable Input Acl Interface
888 | | ... | ${dut1} | ${dut1_if1} | ip6 | ${table_idx}
889 | | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3
890 | | ... | ${dut2} | ip6 | dst
891 | | And Vpp Configures Classify Session L3
892 | | ... | ${dut2} | permit | ${table_idx} | ${skip_n} | ${match_n}
893 | | ... | ip6 | dst | 2001:1::2
894 | | And Vpp Enable Input Acl Interface
895 | | ... | ${dut2} | ${dut2_if2} | ip6 | ${table_idx}
897 | Initialize IPv6 forwarding over SRv6 with encapsulation with '${n}' x SID '${prepos}' decapsulation in 3-node circular topology
899 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
900 | | ... | topology. Get the interface MAC addresses and setup neighbours on all
901 | | ... | VPP interfaces. Setup IPv6 addresses on all interfaces. Set segment
902 | | ... | routing for IPv6 for required number of SIDs and configure IPv6 routes
903 | | ... | on both DUT nodes.
905 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
906 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
907 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
908 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
909 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_if1_ip6} | ${prefix}
910 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_if2_ip6} | ${prefix}
911 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_if1_ip6} | ${prefix}
912 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_if2_ip6} | ${prefix}
913 | | Suppress ICMPv6 router advertisement message | ${nodes}
914 | | :FOR | ${number} | IN RANGE | 2 | ${dst_addr_nr}+2
915 | | | ${hexa_nr}= | Convert To Hex | ${number}
916 | | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | ${tg_if1_ip6_subnet}${hexa_nr}
917 | | | ... | ${tg1_if1_mac}
918 | | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | ${tg_if2_ip6_subnet}${hexa_nr}
919 | | | ... | ${tg1_if2_mac}
920 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_if1_ip6} | ${dut2_if1_mac}
921 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_if2_ip6} | ${dut1_if2_mac}
922 | | ${sid1}= | Set Variable If
923 | | ... | "${n}" == "1" | ${dut2_sid1}
924 | | ... | "${n}" == "2" | ${dut2_sid1_1}
925 | | ${sid2}= | Set Variable If
926 | | ... | "${n}" == "1" | ${dut1_sid2}
927 | | ... | "${n}" == "2" | ${dut1_sid2_1}
928 | | Vpp Route Add | ${dut1} | ${sid1} | ${sid_prefix} | gateway=${dut2_if1_ip6}
929 | | ... | interface=${dut1_if2}
930 | | Vpp Route Add | ${dut2} | ${sid2} | ${sid_prefix} | gateway=${dut1_if2_ip6}
931 | | ... | interface=${dut2_if1}
932 # Configure SRv6 for direction0
933 | | Set SR Encaps Source Address on DUT | ${dut1} | ${dut1_sid1}
934 | | @{sid_list_dir0}= | Run Keyword If | "${n}" == "1"
935 | | ... | Create List | ${dut2_sid1}
936 | | ... | ELSE IF | "${n}" == "2"
937 | | ... | Create List | ${dut2_sid1_1} | ${dut2_sid1_2}
938 | | Configure SR Policy on DUT | ${dut1} | ${dut1_bsid} | encap
939 | | ... | @{sid_list_dir0}
940 | | Configure SR Steer on DUT | ${dut1} | L3 | ${dut1_bsid}
941 | | ... | ip_addr=${tg_if2_ip6_subnet} | prefix=${sid_prefix}
942 | | Run Keyword If | "${n}" == "1"
943 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.dx6
944 | | ... | interface=${dut2_if2} | next_hop=${tg_if2_ip6_subnet}2
945 | | Run Keyword If | "${n}" == "2"
946 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1_1} | end
947 | | Run Keyword If | "${n}" == "2" and "${prepos}" != "without"
948 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1_2} | end.dx6
949 | | ... | interface=${dut2_if2} | next_hop=${tg_if2_ip6_subnet}2
950 | | Run Keyword If | "${n}" == "2" and "${prepos}" == "without"
951 | | ... | Vpp Route Add | ${dut2} | ${dut2_sid1_2} | ${sid_prefix}
952 | | ... | gateway=${tg_if2_ip6_subnet}2 | interface=${dut2_if2}
953 # Configure SRv6 for direction1
954 | | Set SR Encaps Source Address on DUT | ${dut2} | ${dut2_sid2}
955 | | @{sid_list_dir1}= | Run Keyword If | "${n}" == "1"
956 | | ... | Create List | ${dut1_sid2}
957 | | ... | ELSE IF | "${n}" == "2"
958 | | ... | Create List | ${dut1_sid2_1} | ${dut1_sid2_2}
959 | | Configure SR Policy on DUT | ${dut2} | ${dut2_bsid} | encap
960 | | ... | @{sid_list_dir1}
961 | | Configure SR Steer on DUT | ${dut2} | L3 | ${dut2_bsid}
962 | | ... | ip_addr=${tg_if1_ip6_subnet} | prefix=${sid_prefix}
963 | | Run Keyword If | "${n}" == "1"
964 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.dx6
965 | | ... | interface=${dut1_if1} | next_hop=${tg_if1_ip6_subnet}2
966 | | Run Keyword If | "${n}" == "2"
967 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2_1} | end
968 | | Run Keyword If | "${n}" == "2" and "${prepos}" != "without"
969 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2_2} | end.dx6
970 | | ... | interface=${dut1_if1} | next_hop=${tg_if1_ip6_subnet}2
971 | | Run Keyword If | "${n}" == "2" and "${prepos}" == "without"
972 | | ... | Vpp Route Add | ${dut1} | ${dut1_sid2_2} | ${sid_prefix}
973 | | ... | gateway=${tg_if1_ip6_subnet}2 | interface=${dut1_if1}
974 | | Set interfaces in path up
976 | Initialize IPv6 forwarding over SRv6 with endpoint to SR-unaware Service Function via '${behavior}' behaviour in 3-node circular topology
978 | | ... | Create pair of Memif interfaces on all defined VPP nodes. Set UP
979 | | ... | state on VPP interfaces in path on nodes in 3-node circular topology.
980 | | ... | Get the interface MAC addresses and setup neighbours on all VPP
981 | | ... | interfaces. Setup IPv6 addresses on all interfaces. Set segment
982 | | ... | routing for IPv6 with defined behaviour function and configure IPv6
983 | | ... | routes on both DUT nodes.
986 | | ... | KW uses test variable rxq_count_int set by KW Add worker threads
987 | | ... | and rxqueues to all DUTs
989 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
990 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
991 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
992 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
993 | | ${sock1}= | Set Variable | memif-DUT1_CNF
994 | | ${sock2}= | Set Variable | memif-DUT2_CNF
995 | | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock1}
996 | | ... | ${1} | dut1-memif-1-if1 | dut1-memif-1-if2 | ${rxq_count_int}
997 | | ... | ${rxq_count_int}
998 | | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if1}
999 | | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if2}
1000 | | Set up memif interfaces on DUT node | ${dut2} | ${sock2} | ${sock2}
1001 | | ... | ${1} | dut2-memif-1-if1 | dut2-memif-1-if2 | ${rxq_count_int}
1002 | | ... | ${rxq_count_int}
1003 | | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if1}
1004 | | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if2}
1005 | | ${duts}= | Get Matches | ${nodes} | DUT*
1006 | | :FOR | ${dut} | IN | @{duts}
1007 | | | Show Memif | ${nodes['${dut}']}
1008 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_if1_ip6} | ${prefix}
1009 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_if2_ip6} | ${prefix}
1010 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1-memif-1-if1}
1011 | | ... | ${dut1-memif-1-if1_ip6} | ${prefix}
1012 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1-memif-1-if2}
1013 | | ... | ${dut1-memif-1-if2_ip6} | ${prefix}
1014 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_if1_ip6} | ${prefix}
1015 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_if2_ip6} | ${prefix}
1016 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2-memif-1-if1}
1017 | | ... | ${dut2-memif-1-if1_ip6} | ${prefix}
1018 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2-memif-1-if2}
1019 | | ... | ${dut2-memif-1-if2_ip6} | ${prefix}
1020 | | Suppress ICMPv6 router advertisement message | ${nodes}
1021 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_if1_ip6} | ${dut2_if1_mac}
1022 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_if2_ip6} | ${dut1_if2_mac}
1023 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | ${tg_if1_ip6_subnet}2
1024 | | ... | ${tg1_if1_mac}
1025 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | ${tg_if2_ip6_subnet}2
1026 | | ... | ${tg1_if2_mac}
1027 | | ${dut1-memif-1-if2_mac}= | Get Interface MAC | ${dut1} | memif2
1028 | | ${dut2-memif-1-if2_mac}= | Get Interface MAC | ${dut2} | memif2
1029 | | Add Ip Neighbor | ${dut1} | ${dut1-memif-1-if1} | ${dut1_nh}
1030 | | ... | ${dut1-memif-1-if2_mac}
1031 | | Add Ip Neighbor | ${dut2} | ${dut2-memif-1-if1} | ${dut2_nh}
1032 | | ... | ${dut2-memif-1-if2_mac}
1033 | | Vpp Route Add | ${dut1} | ${dut2_sid1} | ${sid_prefix}
1034 | | ... | gateway=${dut2_if1_ip6} | interface=${dut1_if2}
1035 | | Vpp Route Add | ${dut1} | ${out_sid2_1} | ${sid_prefix}
1036 | | ... | gateway=${tg_if1_ip6_subnet}2 | interface=${dut1_if1}
1037 | | Vpp Route Add | ${dut2} | ${dut1_sid2} | ${sid_prefix}
1038 | | ... | gateway=${dut1_if2_ip6} | interface=${dut2_if1}
1039 | | Vpp Route Add | ${dut2} | ${out_sid1_1} | ${sid_prefix}
1040 | | ... | gateway=${tg_if2_ip6_subnet}2 | interface=${dut2_if2}
1041 # Configure SRv6 for direction0 on DUT1
1042 | | Set SR Encaps Source Address on DUT | ${dut1} | ${dut1_sid1}
1043 | | @{sid_list_dir0}= | Create List | ${dut2_sid1} | ${out_sid1_1}
1044 | | ... | ${out_sid1_2}
1045 | | Configure SR Policy on DUT | ${dut1} | ${dut1_bsid} | encap
1046 | | ... | @{sid_list_dir0}
1047 | | Configure SR Steer on DUT | ${dut1} | L3 | ${dut1_bsid}
1048 | | ... | ip_addr=${tg_if2_ip6_subnet} | prefix=${sid_prefix}
1049 # Configure SRv6 for direction1 on DUT2
1050 | | Set SR Encaps Source Address on DUT | ${dut2} | ${dut2_sid2}
1051 | | @{sid_list_dir1}= | Create List | ${dut1_sid2} | ${out_sid2_1}
1052 | | ... | ${out_sid2_2}
1053 | | Configure SR Policy on DUT | ${dut2} | ${dut2_bsid} | encap
1054 | | ... | @{sid_list_dir1}
1055 | | Configure SR Steer on DUT | ${dut2} | L3 | ${dut2_bsid}
1056 | | ... | ip_addr=${tg_if1_ip6_subnet} | prefix=${sid_prefix}
1057 # Configure SRv6 for direction0 on DUT2
1058 | | ${dut2_out_if}= | Get Interface Name | ${dut2} | memif1
1059 | | ${dut2_in_if}= | Get Interface Name | ${dut2} | memif2
1060 | | Remove Values From List | ${sid_list_dir0} | ${dut2_sid1}
1061 | | Run Keyword If | "${behavior}" == "static_proxy"
1062 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.as
1063 | | ... | ${NONE} | ${dut2_nh} | ${NONE} | ${dut2_out_if} | ${dut2_in_if}
1064 | | ... | ${dut1_sid1} | @{sid_list_dir0}
1065 | | ... | ELSE IF | "${behavior}" == "dynamic_proxy"
1066 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.ad
1067 | | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
1068 | | ... | ELSE IF | "${behavior}" == "masquerading"
1069 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.am
1070 | | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
1071 | | ... | ELSE | Fail | Unsupported behaviour: ${behavior}
1072 # Configure SRv6 for direction1 on DUT1
1073 | | ${dut1_out_if}= | Get Interface Name | ${dut1} | memif1
1074 | | ${dut1_in_if}= | Get Interface Name | ${dut1} | memif2
1075 | | Remove Values From List | ${sid_list_dir1} | ${dut1_sid2}
1076 | | Run Keyword If | "${behavior}" == "static_proxy"
1077 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.as
1078 | | ... | ${NONE} | ${dut1_nh} | ${NONE} | ${dut1_out_if} | ${dut1_in_if}
1079 | | ... | ${dut2_sid2} | @{sid_list_dir1}
1080 | | ... | ELSE IF | "${behavior}" == "dynamic_proxy"
1081 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.ad
1082 | | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
1083 | | ... | ELSE IF | "${behavior}" == "masquerading"
1084 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.am
1085 | | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
1086 | | ... | ELSE | Fail | Unsupported behaviour: ${behavior}
1087 | | Set interfaces in path up
1089 | Initialize L2 patch
1091 | | ... | Setup L2 patch topology by cross connecting two interfaces on
1092 | | ... | each DUT. Interfaces are brought up.
1094 | | Set interfaces in path up
1095 | | ${duts}= | Get Matches | ${nodes} | DUT*
1096 | | :FOR | ${dut} | IN | @{duts}
1097 | | | Configure L2patch | ${nodes['${dut}']} | ${${dut}_if1} | ${${dut}_if2}
1099 | Initialize L2 xconnect in 2-node circular topology
1101 | | ... | Setup L2 xconnect topology by cross connecting two interfaces on
1102 | | ... | each DUT. Interfaces are brought up.
1104 | | Set interfaces in path up
1105 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1_if2}
1107 | Initialize L2 xconnect in 3-node circular topology
1109 | | ... | Setup L2 xconnect topology by cross connecting two interfaces on
1110 | | ... | each DUT. Interfaces are brought up.
1112 | | Set interfaces in path up
1113 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1_if2}
1114 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
1116 | Initialize L2 xconnect with VXLANoIPv4 in 3-node circular topology
1118 | | ... | Setup L2 xconnect topology with VXLANoIPv4 by cross connecting
1119 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
1120 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
1121 | | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as
1122 | | ... | interfaces.
1124 | | Set interfaces in path up
1125 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1 | 24
1126 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2 | 24
1127 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1128 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1129 | | Add arp on dut | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac}
1130 | | Add arp on dut | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac}
1131 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
1132 | | ... | 172.16.0.1 | 172.16.0.2
1133 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1s_vxlan}
1134 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
1135 | | ... | 172.16.0.2 | 172.16.0.1
1136 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${dut2s_vxlan}
1138 | Initialize L2 xconnect with Vhost-User on node
1140 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
1141 | | ... | defined VPP node. Add each Vhost-User interface into L2 cross-connect
1142 | | ... | with with physical inteface or Vhost-User interface of another VM.
1144 | | ... | *Arguments:*
1145 | | ... | - dut - DUT node. Type: string
1146 | | ... | - vm_count - VM count. Type: integer
1149 | | ... | Socket paths for VM are defined in following format:
1150 | | ... | - /tmp/sock-\${VM_ID}-1
1151 | | ... | - /tmp/sock-\${VM_ID}-2
1153 | | ... | *Example:*
1155 | | ... | \| Initialize L2 xconnect with Vhost-User on node \| DUT1 \| 1 \|
1157 | | [Arguments] | ${dut} | ${vm_count}=${1}
1159 | | :FOR | ${number} | IN RANGE | 1 | ${vm_count}+1
1160 | | | ${sock1}= | Set Variable | /var/run/vpp/sock-${number}-1
1161 | | | ${sock2}= | Set Variable | /var/run/vpp/sock-${number}-2
1162 | | | ${prev_index}= | Evaluate | ${number}-1
1163 | | | Configure vhost interfaces for L2BD forwarding | ${nodes['${dut}']}
1164 | | | ... | ${sock1} | ${sock2} | ${dut}-vhost-${number}-if1
1165 | | | ... | ${dut}-vhost-${number}-if2
1166 | | | ${dut_xconnect_if1}= | Set Variable If | ${number}==1 | ${${dut}_if1}
1167 | | | ... | ${${dut}-vhost-${prev_index}-if2}
1168 | | | Configure L2XC | ${nodes['${dut}']} | ${dut_xconnect_if1}
1169 | | | ... | ${${dut}-vhost-${number}-if1}
1170 | | | Run Keyword If | ${number}==${vm_count} | Configure L2XC
1171 | | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${number}-if2} | ${${dut}_if2}
1173 | Initialize L2 xconnect with Vhost-User
1175 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
1176 | | ... | all VPP nodes. Add each Vhost-User interface into L2 cross-connect
1177 | | ... | with with physical inteface or Vhost-User interface of another VM.
1179 | | ... | *Arguments:*
1180 | | ... | - vm_count - VM count. Type: integer
1182 | | ... | *Example:*
1184 | | ... | \| Initialize L2 xconnect with Vhost-User \| 1 \|
1186 | | [Arguments] | ${vm_count}=${1}
1188 | | ${duts}= | Get Matches | ${nodes} | DUT*
1189 | | :FOR | ${dut} | IN | @{duts}
1190 | | | Initialize L2 xconnect with Vhost-User on node | ${dut}
1191 | | | ... | vm_count=${vm_count}
1193 | Initialize L2 xconnect with Vhost-User and VLAN in 3-node circular topology
1195 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Cross
1196 | | ... | connect each Vhost interface with one physical interface.
1197 | | ... | Setup VLAN between DUTs. All interfaces are brought up.
1199 | | ... | *Arguments:*
1200 | | ... | - subid - ID of the sub-interface to be created. Type: string
1201 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1203 | | ... | *Example:*
1205 | | ... | \| L2 xconnect with Vhost-User and VLAN initialized in a 3-node\
1206 | | ... | circular topology \| 10 \| pop-1 \|
1208 | | [Arguments] | ${subid} | ${tag_rewrite}
1210 | | Set interfaces in path up
1211 | | Initialize VLAN dot1q sub-interfaces in circular topology
1212 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
1213 | | Configure L2 tag rewrite method on interfaces
1214 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1215 | | ... | ${tag_rewrite}
1216 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1217 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
1218 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1}
1219 | | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2}
1220 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1221 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
1222 | | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1}
1223 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2}
1225 | Initialize L2 xconnect with Vhost-User and VLAN with DPDK link bonding in 3-node circular topology
1227 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Setup VLAN
1228 | | ... | on BondEthernet interfaces between DUTs. Cross connect one Vhost
1229 | | ... | interface with physical interface towards TG and other Vhost interface
1230 | | ... | with VLAN sub-interface. All interfaces are brought up.
1232 | | ... | *Arguments:*
1233 | | ... | - subid - ID of the sub-interface to be created. Type: string
1234 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1236 | | ... | *Example:*
1238 | | ... | \| Initialize L2 xconnect with Vhost-User and VLAN with DPDK link\
1239 | | ... | bonding in 3-node circular topology \| 10 \| pop-1 \|
1241 | | [Arguments] | ${subid} | ${tag_rewrite}
1243 | | Set interfaces in path up
1244 | | Add DPDK bonded ethernet interfaces to topology file in 3-node single link topology
1245 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
1246 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
1247 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
1248 | | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1}
1249 | | Initialize VLAN dot1q sub-interfaces in circular topology
1250 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
1252 | | Configure L2 tag rewrite method on interfaces
1253 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1254 | | ... | ${tag_rewrite}
1255 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1256 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
1257 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1}
1258 | | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2}
1259 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1260 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
1261 | | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1}
1262 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2}
1264 | Initialize L2 xconnect with Vhost-User and VLAN with VPP link bonding in 3-node circular topology
1266 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Create one
1267 | | ... | link bonding (BondEthernet) interface on both VPP nodes. Enslave one
1268 | | ... | physical interface towards next DUT by BondEthernet interface. Setup
1269 | | ... | VLAN on BondEthernet interfaces between DUTs. Cross connect one Vhost
1270 | | ... | interface with physical interface towards TG and other Vhost interface
1271 | | ... | with VLAN sub-interface. All interfaces are brought up.
1273 | | ... | *Arguments:*
1274 | | ... | - subid - ID of the sub-interface to be created. Type: string
1275 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1276 | | ... | - bond_mode - Link bonding mode. Type: string
1277 | | ... | - lb_mode - Load balance mode. Type: string
1279 | | ... | *Example:*
1281 | | ... | \| Initialize L2 xconnect with Vhost-User and VLAN with VPP link\
1282 | | ... | bonding in 3-node circular topology \| 10 \| pop-1 \| xor \| l34 \|
1284 | | [Arguments] | ${subid} | ${tag_rewrite} | ${bond_mode} | ${lb_mode}
1286 | | Set interfaces in path up
1287 | | ${dut1_eth_bond_if1}= | VPP Create Bond Interface | ${dut1} | ${bond_mode}
1288 | | ... | ${lb_mode}
1289 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
1290 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
1291 | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
1292 | | ... | Variable Should Exist | ${dut1_if2}
1293 | | Run Keyword If | '${if2_status}' == 'PASS'
1294 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2}
1295 | | ... | ${dut1_eth_bond_if1}
1297 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_1}
1298 | | ... | ${dut1_eth_bond_if1}
1299 | | Run Keyword Unless | '${if2_status}' == 'PASS'
1300 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_2}
1301 | | ... | ${dut1_eth_bond_if1}
1302 | | ${dut2_eth_bond_if1}= | VPP Create Bond Interface | ${dut2} | ${bond_mode}
1303 | | ... | ${lb_mode}
1304 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
1305 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
1306 | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
1307 | | ... | Variable Should Exist | ${dut2_if1}
1308 | | Run Keyword If | '${if1_status}' == 'PASS'
1309 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1}
1310 | | ... | ${dut2_eth_bond_if1}
1312 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_1}
1313 | | ... | ${dut2_eth_bond_if1}
1314 | | Run Keyword Unless | '${if2_status}' == 'PASS'
1315 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_2}
1316 | | ... | ${dut2_eth_bond_if1}
1317 | | VPP Show Bond Data On All Nodes | ${nodes} | details=${TRUE}
1318 | | Initialize VLAN dot1q sub-interfaces in circular topology
1319 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
1321 | | Configure L2 tag rewrite method on interfaces
1322 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1323 | | ... | ${tag_rewrite}
1324 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1325 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
1326 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1}
1327 | | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2}
1328 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1329 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
1330 | | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1}
1331 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2}
1333 | Initialize L2 bridge domain in circular topology
1335 | | ... | Setup L2 DB topology by adding two interfaces on each DUT into BD
1336 | | ... | that is created automatically with index 1. Learning is enabled.
1337 | | ... | Interfaces are brought up.
1339 | | ... | *Arguments:*
1340 | | ... | - bd_id - Bridge domain ID. Type: integer
1342 | | ... | *Example:*
1344 | | ... | \| Initialize L2 bridge domain in circular topology \| 1 \|
1346 | | [Arguments] | ${bd_id}=${1}
1348 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
1349 | | ... | Variable Should Exist | ${dut2}
1351 | | Set interfaces in path up
1353 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id}
1354 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id}
1355 | | Run Keyword If | '${dut2_status}' == 'PASS'
1356 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${bd_id}
1357 | | Run Keyword If | '${dut2_status}' == 'PASS'
1358 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id}
1360 | Configure IPv4 ACLs
1362 | | ... | Configure ACL with required number of not-hitting permit ACEs plus two
1363 | | ... | hitting ACEs for both traffic directions.
1365 | | ... | *Arguments:*
1366 | | ... | - dut_node - DUT node. Type: dictionary
1367 | | ... | - dut_if1 - DUT node interface1 name (Optional). Type: string
1368 | | ... | - dut_if2 - DUT node interface2 name (Optional). Type: string
1370 | | ... | *Example:*
1372 | | ... | \| Configure IPv4 ACLs \| ${nodes['DUT1']} \| GigabitEthernet0/7/0 \
1373 | | ... | \| GigabitEthernet0/8/0 \|
1375 | | ... | _NOTE:_ This KW uses following test case variables:
1376 | | ... | - src_ip_start - Source IP address start. Type: string
1377 | | ... | - dst_ip_start - Destination IP address start. Type: string
1378 | | ... | - ip_step - IP address step. Type: string
1379 | | ... | - sport_start - Source port number start. Type: string
1380 | | ... | - dport_start - Destination port number start. Type: string
1381 | | ... | - port_step - Port number step. Type: string
1382 | | ... | - no_hit_aces_number - Number of not-hitting ACEs to be configured.
1383 | | ... | Type: integer
1384 | | ... | - acl_apply_type - To what path apply the ACL - input or output.
1385 | | ... | Type: string
1386 | | ... | - acl_action - Action for the rule - deny, permit, permit+reflect.
1387 | | ... | Type: string
1388 | | ... | - trex_stream1_subnet - IP subnet used by T-Rex in direction 0->1.
1389 | | ... | Type: string
1390 | | ... | - trex_stream2_subnet - IP subnet used by T-Rex in direction 1->0.
1391 | | ... | Type: string
1393 | | [Arguments] | ${dut} | ${dut_if1}=${NONE} | ${dut_if2}=${NONE}
1394 | | ${src_ip_int} = | Evaluate
1395 | | ... | int(ipaddress.ip_address(unicode($src_ip_start))) - $ip_step
1396 | | ... | modules=ipaddress
1397 | | ${dst_ip_int} = | Evaluate
1398 | | ... | int(ipaddress.ip_address(unicode($dst_ip_start))) - $ip_step
1399 | | ... | modules=ipaddress
1400 | | ${ip_limit} = | Set Variable | 255.255.255.255
1401 | | ${ip_limit_int} = | Evaluate
1402 | | ... | int(ipaddress.ip_address(unicode($ip_limit))) | modules=ipaddress
1403 | | ${sport}= | Evaluate | $sport_start - $port_step
1404 | | ${dport}= | Evaluate | $dport_start - $port_step
1405 | | ${port_limit}= | Set Variable | ${65535}
1406 | | ${acl}= | Set Variable | ipv4 permit
1407 | | :FOR | ${nr} | IN RANGE | 0 | ${no_hit_aces_number}
1408 | | | ${src_ip_int} = | Evaluate | $src_ip_int + $ip_step
1409 | | | ${dst_ip_int} = | Evaluate | $dst_ip_int + $ip_step
1410 | | | ${sport}= | Evaluate | $sport + $port_step
1411 | | | ${dport}= | Evaluate | $dport + $port_step
1412 | | | ${ipv4_limit_reached}= | Set Variable If
1413 | | | ... | $src_ip_int > $ip_limit_int or $src_ip_int > $ip_limit_int
1415 | | | ${udp_limit_reached}= | Set Variable If
1416 | | | ... | $sport > $port_limit or $dport > $port_limit | ${TRUE}
1417 | | | Run Keyword If | $ipv4_limit_reached is True | Log
1418 | | | ... | Can't do more iterations - IPv4 address limit has been reached.
1420 | | | Run Keyword If | $udp_limit_reached is True | Log
1421 | | | ... | Can't do more iterations - UDP port limit has been reached.
1423 | | | ${src_ip} = | Run Keyword If | $ipv4_limit_reached is True
1424 | | | ... | Set Variable | ${ip_limit}
1425 | | | ... | ELSE | Evaluate | str(ipaddress.ip_address($src_ip_int))
1426 | | | ... | modules=ipaddress
1427 | | | ${dst_ip} = | Run Keyword If | $ipv4_limit_reached is True
1428 | | | ... | Set Variable | ${ip_limit}
1429 | | | ... | ELSE | Evaluate | str(ipaddress.ip_address($dst_ip_int))
1430 | | | ... | modules=ipaddress
1431 | | | ${sport}= | Set Variable If | ${sport} > $port_limit | $port_limit
1432 | | | ... | ${sport}
1433 | | | ${dport}= | Set Variable If | ${dport} > $port_limit | $port_limit
1434 | | | ... | ${dport}
1435 | | | ${acl}= | Catenate | ${acl} | src ${src_ip}/32 dst ${dst_ip}/32
1436 | | | ... | sport ${sport} | dport ${dport},
1437 | | | Exit For Loop If
1438 | | | ... | $ipv4_limit_reached is True or $udp_limit_reached is True
1439 | | ${acl}= | Catenate | ${acl}
1440 | | ... | ipv4 ${acl_action} src ${trex_stream1_subnet},
1441 | | ... | ipv4 ${acl_action} src ${trex_stream2_subnet}
1442 | | Add Replace Acl Multi Entries | ${dut} | rules=${acl}
1443 | | @{acl_list}= | Create List | ${0}
1444 | | Run Keyword If | 'input' in $acl_apply_type and $dut_if1 is not None
1445 | | ... | Set Acl List For Interface | ${dut} | ${dut_if1} | input | ${acl_list}
1446 | | Run Keyword If | 'input' in $acl_apply_type and $dut_if2 is not None
1447 | | ... | Set Acl List For Interface | ${dut} | ${dut_if2} | input | ${acl_list}
1448 | | Run Keyword If | 'output' in $acl_apply_type and $dut_if1 is not None
1449 | | ... | Set Acl List For Interface | ${dut} | ${dut_if1} | output
1450 | | ... | ${acl_list}
1451 | | Run Keyword If | 'output' in $acl_apply_type and $dut_if2 is not None
1452 | | ... | Set Acl List For Interface | ${dut} | ${dut_if2} | output
1453 | | ... | ${acl_list}
1455 | Initialize L2 bridge domain with IPv4 ACLs on DUT1 in 3-node circular topology
1457 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
1458 | | ... | domain that is created automatically with index 1. Learning is
1459 | | ... | enabled. Interfaces are brought up. Apply required ACL rules to DUT1
1460 | | ... | interfaces.
1462 | | ... | *Arguments:*
1465 | | ... | *Example:*
1467 | | ... | \| Initialize L2 bridge domain with IPv4 ACLs on DUT1 in 3-node \
1468 | | ... | circular topology \|
1470 | | ... | _NOTE:_ This KW uses following test case variables:
1471 | | ... | - dut1 - DUT1 node.
1472 | | ... | - dut2 - DUT2 node.
1473 | | ... | - dut1_if1 - DUT1 interface towards TG.
1474 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
1475 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
1476 | | ... | - dut2_if2 - DUT2 interface towards TG.
1478 | | Set interfaces in path up
1479 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1_if2}
1480 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
1481 | | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
1483 | Initialize IPv4 routing for '${ip_nr}' addresses with IPv4 ACLs on DUT1 in circular topology
1485 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node
1486 | | ... | circular topology. Get the interface MAC addresses and setup ARP on
1487 | | ... | all VPP interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG
1488 | | ... | links. In case of 3-node topology setup IPv4 adresses with /30 prefix
1489 | | ... | on DUT1-DUT2 link and set routing on both DUT nodes with prefix /24
1490 | | ... | and next hop of neighbour DUT interface IPv4 address.
1491 | | ... | Apply required ACL rules to DUT1 interfaces.
1493 | | ... | *Arguments:*
1494 | | ... | - ip_nr - Number of IPs to be used. Type: integer or string
1496 | | ... | *Example:*
1498 | | ... | \| Initialize IPv4 routing for '10' addresses with IPv4 ACLs on DUT1 \
1499 | | ... | in 3-node circular topology \|
1501 | | ... | _NOTE:_ This KW uses following test case variables:
1502 | | ... | - tg - TG node.
1503 | | ... | - dut1 - DUT1 node.
1504 | | ... | - dut2 - DUT2 node.
1505 | | ... | - tg_if1 - TG interface 1 towards DUT1.
1506 | | ... | - tg_if2 - TG interface 2 towards DUT2 (3-node topo) or DUT1
1507 | | ... | (2-node topo).
1508 | | ... | - dut1_if1 - DUT1 interface 1 towards TG.
1509 | | ... | - dut1_if2 - DUT1 interface 2 towards DUT2 (3-node topo) or TG
1510 | | ... | (2-node topo).
1511 | | ... | - dut2_if1 - DUT2 interface 1 towards DUT1.
1512 | | ... | - dut2_if2 - DUT2 interface 2 towards TG.
1514 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
1515 | | ... | Variable Should Exist | ${dut2}
1516 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
1517 | | ... | Set Variable | ${dut2}
1518 | | ... | ELSE | Set Variable | ${dut1}
1519 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
1520 | | ... | Set Variable | ${dut2_if2}
1521 | | ... | ELSE | Set Variable | ${dut1_if2}
1523 | | Set interfaces in path up
1525 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1526 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1527 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
1528 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
1529 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
1530 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
1532 | | :FOR | ${number} | IN RANGE | 2 | ${ip_nr}+2
1533 | | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.${number}
1534 | | | ... | ${tg1_if1_mac}
1535 | | | Add arp on dut | ${dut} | ${dut_if2} | 20.20.20.${number}
1536 | | | ... | ${tg1_if2_mac}
1537 | | Run Keyword If | '${dut2_status}' == 'PASS'
1538 | | ... | Add arp on dut | ${dut1} | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
1539 | | Run Keyword If | '${dut2_status}' == 'PASS'
1540 | | ... | Add arp on dut | ${dut2} | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
1542 | | Configure IP addresses on interfaces
1543 | | ... | ${dut1} | ${dut1_if1} | 10.10.10.1 | 24
1544 | | ... | ${dut} | ${dut_if2} | 20.20.20.1 | 24
1545 | | Run Keyword If | '${dut2_status}' == 'PASS'
1546 | | ... | Configure IP addresses on interfaces
1547 | | ... | ${dut1} | ${dut1_if2} | 1.1.1.1 | 30
1548 | | ... | ${dut2} | ${dut2_if1} | 1.1.1.2 | 30
1550 | | Run Keyword If | '${dut2_status}' == 'PASS'
1551 | | ... | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | gateway=1.1.1.2
1552 | | ... | interface=${dut1_if2}
1553 | | Run Keyword If | '${dut2_status}' == 'PASS'
1554 | | ... | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=1.1.1.1
1555 | | ... | interface=${dut2_if1}
1557 | | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
1559 | Configure MACIP ACLs
1561 | | ... | Configure MACIP ACL with required number of not-hitting permit ACEs
1562 | | ... | plus two hitting ACEs for both traffic directions.
1564 | | ... | *Arguments:*
1565 | | ... | - dut_node - DUT node. Type: dictionary
1566 | | ... | - dut_if1 - DUT node interface1 name (Optional). Type: string
1567 | | ... | - dut_if2 - DUT node interface2 name (Optional). Type: string
1569 | | ... | *Example:*
1571 | | ... | \| Configure MACIP ACLs \| ${nodes['DUT1']} \| GigabitEthernet0/7/0 \
1572 | | ... | \| GigabitEthernet0/8/0 \|
1574 | | ... | _NOTE:_ This KW uses following test case variables:
1575 | | ... | - src_ip_start - Source IP address start. Type: string
1576 | | ... | - ip_step - IP address step. Type: string
1577 | | ... | - src_mac_start - Source MAC address start in format with colons.
1578 | | ... | Type: string
1579 | | ... | - src_mac_step - Source MAC address step. Type: string
1580 | | ... | - src_mac_mask - Source MAC address mask. 00:00:00:00:00:00 is a
1581 | | ... | wildcard mask. Type: string
1582 | | ... | - no_hit_aces_number - Number of not-hitting ACEs to be configured.
1583 | | ... | Type: integer
1584 | | ... | - acl_action - Action for the rule - deny, permit, permit+reflect.
1585 | | ... | Type: string
1586 | | ... | - tg_stream1_subnet - IP subnet used by TG in direction 0->1.
1587 | | ... | Type: string
1588 | | ... | - tg_stream2_subnet - IP subnet used by TG in direction 1->0.
1589 | | ... | Type: string
1590 | | ... | - tg_stream1_mac - Source MAC address of traffic stream 1.
1591 | | ... | Type: string
1592 | | ... | - tg_stream2_mac - Source MAC address of traffic stream 2.
1593 | | ... | Type: string
1594 | | ... | - tg_mac_mask - MAC address mask for traffic streams.
1595 | | ... | 00:00:00:00:00:00 is a wildcard mask. Type: string
1597 | | [Arguments] | ${dut} | ${dut_if1}=${NONE} | ${dut_if2}=${NONE}
1599 | | ${src_ip_int} = | IP To Int | ${src_ip_start}
1600 | | ${src_ip_int} = | Evaluate | ${src_ip_int} - ${ip_step}
1602 | | ${ip_limit} = | Set Variable | 255.255.255.255
1603 | | ${ip_limit_int} = | IP To Int | ${ip_limit}
1605 | | ${src_mac_int} = | Mac To Int | ${src_mac_start}
1606 | | ${src_mac_int} = | Evaluate | ${src_mac_int} - ${src_mac_step}
1608 | | ${mac_limit} = | Set Variable | ff:ff:ff:ff:ff:ff
1609 | | ${mac_limit_int} = | Mac To Int | ${mac_limit}
1611 | | ${acl}= | Set Variable | ipv4 permit
1612 | | :FOR | ${nr} | IN RANGE | 0 | ${no_hit_aces_number}
1613 | | | ${src_ip_int} = | Evaluate | ${src_ip_int} + ${ip_step}
1614 | | | ${src_mac_int} = | Evaluate | ${src_mac_int} + ${src_mac_step}
1615 | | | ${ipv4_limit_reached}= | Set Variable If
1616 | | | ... | ${src_ip_int} > ${ip_limit_int} | ${TRUE}
1617 | | | ${mac_limit_reached}= | Set Variable If
1618 | | | ... | ${src_mac_int} > ${mac_limit_int} | ${TRUE}
1619 | | | Run Keyword If | '${ipv4_limit_reached}' == '${TRUE}' | Log
1620 | | | ... | Can't do more iterations - IPv4 address limit has been reached.
1622 | | | Run Keyword If | '${mac_limit_reached}' == '${TRUE}' | Log
1623 | | | ... | Can't do more iterations - MAC address limit has been reached.
1625 | | | ${src_ip} = | Run Keyword If | '${ipv4_limit_reached}' == '${TRUE}'
1626 | | | ... | Set Variable | ${ip_limit}
1627 | | | ... | ELSE | Int To IP | ${src_ip_int}
1628 | | | ${src_mac}= | Run Keyword If | '${mac_limit_reached}' == '${TRUE}'
1629 | | | ... | Set Variable | ${mac_limit}
1630 | | | ... | ELSE | Int To Mac | ${src_mac_int}
1631 | | | ${acl}= | Catenate | ${acl} | ip ${src_ip}/32
1632 | | | ... | mac ${src_mac} | mask ${src_mac_mask},
1633 | | | Exit For Loop If | '${ipv4_limit_reached}' == '${TRUE}' or '${mac_limit_reached}' == '${TRUE}'
1634 | | ${acl0}= | Catenate | ${acl}
1635 | | ... | ipv4 ${acl_action} ip ${tg_stream1_subnet} mac ${tg_stream1_mac}
1636 | | ... | mask ${tg_mac_mask}
1637 | | ${acl1}= | Catenate | ${acl}
1638 | | ... | ipv4 ${acl_action} ip ${tg_stream2_subnet} mac ${tg_stream2_mac}
1639 | | ... | mask ${tg_mac_mask}
1640 | | Add Macip Acl Multi Entries | ${dut} | rules=${acl0}
1641 | | Add Macip Acl Multi Entries | ${dut} | rules=${acl1}
1642 | | ${acl_idx}= | Set Variable | 0
1643 | | Run Keyword Unless | '${dut_if1}' == '${NONE}'
1644 | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if1} | add | ${acl_idx}
1645 | | ${acl_idx}= | Set Variable | 1
1646 | | Run Keyword Unless | '${dut_if2}' == '${NONE}'
1647 | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if2} | add | ${acl_idx}
1649 | Initialize L2 bridge domain with MACIP ACLs on DUT1 in 3-node circular topology
1651 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
1652 | | ... | domain that is created automatically with index 1. Learning is
1653 | | ... | enabled. Interfaces are brought up. Apply required MACIP ACL rules to
1654 | | ... | DUT1 interfaces.
1656 | | ... | *Arguments:*
1659 | | ... | *Example:*
1661 | | ... | \| Initialize L2 bridge domain with MACIP ACLs on DUT1 in 3-node \
1662 | | ... | circular topology \|
1664 | | ... | _NOTE 1:_ This KW uses following test case variables:
1665 | | ... | - tg - TG node.
1666 | | ... | - dut1 - DUT1 node.
1667 | | ... | - dut2 - DUT2 node.
1668 | | ... | - tg_if1 - TG interface towards DUT1.
1669 | | ... | - tg_if2 - TG interface towards DUT2.
1670 | | ... | - dut1_if1 - DUT1 interface towards TG.
1671 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
1672 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
1673 | | ... | - dut2_if2 - DUT2 interface towards TG.
1675 | | Set interfaces in path up
1676 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1_if2}
1677 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
1678 | | Configure MACIP ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
1680 | Initialize L2 bridge domains with Vhost-User on node
1682 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
1683 | | ... | defined VPP node. Add each Vhost-User interface into L2 bridge
1684 | | ... | domains with learning enabled with physical inteface or Vhost-User
1685 | | ... | interface of another VM.
1687 | | ... | *Arguments:*
1688 | | ... | - dut - DUT node. Type: string
1689 | | ... | - nf_chain - NF chain. Type: integer
1690 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
1693 | | ... | Socket paths for VM are defined in following format:
1694 | | ... | - /tmp/sock-\${VM_ID}-1
1695 | | ... | - /tmp/sock-\${VM_ID}-2
1697 | | ... | *Example:*
1699 | | ... | \| Initialize L2 bridge domains with Vhost-User on node \| DUT1 \
1700 | | ... | \| 1 \| 1 \|
1702 | | [Arguments] | ${dut} | ${nf_chain}=${1} | ${nf_nodes}=${1}
1704 | | ${bd_id2}= | Evaluate | ${nf_nodes}+1
1705 | | Add interface to bridge domain | ${nodes['${dut}']}
1706 | | ... | ${${dut}_if1} | ${1}
1707 | | Add interface to bridge domain | ${nodes['${dut}']}
1708 | | ... | ${${dut}_if2} | ${bd_id2}
1709 | | :FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes}+1
1710 | | | ${qemu_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
1711 | | | ${sock1}= | Set Variable | /var/run/vpp/sock-${qemu_id}-1
1712 | | | ${sock2}= | Set Variable | /var/run/vpp/sock-${qemu_id}-2
1713 | | | Configure vhost interfaces for L2BD forwarding | ${nodes['${dut}']}
1714 | | | ... | ${sock1} | ${sock2}
1715 | | | ... | ${dut}-vhost-${qemu_id}-if1
1716 | | | ... | ${dut}-vhost-${qemu_id}-if2
1717 | | | ${bd_id2}= | Evaluate | ${nf_node}+1
1718 | | | Add interface to bridge domain | ${nodes['${dut}']}
1719 | | | ... | ${${dut}-vhost-${qemu_id}-if1} | ${nf_node}
1720 | | | Add interface to bridge domain | ${nodes['${dut}']}
1721 | | | ... | ${${dut}-vhost-${qemu_id}-if2} | ${bd_id2}
1723 | Initialize L2 bridge domains with Vhost-User
1725 | | ... | Create pairs of Vhost-User interfaces for defined number of VNF nodes
1726 | | ... | on all defined VPP nodes. Add each Vhost-User interface into L2 bridge
1727 | | ... | domains with learning enabled with physical inteface or Vhost-User
1728 | | ... | interface of another VM.
1730 | | ... | *Arguments:*
1731 | | ... | - nf_chain - NF chain. Type: integer
1732 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
1734 | | ... | *Example:*
1736 | | ... | \| Initialize L2 bridge domains with Vhost-User \| 1 \| 1 \|
1738 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1}
1740 | | ${duts}= | Get Matches | ${nodes} | DUT*
1741 | | :FOR | ${dut} | IN | @{duts}
1742 | | | Initialize L2 bridge domains with Vhost-User on node | ${dut}
1743 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
1745 | Initialize L2 bridge domains for multiple chains with Vhost-User
1747 | | ... | Create pairs of Vhost-User interfaces for defined number of NF chains
1748 | | ... | with defined number of VNF nodes on all defined VPP nodes. Add each
1749 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1750 | | ... | with physical inteface or Vhost-User interface of another VM.
1752 | | ... | *Arguments:*
1753 | | ... | - nf_chains - Number of chains of NFs. Type: integer
1754 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
1756 | | ... | *Example:*
1758 | | ... | \| Initialize L2 bridge domains for multiple chains with Vhost-User \
1759 | | ... | \| 1 \| 1 \|
1761 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1}
1763 | | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
1764 | | | Initialize L2 bridge domains with Vhost-User | nf_chain=${nf_chain}
1765 | | | ... | nf_nodes=${nf_nodes}
1767 | Initialize L2 bridge domain with VXLANoIPv4 in 3-node circular topology
1769 | | ... | Setup L2 bridge domain topology with VXLANoIPv4 by connecting
1770 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
1771 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
1772 | | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as
1773 | | ... | interfaces.
1775 | | Set interfaces in path up
1776 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1
1778 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2
1780 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1781 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1782 | | Add arp on dut | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac}
1783 | | Add arp on dut | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac}
1784 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
1785 | | ... | 172.16.0.1 | 172.16.0.2
1786 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
1787 | | ... | 172.16.0.2 | 172.16.0.1
1788 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1s_vxlan}
1789 | | Configure L2BD forwarding | ${dut2} | ${dut2_if2} | ${dut2s_vxlan}
1791 | Initialize L2 bridge domain with VLAN and VXLANoIPv4 in 3-node circular topology
1793 | | ... | Setup L2 bridge domain topology with VLAN and VXLANoIPv4 by connecting
1794 | | ... | pairs of VLAN sub-interface and VXLAN interface to separate L2 bridge
1795 | | ... | domain on each DUT. All interfaces are brought up. IPv4 addresses
1796 | | ... | with prefix /32 are configured on interfaces between DUTs. VXLAN
1797 | | ... | sub-interfaces has same IPv4 address as interfaces.
1799 | | ... | *Arguments:*
1800 | | ... | - vxlan_count - VXLAN count. Type: integer
1802 | | ... | *Example:*
1804 | | ... | \| Initialize L2 bridge domain with VLAN and VXLANoIPv4 in 3-node \
1805 | | ... | \| circular topology \| ${1} \|
1807 | | [Arguments] | ${vxlan_count}=${1}
1809 | | Set interfaces in path up
1811 | | ${bd_id_start}= | Set Variable | ${1}
1812 | | ${vni_start} = | Set Variable | ${20}
1814 | | ${ip_step} = | Set Variable | ${2}
1815 | | ${dut1_ip_start}= | Set Variable | 172.16.0.1
1816 | | ${dut2_ip_start}= | Set Variable | 172.16.0.2
1818 | | ${ip_limit} = | Set Variable | 255.255.255.255
1820 | | Vpp create multiple VXLAN IPv4 tunnels | node=${dut1}
1821 | | ... | node_vxlan_if=${dut1_if2} | node_vlan_if=${dut1_if1}
1822 | | ... | op_node=${dut2} | op_node_if=${dut2_if1} | n_tunnels=${vxlan_count}
1823 | | ... | vni_start=${vni_start} | src_ip_start=${dut1_ip_start}
1824 | | ... | dst_ip_start=${dut2_ip_start} | ip_step=${ip_step}
1825 | | ... | ip_limit=${ip_limit} | bd_id_start=${bd_id_start}
1826 | | Vpp create multiple VXLAN IPv4 tunnels | node=${dut2}
1827 | | ... | node_vxlan_if=${dut2_if1} | node_vlan_if=${dut2_if2}
1828 | | ... | op_node=${dut1} | op_node_if=${dut1_if2} | n_tunnels=${vxlan_count}
1829 | | ... | vni_start=${vni_start} | src_ip_start=${dut2_ip_start}
1830 | | ... | dst_ip_start=${dut1_ip_start} | ip_step=${ip_step}
1831 | | ... | ip_limit=${ip_limit} | bd_id_start=${bd_id_start}
1833 | Initialize L2 bridge domains with Vhost-User and VXLANoIPv4 in 3-node circular topology
1835 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
1836 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1837 | | ... | with physical inteface.
1838 | | ... | Setup VXLANoIPv4 between DUTs by connecting physical and vxlan
1839 | | ... | interfaces on each DUT. All interfaces are brought up.
1840 | | ... | IPv4 addresses with prefix /24 are configured on interfaces between
1841 | | ... | DUTs. VXLAN sub-interfaces has same IPv4 address as interfaces.
1843 | | ... | *Arguments:*
1844 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1845 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1847 | | ... | *Example:*
1849 | | ... | \| L2 bridge domains with Vhost-User and VXLANoIPv4 initialized in a\
1850 | | ... | 3-node circular topology \| 1 \| 2 \|
1852 | | [Arguments] | ${bd_id1} | ${bd_id2}
1854 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1
1856 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2
1858 | | Set interfaces in path up
1859 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
1860 | | ... | 172.16.0.1 | 172.16.0.2
1861 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
1862 | | ... | 172.16.0.2 | 172.16.0.1
1863 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1864 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1865 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1866 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1867 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1868 | | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${bd_id2}
1869 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1870 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1871 | | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${bd_id1}
1872 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
1873 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
1874 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1876 | Init L2 bridge domains with single DUT with Vhost-User and VXLANoIPv4 in 3-node circular topology
1878 | | ... | Create two Vhost-User interfaces on one VPP node. Add each
1879 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1880 | | ... | one connected to physical interface, the other to VXLAN.
1881 | | ... | Setup VXLANoIPv4 between DUTs and TG by connecting physical and vxlan
1882 | | ... | interfaces on the DUT. All interfaces are brought up.
1883 | | ... | IPv4 addresses with prefix /24 are configured on interfaces between
1884 | | ... | DUT and TG.
1886 | | ... | *Arguments:*
1887 | | ... | - dut1_address - Address of physical interface on DUT1. Type: string
1888 | | ... | - dut1_address_subnet - Subnet of the address of physical interface on
1889 | | ... | DUT1. Type: string
1890 | | ... | - dut2_address - Address of physical interface on DUT2. Type: string
1891 | | ... | - dut2_address_subnet - Subnet of the address of physical interface on
1892 | | ... | DUT2. Type: string
1893 | | ... | - dut1_gw - Address of the _gateway_ to which the traffic will be
1894 | | ... | forwarded on DUT1. Type: string
1895 | | ... | - dut2_gw - Address of the _gateway_ to which the traffic will be
1896 | | ... | forwarded on DUT2. Type: string
1897 | | ... | - dut1_vxlans - List of VXLAN params to be configured on DUT1.
1898 | | ... | Type: list of dicts, dict params vni, vtep
1899 | | ... | - dut2_vxlans - List of VXLAN params to be configured on DUT2.
1900 | | ... | Type: list of dicts, dict params vni, vtep
1901 | | ... | - dut1_route_subnet - Subnet address to forward to _gateway_ on DUT1.
1902 | | ... | Type: string
1903 | | ... | - dut1_route_mask - Subnet address mask to forward to _gateway_
1904 | | ... | on DUT1. Type: string
1905 | | ... | - dut2_route_subnet - Subnet address to forward to _gateway_ on DUT2.
1906 | | ... | Type: string
1907 | | ... | - dut2_route_mask - Subnet address mask to forward to _gateway_
1908 | | ... | on DUT2. Type: string
1910 | | ... | *Example:*
1912 | | [Arguments] | ${dut1_address} | ${dut1_address_subnet} |
1913 | | ... | ${dut2_address} | ${dut2_address_subnet} | ${dut1_gw} | ${dut2_gw} |
1914 | | ... | ${dut1_vxlans} | ${dut2_vxlans} | ${dut1_route_subnet} |
1915 | | ... | ${dut1_route_mask} | ${dut2_route_subnet} | ${dut2_route_mask}
1917 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} |
1918 | | ... | ${dut1_address} | ${dut1_address_subnet}
1919 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} |
1920 | | ... | ${dut2_address} | ${dut2_address_subnet}
1921 | | ${dut1_bd_id1}= | Set Variable | 1
1922 | | ${dut1_bd_id2}= | Set Variable | 2
1923 | | ${dut2_bd_id1}= | Set Variable | 1
1924 | | :FOR | ${vxlan} | IN | @{dut1_vxlans}
1925 | | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | ${vxlan.vni}
1926 | | | ... | ${dut1_address} | ${vxlan.vtep}
1927 | | | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${dut1_bd_id1}
1928 | | :FOR | ${vxlan} | IN | @{dut2_vxlans}
1929 | | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | ${vxlan.vni}
1930 | | | ... | ${dut2_address} | ${vxlan.vtep}
1931 | | | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${dut2_bd_id1}
1932 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1933 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1934 | | Add arp on dut | ${dut1} | ${dut1_if1} | ${dut1_gw} | ${tg_if1_mac}
1935 | | Add arp on dut | ${dut2} | ${dut2_if2} | ${dut2_gw} | ${tg_if2_mac}
1936 | | Vpp Route Add | ${dut1} | ${dut1_route_subnet} | ${dut1_route_mask}
1937 | | ... | gateway=${dut1_gw} | interface=${dut1_if1}
1938 | | Vpp Route Add | ${dut2} | ${dut2_route_subnet} | ${dut2_route_mask}
1939 | | ... | gateway=${dut2_gw} | interface=${dut2_if2}
1940 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${dut1_bd_id2}
1941 | | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${dut2_bd_id1}
1942 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${dut1_bd_id1}
1943 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${dut1_bd_id2}
1945 | Initialize L2 bridge domains with VLAN dot1q sub-interfaces in circular topology
1947 | | ... | Setup L2 bridge domain topology with learning enabled with VLAN by
1948 | | ... | connecting physical and vlan interfaces on each DUT. In case of 3-node
1949 | | ... | topology create VLAN sub-interfaces between DUTs. In case of 2-node
1950 | | ... | topology create VLAN sub-interface on dut1-if2 interface. All
1951 | | ... | interfaces are brought up.
1953 | | ... | *Arguments:*
1954 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1955 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1956 | | ... | - subid - ID of the sub-interface to be created. Type: string
1957 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1959 | | ... | _NOTE:_ This KW uses following test case variables:
1960 | | ... | - dut1 - DUT1 node.
1961 | | ... | - dut2 - DUT2 node.
1962 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
1963 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
1965 | | ... | *Example:*
1967 | | ... | \| Initialize L2 bridge domains with VLAN dot1q sub-interfaces
1968 | | ... | in a 3-node circular topology \| 1 \| 2 \| 10 \| pop-1 \|
1970 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
1972 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
1973 | | ... | Variable Should Exist | ${dut2}
1975 | | Set interfaces in path up
1977 | | Run Keyword If | '${dut2_status}' == 'PASS'
1978 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
1979 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
1980 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
1981 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
1982 | | Run Keyword If | '${dut2_status}' == 'PASS'
1983 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
1984 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
1985 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
1986 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
1988 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1989 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id1}
1990 | | Run Keyword If | '${dut2_status}' == 'PASS'
1991 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
1993 | | Run Keyword If | '${dut2_status}' == 'PASS'
1994 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2}
1997 | Initialize L2 bridge domains with Vhost-User and VLAN in circular topology
1999 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
2000 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
2001 | | ... | with physical inteface. In case of 3-node topology create VLAN
2002 | | ... | sub-interfaces between DUTs. In case of 2-node topology create VLAN
2003 | | ... | sub-interface on dut1-if2 interface. All interfaces are brought up.
2005 | | ... | *Arguments:*
2006 | | ... | - bd_id1 - Bridge domain ID. Type: integer
2007 | | ... | - bd_id2 - Bridge domain ID. Type: integer
2008 | | ... | - subid - ID of the sub-interface to be created. Type: string
2009 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
2011 | | ... | *Example:*
2013 | | ... | \| L2 bridge domains with Vhost-User and VLAN initialized in circular\
2014 | | ... | topology \| 1 \| 2 \| 10 \| pop-1 \|
2016 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
2018 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
2019 | | ... | Variable Should Exist | ${dut2}
2021 | | Set interfaces in path up
2023 | | Run Keyword If | '${dut2_status}' == 'PASS'
2024 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
2025 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
2026 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
2027 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
2028 | | Run Keyword If | '${dut2_status}' == 'PASS'
2029 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
2030 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
2031 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
2032 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
2034 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
2035 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
2036 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
2037 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
2038 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
2039 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
2040 | | Run Keyword If | '${dut2_status}' == 'PASS'
2041 | | ... | Configure vhost interfaces for L2BD forwarding | ${dut2}
2042 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
2043 | | Run Keyword If | '${dut2_status}' == 'PASS'
2044 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
2046 | | Run Keyword If | '${dut2_status}' == 'PASS'
2047 | | ... | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
2048 | | Run Keyword If | '${dut2_status}' == 'PASS'
2049 | | ... | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
2050 | | Run Keyword If | '${dut2_status}' == 'PASS'
2051 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
2053 | Initialize L2 bridge domains with Vhost-User and VLAN with DPDK link bonding in a 3-node circular topology
2055 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Setup VLAN
2056 | | ... | on BondEthernet interfaces between DUTs. Add one Vhost-User interface
2057 | | ... | into L2 bridge domains with learning enabled with physical interface
2058 | | ... | towards TG and other Vhost-User interface into L2 bridge domains with
2059 | | ... | learning enabled with VLAN sub-interface. All interfaces are brought
2062 | | ... | *Arguments:*
2063 | | ... | - bd_id1 - Bridge domain ID. Type: integer
2064 | | ... | - bd_id2 - Bridge domain ID. Type: integer
2065 | | ... | - subid - ID of the sub-interface to be created. Type: string
2066 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
2068 | | ... | *Example:*
2070 | | ... | \| Initialize L2 bridge domains with Vhost-User and VLAN with DPDK\
2071 | | ... | link bonding in a 3-node circular topology \| 1 \| 2 \| /tmp/sock1 \
2072 | | ... | \| /tmp/sock2 \| 10 \| pop-1 \|
2074 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
2076 | | Set interfaces in path up
2077 | | Add DPDK bonded ethernet interfaces to topology file in 3-node single link topology
2078 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
2079 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
2080 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
2081 | | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1}
2082 | | Initialize VLAN dot1q sub-interfaces in circular topology
2083 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
2085 | | Configure L2 tag rewrite method on interfaces
2086 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
2087 | | ... | ${tag_rewrite}
2088 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
2089 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
2090 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
2091 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
2092 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
2093 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
2094 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
2095 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
2096 | | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id1}
2097 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
2098 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
2099 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
2101 | Initialize L2 bridge domains with Vhost-User and VLAN with VPP link bonding in a 3-node circular topology
2103 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Create one
2104 | | ... | link bonding (BondEthernet) interface on both VPP nodes. Enslave one
2105 | | ... | physical interface towards next DUT by BondEthernet interface. Setup
2106 | | ... | VLAN on BondEthernet interfaces between DUTs. Add one Vhost-User
2107 | | ... | interface into L2 bridge domains with learning enabled with physical
2108 | | ... | interface towards TG and other Vhost-User interface into L2 bridge
2109 | | ... | domains with learning enabled with VLAN sub-interface. All interfaces
2110 | | ... | are brought up.
2112 | | ... | *Arguments:*
2113 | | ... | - bd_id1 - Bridge domain ID. Type: integer
2114 | | ... | - bd_id2 - Bridge domain ID. Type: integer
2115 | | ... | - subid - ID of the sub-interface to be created. Type: string
2116 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
2117 | | ... | - bond_mode - Link bonding mode. Type: string
2118 | | ... | - lb_mode - Load balance mode. Type: string
2120 | | ... | *Example:*
2122 | | ... | \| Initialize L2 bridge domains with Vhost-User and VLAN with VPP\
2123 | | ... | link bonding in a 3-node circular topology \| 1 \| 2 \
2124 | | ... | \| 10 \| pop-1 \| xor \| l34 \|
2126 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
2127 | | ... | ${bond_mode} | ${lb_mode}
2129 | | Set interfaces in path up
2130 | | ${dut1_eth_bond_if1}= | VPP Create Bond Interface | ${dut1} | ${bond_mode}
2131 | | ... | ${lb_mode}
2132 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
2133 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
2134 | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
2135 | | ... | Variable Should Exist | ${dut1_if2}
2136 | | Run Keyword If | '${if2_status}' == 'PASS'
2137 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2}
2138 | | ... | ${dut1_eth_bond_if1}
2140 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_1}
2141 | | ... | ${dut1_eth_bond_if1}
2142 | | Run Keyword Unless | '${if2_status}' == 'PASS'
2143 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_2}
2144 | | ... | ${dut1_eth_bond_if1}
2145 | | ${dut2_eth_bond_if1}= | VPP Create Bond Interface | ${dut2} | ${bond_mode}
2146 | | ... | ${lb_mode}
2147 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
2148 | | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1}
2149 | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
2150 | | ... | Variable Should Exist | ${dut2_if1}
2151 | | Run Keyword If | '${if1_status}' == 'PASS'
2152 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1}
2153 | | ... | ${dut2_eth_bond_if1}
2155 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_1}
2156 | | ... | ${dut2_eth_bond_if1}
2157 | | Run Keyword Unless | '${if2_status}' == 'PASS'
2158 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_2}
2159 | | ... | ${dut2_eth_bond_if1}
2160 | | VPP Show Bond Data On All Nodes | ${nodes} | details=${TRUE}
2161 | | Initialize VLAN dot1q sub-interfaces in circular topology
2162 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
2164 | | Configure L2 tag rewrite method on interfaces
2165 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
2166 | | ... | ${tag_rewrite}
2167 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
2168 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
2169 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
2170 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
2171 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
2172 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
2173 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
2174 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
2175 | | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id1}
2176 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
2177 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
2178 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
2180 | Add PCI devices to all DUTs
2182 | | ... | Add PCI devices to VPP configuration file.
2184 | | ${duts}= | Get Matches | ${nodes} | DUT*
2185 | | :FOR | ${dut} | IN | @{duts}
2186 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
2187 | | | ... | Variable Should Exist | ${${dut}_if1}
2188 | | | ${if1_pci}= | Run Keyword If | '${if1_status}' == 'PASS'
2189 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1}
2190 | | | ${if1_1_pci}= | Run Keyword Unless | '${if1_status}' == 'PASS'
2191 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1_1}
2192 | | | ${if1_2_pci}= | Run Keyword Unless | '${if1_status}' == 'PASS'
2193 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1_2}
2194 | | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
2195 | | | ... | Variable Should Exist | ${${dut}_if2}
2196 | | | ${if2_pci}= | Run Keyword If | '${if2_status}' == 'PASS'
2197 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2}
2198 | | | ${if2_1_pci}= | Run Keyword Unless | '${if2_status}' == 'PASS'
2199 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2_1}
2200 | | | ${if2_2_pci}= | Run Keyword Unless | '${if2_status}' == 'PASS'
2201 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2_2}
2202 | | | @{pci_devs}= | Run Keyword If | '${if1_status}' == 'PASS'
2203 | | | ... | Create List | ${if1_pci}
2205 | | | ... | Create List | ${if1_1_pci} | ${if1_2_pci}
2206 | | | Run Keyword If | '${if2_status}' == 'PASS'
2207 | | | ... | Append To List | ${pci_devs} | ${if2_pci}
2209 | | | ... | Append To List | ${pci_devs} | ${if2_1_pci} | ${if2_2_pci}
2210 | | | Run keyword | ${dut}.Add DPDK Dev | @{pci_devs}
2211 | | | Run Keyword If | '${if1_status}' == 'PASS'
2212 | | | ... | Set Test Variable | ${${dut}_if1_pci} | ${if1_pci}
2213 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
2214 | | | ... | Set Test Variable | ${${dut}_if1_1_pci} | ${if1_1_pci}
2215 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
2216 | | | ... | Set Test Variable | ${${dut}_if1_2_pci} | ${if1_2_pci}
2217 | | | Run Keyword If | '${if2_status}' == 'PASS'
2218 | | | ... | Set Test Variable | ${${dut}_if2_pci} | ${if2_pci}
2219 | | | Run Keyword Unless | '${if2_status}' == 'PASS'
2220 | | | ... | Set Test Variable | ${${dut}_if2_1_pci} | ${if2_1_pci}
2221 | | | Run Keyword Unless | '${if2_status}' == 'PASS'
2222 | | | ... | Set Test Variable | ${${dut}_if2_2_pci} | ${if2_2_pci}
2224 | Add single PCI device to all DUTs
2226 | | ... | Add single (first) PCI device on DUT1 and single (last) PCI device on
2227 | | ... | DUT2 to VPP configuration file.
2229 | | ${duts}= | Get Matches | ${nodes} | DUT*
2230 | | :FOR | ${dut} | IN | @{duts}
2231 | | | ${if1_pci}= | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1}
2232 | | | Run keyword | ${dut}.Add DPDK Dev | ${if1_pci}
2233 | | | Set Test Variable | ${${dut}_if1_pci} | ${if1_pci}
2235 | Add VLAN strip offload switch off between DUTs in 3-node single link topology
2237 | | ... | Add VLAN Strip Offload switch off on PCI devices between DUTs to VPP
2238 | | ... | configuration file.
2240 | | Run keyword | DUT1.Add DPDK Dev Parameter | ${dut1_if2_pci}
2241 | | ... | vlan-strip-offload | off
2242 | | Run keyword | DUT2.Add DPDK Dev Parameter | ${dut2_if1_pci}
2243 | | ... | vlan-strip-offload | off
2245 | Add VLAN strip offload switch off between DUTs in 3-node double link topology
2247 | | ... | Add VLAN Strip Offload switch off on PCI devices between DUTs to VPP
2248 | | ... | configuration file.
2250 | | Run keyword | DUT1.Add DPDK Dev Parameter | ${dut1_if2_1_pci}
2251 | | ... | vlan-strip-offload | off
2252 | | Run keyword | DUT1.Add DPDK Dev Parameter | ${dut1_if2_2_pci}
2253 | | ... | vlan-strip-offload | off
2254 | | Run keyword | DUT2.Add DPDK Dev Parameter | ${dut2_if1_1_pci}
2255 | | ... | vlan-strip-offload | off
2256 | | Run keyword | DUT2.Add DPDK Dev Parameter | ${dut2_if1_2_pci}
2257 | | ... | vlan-strip-offload | off
2259 | Add DPDK bonded ethernet interfaces to DUTs in 3-node single link topology
2261 | | ... | Add DPDK bonded Ethernet interfaces with mode XOR and transmit policy
2262 | | ... | l34 to VPP configuration file.
2264 | | Run keyword | DUT1.Add DPDK Eth Bond Dev | 0 | 2 | l34 | ${dut1_if2_pci}
2265 | | Run keyword | DUT2.Add DPDK Eth Bond Dev | 0 | 2 | l34 | ${dut2_if1_pci}
2267 | Add DPDK bonded ethernet interfaces to topology file in 3-node single link topology
2268 | | Add Eth Interface | ${dut1} | ${dut1_eth_bond_if1_name} | ifc_pfx=eth_bond
2269 | | Add Eth Interface | ${dut2} | ${dut2_eth_bond_if1_name} | ifc_pfx=eth_bond
2271 | Configure chains of NFs connected via vhost-user
2273 | | ... | Start 1..N chains of 1..N QEMU guests (VNFs) with two vhost-user\
2274 | | ... | interfaces and interconnecting NF.
2276 | | ... | *Arguments:*
2277 | | ... | - nf_chains - Number of chains of NFs. Type: integer
2278 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
2279 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
2280 | | ... | in the test. Type: boolean
2281 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer
2282 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2283 | | ... | Type: boolean
2284 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
2285 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
2286 | | ... | - vnf - Network function as a payload. Type: string
2288 | | ... | *Example:*
2290 | | ... | \| Configure chains of VMs connected via vhost-user
2291 | | ... | \| 1 \| 1 \| False \| 1024 \| False \| False \| vpp
2293 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${jumbo}=${False}
2294 | | ... | ${perf_qemu_qsz}=${1024} | ${use_tuned_cfs}=${False}
2295 | | ... | ${auto_scale}=${True} | ${vnf}=vpp
2297 | | Import Library | resources.libraries.python.QemuManager | ${nodes}
2298 | | ... | WITH NAME | vnf_manager
2299 | | Run Keyword | vnf_manager.Construct VMs on all nodes
2300 | | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | jumbo=${jumbo}
2301 | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs}
2302 | | ... | auto_scale=${auto_scale} | vnf=${vnf}
2303 | | ... | tg_if1_mac=${tg_if1_mac} | tg_if2_mac=${tg_if2_mac}
2304 | | ... | cpu_count_int=${cpu_count_int} | rxq_count_int=${rxq_count_int}
2305 | | Run Keyword | vnf_manager.Start All VMs | pinning=${True}
2306 | | Run Keyword If | ${use_tuned_cfs} | vnf_manager.Set Scheduler All VMs
2307 | | All VPP Interfaces Ready Wait | ${nodes}
2308 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual
2310 | Configure guest VM with dpdk-testpmd connected via vhost-user
2312 | | ... | Start QEMU guest with two vhost-user interfaces and interconnecting\
2313 | | ... | DPDK testpmd.
2315 | | ... | *Arguments:*
2316 | | ... | - dut - DUT node to start guest VM on. Type: dictionary
2317 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
2318 | | ... | - sock2 - Socket path for second Vhost-User interface.
2319 | | ... | Type: string
2320 | | ... | - vm_name - QemuUtil instance name. Type: string
2321 | | ... | - nf_cpus: List of allocated CPUs. Type: list
2322 | | ... | - qemu_id - Qemu Id when starting more then one guest VM on DUT
2323 | | ... | node. Type: integer
2324 | | ... | - jumbo - Set True if jumbo frames are used in the test.
2325 | | ... | Type: bool
2326 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: int
2327 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2328 | | ... | Type: bool
2329 | | ... | - auto_scale - Whether to use same amount of RXQs for vhost interface
2330 | | ... | in VM as vswitch, otherwise use single RXQ. Type: boolean
2333 | | ... | KW uses test variables \${rxq_count_int}, \${thr_count_int} and
2334 | | ... | \${cpu_count_int} set by "Add worker threads and rxqueues to all DUTs"
2336 | | ... | *Example:*
2338 | | ... | \| Configure guest VM with dpdk-testpmd connected via vhost-user \
2339 | | ... | \| ${nodes['DUT1']} \| /tmp/sock-1-1 \| /tmp/sock-1-2 \
2340 | | ... | \| DUT1_VM2 \| qemu_id=${2} \|
2342 | | [Arguments] | ${dut} | ${sock1} | ${sock2} | ${vm_name} | ${nf_cpus}
2343 | | ... | ${qemu_id}=${1} | ${jumbo}=${False} | ${perf_qemu_qsz}=${1024}
2344 | | ... | ${use_tuned_cfs}=${False} | ${auto_scale}=${True}
2346 | | ${apply_patch}= | Set Variable | ${False}
2347 | | ${perf_qemu_path}= | Set Variable If | ${apply_patch}
2348 | | ... | ${perf_qemu_path}-patch/bin
2349 | | ... | ${perf_qemu_path}-base/bin
2350 | | ${nf_cpus_count}= | Get Length | ${nf_cpus}
2351 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
2352 | | ... | Set Variable | ${rxq_count_int}
2353 | | ... | ELSE | Set Variable | ${1}
2354 | | Import Library | resources.libraries.python.QemuUtils | ${nodes['${dut}']}
2355 | | ... | qemu_id=${qemu_id} | smp=${nf_cpus_count} | mem=${2048}
2356 | | ... | img=${perf_vm_image} | bin_path=${perf_qemu_path}
2357 | | ... | WITH NAME | ${vm_name}
2358 | | Run Keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
2359 | | ... | jumbo_frames=${jumbo} | queues=${rxq_count_int}
2360 | | ... | queue_size=${perf_qemu_qsz}
2361 | | Run Keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
2362 | | ... | jumbo_frames=${jumbo} | queues=${rxq_count_int}
2363 | | ... | queue_size=${perf_qemu_qsz}
2364 | | Run Keyword If | ${qemu_build} | ${vm_name}.Build QEMU | ${nodes['${dut}']}
2365 | | ... | apply_patch=${apply_patch}
2366 | | ${vm}= | Run Keyword | ${vm_name}.Qemu Start
2367 | | Run Keyword | ${vm_name}.Qemu Set Affinity | @{nf_cpus}
2368 | | Run Keyword If | ${use_tuned_cfs} | ${vm_name}.Qemu Set Scheduler Policy
2369 | | ${max_pkt_len}= | Set Variable If | ${jumbo} | 9200 | ${EMPTY}
2370 | | ${testpmd_cpus}= | Cpu list per node str | ${nodes['${dut}']} | ${0}
2371 | | ... | cpu_cnt=${nf_cpus_count}
2372 | | Dpdk Testpmd Start | ${vm} | eal_corelist=${testpmd_cpus}
2373 | | ... | eal_mem_channels=4 | pmd_fwd_mode=io | pmd_disable_hw_vlan=${TRUE}
2374 | | ... | pmd_rxd=${perf_qemu_qsz} | pmd_txd=${perf_qemu_qsz}
2375 | | ... | pmd_rxq=${rxq} | pmd_txq=${rxq} | pmd_max_pkt_len=${max_pkt_len}
2376 | | Return From Keyword | ${vm}
2378 | Configure guest VMs with dpdk-testpmd connected via vhost-user on node
2380 | | ... | Start vm_count QEMU guests with two vhost-user interfaces and\
2381 | | ... | interconnecting DPDK testpmd for defined number of VMs on all defined\
2382 | | ... | VPP nodes.
2384 | | ... | *Arguments:*
2385 | | ... | - dut - DUT node to start guest VM on. Type: dictionary
2386 | | ... | - vm_count - Number of guest VMs. Type: int
2387 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
2388 | | ... | in the test. Type: boolean
2389 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: int
2390 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2391 | | ... | Type: bool
2393 | | ... | *Example:*
2395 | | ... | \| Configure guest VMs with dpdk-testpmd connected via \
2396 | | ... | vhost-user on node \| DUT1 \| 1 \| False \| 1024 \|
2398 | | [Arguments] | ${dut} | ${vm_count}=${1} | ${jumbo}=${False} |
2399 | | ... | ${perf_qemu_qsz}=${1024} | ${use_tuned_cfs}=${False}
2401 | | :FOR | ${number} | IN RANGE | 1 | ${vm_count}+1
2402 | | | ${nf_cpus}= | Create network function CPU list | ${dut}
2403 | | | ... | chains=${1} | nodeness=${vm_count} | chain_id=${1}
2404 | | | ... | node_id=${number} | auto_scale=${True}
2405 | | | ${sock1}= | Set Variable | /var/run/vpp/sock-${number}-1
2406 | | | ${sock2}= | Set Variable | /var/run/vpp/sock-${number}-2
2408 | | | ... | Configure guest VM with dpdk-testpmd connected via vhost-user
2409 | | | ... | ${dut} | ${sock1} | ${sock2} | ${TEST NAME}${dut}_VM${number}
2410 | | | ... | ${nf_cpus} | qemu_id=${number} | jumbo=${jumbo}
2411 | | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs}
2412 | | | Set To Dictionary | ${${dut}_vm_refs} | ${TEST NAME}${dut}_VM${number}
2415 | Configure guest VMs with dpdk-testpmd connected via vhost-user
2417 | | ... | Start vm_count QEMU guests with two vhost-user interfaces and\
2418 | | ... | interconnecting DPDK testpmd defined number of VMs on all defined VPP\
2421 | | ... | *Arguments:*
2422 | | ... | - vm_count - Number of guest VMs. Type: int
2423 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
2424 | | ... | in the test. Type: boolean
2425 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: int
2426 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2427 | | ... | Type: bool
2429 | | ... | *Example:*
2431 | | ... | \| Configure guest VMs with dpdk-testpmd connected via vhost-user\
2432 | | ... | \| 1 \| False \| 1024 \|
2434 | | [Arguments] | ${vm_count}=${1} | ${jumbo}=${False}
2435 | | ... | ${perf_qemu_qsz}=${1024} | ${use_tuned_cfs}=${False}
2437 | | ${duts}= | Get Matches | ${nodes} | DUT*
2438 | | :FOR | ${dut} | IN | @{duts}
2439 | | | Configure guest VMs with dpdk-testpmd connected via vhost-user on node
2440 | | | ... | ${dut} | vm_count=${vm_count} | jumbo=${jumbo}
2441 | | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${False}
2442 | | All VPP Interfaces Ready Wait | ${nodes} | timeout=${90}
2443 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual
2445 | Configure guest VM with dpdk-testpmd-mac connected via vhost-user
2447 | | ... | Start QEMU guest with two vhost-user interfaces and interconnecting\
2448 | | ... | DPDK testpmd.
2450 | | ... | *Arguments:*
2451 | | ... | - dut - DUT node to start guest VM on. Type: dictionary
2452 | | ... | - sock1 - Socket path for first Vhost-User interface.
2453 | | ... | Type: string
2454 | | ... | - sock2 - Socket path for second Vhost-User interface.
2455 | | ... | Type: string
2456 | | ... | - vm_name - QemuUtil instance name. Type: string
2457 | | ... | - eth0_mac - MAC address of first Vhost interface. Type: string
2458 | | ... | - eth1_mac - MAC address of second Vhost interface. Type: string
2459 | | ... | - nf_cpus: List of allocated CPUs. Type: list
2460 | | ... | - qemu_id - Qemu Id when starting more then one guest VM on DUT
2461 | | ... | node. Type: integer
2462 | | ... | - jumbo - Set True if jumbo frames are used in the test.
2463 | | ... | Type: bool
2464 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: int
2465 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2466 | | ... | Type: bool
2467 | | ... | - auto_scale - Whether to use same amount of RXQs for vhost interface
2468 | | ... | in VM as vswitch, otherwise use single RXQ. Type: boolean
2471 | | ... | KW uses test variables \${rxq_count_int}, \${thr_count_int} and
2472 | | ... | \${cpu_count_int} set by "Add worker threads and rxqueues to all DUTs"
2474 | | ... | *Example:*
2476 | | ... | \| Configure guest VM with dpdk-testpmd-mac connected via vhost-user \
2477 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \
2478 | | ... | \| 00:00:00:00:00:01 \| 00:00:00:00:00:02 \|
2480 | | [Arguments] | ${dut} | ${sock1} | ${sock2} | ${vm_name}
2481 | | ... | ${eth0_mac} | ${eth1_mac} | ${nf_cpus} | ${qemu_id}=${1}
2482 | | ... | ${jumbo}=${False} | ${perf_qemu_qsz}=${1024}
2483 | | ... | ${use_tuned_cfs}=${False} | ${auto_scale}=${True}
2485 | | ${apply_patch}= | Set Variable | ${False}
2486 | | ${perf_qemu_path}= | Set Variable If | ${apply_patch}
2487 | | ... | ${perf_qemu_path}-patch/bin
2488 | | ... | ${perf_qemu_path}-base/bin
2489 | | ${nf_cpus_count}= | Get Length | ${nf_cpus}
2490 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
2491 | | ... | Set Variable | ${rxq_count_int}
2492 | | ... | ELSE | Set Variable | ${1}
2493 | | Import Library | resources.libraries.python.QemuUtils | ${nodes['${dut}']}
2494 | | ... | qemu_id=${qemu_id} | smp=${nf_cpus_count} | mem=${2048}
2495 | | ... | img=${perf_vm_image} | bin_path=${perf_qemu_path}
2496 | | ... | WITH NAME | ${vm_name}
2497 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
2498 | | ... | jumbo_frames=${jumbo} | queues=${rxq_count_int}
2499 | | ... | queue_size=${perf_qemu_qsz}
2500 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
2501 | | ... | jumbo_frames=${jumbo} | queues=${rxq_count_int}
2502 | | ... | queue_size=${perf_qemu_qsz}
2503 | | Run Keyword If | ${qemu_build} | ${vm_name}.Build QEMU | ${nodes['${dut}']}
2504 | | ... | apply_patch=${False}
2505 | | ${vm}= | Run keyword | ${vm_name}.Qemu Start
2506 | | Run keyword | ${vm_name}.Qemu Set Affinity | @{nf_cpus}
2507 | | Run keyword If | ${use_tuned_cfs} | ${vm_name}.Qemu Set Scheduler Policy
2508 | | ${max_pkt_len}= | Set Variable If | ${jumbo} | 9200 | ${EMPTY}
2509 | | ${testpmd_cpus}= | Cpu list per node str | ${nodes['${dut}']} | ${0}
2510 | | ... | cpu_cnt=${nf_cpus_count}
2511 | | Dpdk Testpmd Start | ${vm} | eal_corelist=${testpmd_cpus}
2512 | | ... | eal_mem_channels=4 | pmd_fwd_mode=mac | pmd_eth_peer_0=0,${eth0_mac}
2513 | | ... | pmd_eth_peer_1=1,${eth1_mac} | pmd_disable_hw_vlan=${TRUE}
2514 | | ... | pmd_rxd=${perf_qemu_qsz} | pmd_txd=${perf_qemu_qsz}
2515 | | ... | pmd_rxq=${rxq} | pmd_txq=${rxq} | pmd_max_pkt_len=${max_pkt_len}
2516 | | Return From Keyword | ${vm}
2518 | Configure guest VMs with dpdk-testpmd-mac connected via vhost-user on node
2520 | | ... | Start vm_count QEMU guests with two vhost-user interfaces and\
2521 | | ... | interconnecting DPDK testpmd with fwd mode set to mac rewrite for\
2522 | | ... | defined number of VMs on all defined VPP nodes.
2524 | | ... | *Arguments:*
2525 | | ... | - dut - DUT node to start guest VM on. Type: dictionary
2526 | | ... | - vm_count - Number of guest VMs. Type: int
2527 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
2528 | | ... | in the test. Type: boolean
2529 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: int
2530 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2531 | | ... | Type: bool
2533 | | ... | _NOTE:_ This KW expects following test case variables to be set:
2534 | | ... | - cpu_count_int - Number of Physical CPUs allocated for DUT.
2536 | | ... | *Example:*
2538 | | ... | \| Configure guest VMs with dpdk-testpmd-mac connected via \
2539 | | ... | vhost-user on node \| DUT1 \| 1 \| False \| 1024 \|
2541 | | [Arguments] | ${dut} | ${vm_count}=${1} | ${jumbo}=${False} |
2542 | | ... | ${perf_qemu_qsz}=${1024} | ${use_tuned_cfs}=${False}
2544 | | :FOR | ${number} | IN RANGE | 1 | ${vm_count}+1
2545 | | | ${nf_cpus}= | Create network function CPU list | ${dut}
2546 | | | ... | chains=${1} | nodeness=${vm_count} | chain_id=${1}
2547 | | | ... | node_id=${number} | auto_scale=${True}
2548 | | | ${sock1}= | Set Variable | /var/run/vpp/sock-${number}-1
2549 | | | ${sock2}= | Set Variable | /var/run/vpp/sock-${number}-2
2551 | | | ... | Configure guest VM with dpdk-testpmd-mac connected via vhost-user
2552 | | | ... | ${dut} | ${sock1} | ${sock2} | ${TEST NAME}${dut}_VM${number}
2553 | | | ... | ${${dut}-vhost-${number}-if1_mac}
2554 | | | ... | ${${dut}-vhost-${number}-if2_mac} | nf_cpus=${nf_cpus}
2555 | | | ... | qemu_id=${number} | jumbo=${jumbo} | perf_qemu_qsz=${perf_qemu_qsz}
2556 | | | ... | use_tuned_cfs=${use_tuned_cfs}
2557 | | | Set To Dictionary | ${${dut}_vm_refs} | ${TEST NAME}${dut}_VM${number}
2560 | Configure guest VMs with dpdk-testpmd-mac connected via vhost-user
2562 | | ... | Start vm_count QEMU guests with two vhost-user interfaces and\
2563 | | ... | interconnecting DPDK testpmd with fwd mode set to mac rewrite for\
2564 | | ... | defined number of VMs on all defined VPP nodes.
2566 | | ... | *Arguments:*
2567 | | ... | - vm_count - Number of guest VMs. Type: int
2568 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
2569 | | ... | in the test. Type: boolean
2570 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: int
2571 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2572 | | ... | Type: bool
2574 | | ... | *Example:*
2576 | | ... | \| Configure guest VMs with dpdk-testpmd-mac connected via vhost-user\
2577 | | ... | \| 1 \| False \| 1024 \|
2579 | | [Arguments] | ${vm_count}=${1} | ${jumbo}=${False}
2580 | | ... | ${perf_qemu_qsz}=${1024} | ${use_tuned_cfs}=${False}
2582 | | ${duts}= | Get Matches | ${nodes} | DUT*
2583 | | :FOR | ${dut} | IN | @{duts}
2584 | | | Configure guest VMs with dpdk-testpmd-mac connected via vhost-user on node
2585 | | | ... | ${dut} | vm_count=${vm_count} | jumbo=${jumbo}
2586 | | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${False}
2587 | | All VPP Interfaces Ready Wait | ${nodes} | timeout=${90}
2588 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual
2590 | Configure chain of NFs with dpdk-testpmd-mac connected via vhost-user on node
2592 | | ... | Start 1 chain of 1..N QEMU guests (VNFs) with two vhost-user\
2593 | | ... | interfaces and interconnecting DPDK testpmd with fwd mode set to mac\
2594 | | ... | rewrite on VPP node.
2596 | | ... | *Arguments:*
2597 | | ... | - dut - DUT node to start guest VM on. Type: dictionary
2598 | | ... | - nf_chains - Number of chains of NFs. Type: integer
2599 | | ... | - nf_chain - NF chain ID. Type: integer
2600 | | ... | - nf_nodes - Number of guest VMs. Type: integer
2601 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
2602 | | ... | in the test. Type: boolean
2603 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer
2604 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2605 | | ... | Type: boolean
2606 | | ... | - auto_scale - Whether to use same amount of RXQs for vhost interface
2607 | | ... | in VM as vswitch, otherwise use single RXQ. Type: boolean
2609 | | ... | *Example:*
2611 | | ... | \| Configure chain of NFs with dpdk-testpmd-mac connected via \
2612 | | ... | vhost-user on node \| DUT1 \| 1 \| 1 \| 1 \| False \| 1024 \|
2614 | | [Arguments] | ${dut} | ${nf_chains}=${1} | ${nf_chain}=${1}
2615 | | ... | ${nf_nodes}=${1} | ${jumbo}=${False} | ${perf_qemu_qsz}=${1024}
2616 | | ... | ${use_tuned_cfs}=${False} | ${auto_scale}=${False}
2618 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2619 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2620 | | :FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes} + ${1}
2621 | | | ${nf_cpus}= | Create network function CPU list | ${dut}
2622 | | | ... | chains=${nf_chains} | nodeness=${nf_nodes} | chain_id=${nf_chain}
2623 | | | ... | node_id=${nf_node} | auto_scale=${False}
2624 | | | ${qemu_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
2625 | | | ${sock1}= | Set Variable | /var/run/vpp/sock-${qemu_id}-1
2626 | | | ${sock2}= | Set Variable | /var/run/vpp/sock-${qemu_id}-2
2627 | | | ${nf_name}= | Set Variable | ${dut}_VM${qemu_id}
2628 | | | ${prev_qemu_id}= | Evaluate | ${qemu_id} - ${1}
2629 | | | ${next_qemu_id}= | Evaluate | ${qemu_id} + ${1}
2630 | | | ${prev_qemu_id_hex}= | Convert To Hex | ${prev_qemu_id} | length=2
2631 | | | ... | lowercase=yes
2632 | | | ${next_qemu_id_hex}= | Convert To Hex | ${next_qemu_id} | length=2
2633 | | | ... | lowercase=yes
2634 | | | ${vif1_mac}= | Set Variable If | ${nf_node} == ${1}
2635 | | | ... | ${tg_if1_mac}
2636 | | | ... | 52:54:00:00:${prev_qemu_id_hex}:02
2637 | | | ${vif2_mac}= | Set Variable If | ${nf_node} == ${nf_nodes}
2638 | | | ... | ${tg_if2_mac}
2639 | | | ... | 52:54:00:00:${next_qemu_id_hex}:01
2641 | | | ... | Configure guest VM with dpdk-testpmd-mac connected via vhost-user
2642 | | | ... | ${dut} | ${sock1} | ${sock2} | ${nf_name} | ${vif1_mac}
2643 | | | ... | ${vif2_mac} | ${nf_cpus} | qemu_id=${qemu_id} | jumbo=${jumbo}
2644 | | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs}
2645 | | | ... | auto_scale=${auto_scale}
2646 | | | Set To Dictionary | ${${dut}_vm_refs} | ${nf_name} | ${vm}
2648 | Configure chain of NFs with dpdk-testpmd-mac connected via vhost-user
2650 | | ... | Start 1 chain of 1..N QEMU guests (VNFs) with two vhost-user\
2651 | | ... | interfaces and interconnecting DPDK testpmd with fwd mode set to mac\
2652 | | ... | rewrite on all defined VPP nodes.
2654 | | ... | *Arguments:*
2655 | | ... | - nf_chains - Number of chains of NFs. Type: integer
2656 | | ... | - nf_chain - NF chain ID. Type: integer
2657 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
2658 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
2659 | | ... | in the test. Type: boolean
2660 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer
2661 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2662 | | ... | Type: boolean
2663 | | ... | - auto_scale - Whether to use same amount of RXQs for vhost interface
2664 | | ... | in VM as vswitch, otherwise use single RXQ. Type: boolean
2666 | | ... | *Example:*
2668 | | ... | \| Configure chain of NFs with dpdk-testpmd-mac connected via\
2669 | | ... | vhost-user \| 1 \| 1 \| 1 \| False \| 1024 \|
2671 | | [Arguments] | ${nf_chains}=${1} | ${nf_chain}=${1} | ${nf_nodes}=${1}
2672 | | ... | ${jumbo}=${False} | ${perf_qemu_qsz}=${1024}
2673 | | ... | ${use_tuned_cfs}=${False} | ${auto_scale}=${False}
2675 | | ${duts}= | Get Matches | ${nodes} | DUT*
2676 | | :FOR | ${dut} | IN | @{duts}
2677 | | | Configure chain of NFs with dpdk-testpmd-mac connected via vhost-user on node
2678 | | | ... | ${dut} | nf_chains=${nf_chains} | nf_chain=${nf_chain}
2679 | | | ... | nf_nodes=${nf_nodes} | jumbo=${jumbo}
2680 | | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${False}
2681 | | | ... | auto_scale=${auto_scale}
2683 | Configure chains of NFs with dpdk-testpmd-mac connected via vhost-user
2685 | | ... | Start 1..N chains of 1..N QEMU guests (VNFs) with two vhost-user\
2686 | | ... | interfaces and interconnecting DPDK testpmd with fwd mode set to mac\
2687 | | ... | rewrite on all defined VPP nodes.
2689 | | ... | *Arguments:*
2690 | | ... | - nf_chains - Number of chains of NFs. Type: integer
2691 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
2692 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
2693 | | ... | in the test. Type: boolean
2694 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer
2695 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2696 | | ... | Type: boolean
2697 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
2698 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
2700 | | ... | *Example:*
2702 | | ... | \| Configure chains of VMs with dpdk-testpmd-mac connected via \
2703 | | ... | vhost-user \| 1 \| 1 \| False \| 1024 \|
2705 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${jumbo}=${False}
2706 | | ... | ${perf_qemu_qsz}=${1024} | ${use_tuned_cfs}=${False}
2707 | | ... | ${auto_scale}=${False}
2709 | | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
2710 | | | Configure chain of NFs with dpdk-testpmd-mac connected via vhost-user
2711 | | | ... | nf_chains=${nf_chains} | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
2712 | | | ... | jumbo=${jumbo} | perf_qemu_qsz=${perf_qemu_qsz}
2713 | | | ... | use_tuned_cfs=${False} | auto_scale=${auto_scale}
2714 | | All VPP Interfaces Ready Wait | ${nodes}
2715 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual
2717 | Initialize LISP IPv4 forwarding in 3-node circular topology
2718 | | [Documentation] | Custom setup of IPv4 addresses on all DUT nodes and TG \
2719 | | ... | Don`t set route.
2721 | | ... | *Arguments:*
2722 | | ... | - dut1_dut2_address - Ip address from DUT1 to DUT2. Type: string
2723 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
2724 | | ... | - dut2_dut1_address - Ip address from DUT2 to DUT1. Type: string
2725 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
2726 | | ... | - duts_prefix - ip prefix. Type: int
2729 | | ... | - No value returned
2731 | | ... | *Example:*
2732 | | ... | \| Initialize LISP IPv4 forwarding in 3-node circular topology \
2733 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
2734 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
2736 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
2737 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${duts_prefix}
2739 | | Set interfaces in path up
2740 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2741 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2742 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2743 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2744 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
2745 | | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_dut1_address}
2746 | | ... | ${dut2_if1_mac}
2747 | | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_dut2_address}
2748 | | ... | ${dut1_if2_mac}
2749 | | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
2750 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
2751 | | ... | ${dut1_tg_address} | ${duts_prefix}
2752 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
2753 | | ... | ${dut1_dut2_address} | ${duts_prefix}
2754 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
2755 | | ... | ${dut2_dut1_address} | ${duts_prefix}
2756 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2}
2757 | | ... | ${dut2_tg_address} | ${duts_prefix}
2759 | Initialize LISP GPE IPv4 over IPsec in 3-node circular topology
2760 | | [Documentation] | Setup Lisp GPE IPv4 forwarding over IPsec.
2762 | | ... | *Arguments:*
2763 | | ... | - encr_alg - Encryption algorithm. Type: string
2764 | | ... | - auth_alg - Authentication algorithm. Type: string
2767 | | ... | - No value returned
2769 | | ... | *Example:*
2770 | | ... | \| Initialize LISP GPE IPv4 over IPsec in 3-node circular topology\
2771 | | ... | \| ${encr_alg} \| ${auth_alg}
2773 | | [Arguments] | ${encr_alg} | ${auth_alg}
2775 | | Generate keys for IPSec | ${encr_alg} | ${auth_alg}
2776 | | Initialize LISP IPv4 forwarding in 3-node circular topology
2777 | | ... | ${dut1_to_dut2_ip4} | ${dut1_to_tg_ip4} | ${dut2_to_dut1_ip4}
2778 | | ... | ${dut2_to_tg_ip4} | ${prefix4}
2779 | | Configure LISP GPE topology in 3-node circular topology
2780 | | ... | ${dut1} | ${dut1_if2} | ${NONE}
2781 | | ... | ${dut2} | ${dut2_if1} | ${NONE}
2782 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
2783 | | ... | ${dut1_ip4_static_adjacency} | ${dut2_ip4_static_adjacency}
2784 | | Configure manual keyed connection for IPSec
2785 | | ... | ${dut1} | ${dut1_if2} | ${encr_alg} | ${encr_key}
2786 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
2787 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
2788 | | Configure manual keyed connection for IPSec
2789 | | ... | ${dut2} | ${dut2_if1} | ${encr_alg} | ${encr_key}
2790 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
2791 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
2793 | Initialize LISP IPv6 forwarding in 3-node circular topology
2794 | | [Documentation] | Custom setup of IPv6 topology on all DUT nodes \
2795 | | ... | Don`t set route.
2797 | | ... | *Arguments:*
2798 | | ... | - dut1_dut2_address - Ip address from DUT1 to DUT2. Type: string
2799 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
2800 | | ... | - dut2_dut1_address - Ip address from DUT2 to DUT1. Type: string
2801 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
2802 | | ... | - duts_prefix - ip prefix. Type: int
2805 | | ... | - No value returned
2807 | | ... | *Example:*
2808 | | ... | \| Initialize LISP IPv6 forwarding in 3-node circular topology \
2809 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
2810 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
2812 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
2813 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${prefix}
2815 | | Set interfaces in path up
2816 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2817 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2818 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2819 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2820 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_tg_address}
2822 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_dut2_address}
2824 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_dut1_address}
2826 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_tg_address}
2828 | | Suppress ICMPv6 router advertisement message | ${nodes}
2829 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
2830 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
2831 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_dut1_address}
2832 | | ... | ${dut2_if1_mac}
2833 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_dut2_address}
2834 | | ... | ${dut1_if2_mac}
2836 | Initialize LISP IPv4 over IPv6 forwarding in 3-node circular topology
2837 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
2838 | | ... | Don`t set route.
2840 | | ... | *Arguments:*
2841 | | ... | - dut1_dut2_ip6_address - IPv6 address from DUT1 to DUT2.
2842 | | ... | Type: string
2843 | | ... | - dut1_tg_ip4_address - IPv4 address from DUT1 to tg. Type: string
2844 | | ... | - dut2_dut1_ip6_address - IPv6 address from DUT2 to DUT1.
2845 | | ... | Type: string
2846 | | ... | - dut1_tg_ip4_address - IPv4 address from DUT1 to tg. Type: string
2847 | | ... | - prefix4 - IPv4 prefix. Type: int
2848 | | ... | - prefix6 - IPv6 prefix. Type: int
2851 | | ... | - No value returned
2853 | | ... | *Example:*
2854 | | ... | \| Lisp IPv4 over IPv6 forwarding initialized in a 3-node circular \
2855 | | ... | topology \| ${dut1_dut2_ip6_address} \| ${dut1_tg_ip4_address} \
2856 | | ... | \| ${dut2_dut1_ip6_address} \| ${dut2_tg_ip4_address} \
2857 | | ... | \| ${prefix4} \| ${prefix6} \|
2859 | | [Arguments] | ${dut1_dut2_ip6_address} | ${dut1_tg_ip4_address}
2860 | | ... | ${dut2_dut1_ip6_address} | ${dut2_tg_ip4_address}
2861 | | ... | ${prefix4} | ${prefix6}
2863 | | Set interfaces in path up
2864 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2865 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2866 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2867 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2868 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
2869 | | ... | ${dut1_tg_ip4_address} | ${prefix4}
2870 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_dut2_ip6_address}
2871 | | ... | ${prefix6}
2872 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_dut1_ip6_address}
2873 | | ... | ${prefix6}
2874 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2}
2875 | | ... | ${dut2_tg_ip4_address} | ${prefix4}
2876 | | Suppress ICMPv6 router advertisement message | ${nodes}
2877 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
2878 | | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
2879 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip6_address}
2880 | | ... | ${dut2_if1_mac}
2881 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip6_address}
2882 | | ... | ${dut1_if2_mac}
2884 | Initialize LISP IPv6 over IPv4 forwarding in 3-node circular topology
2885 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
2886 | | ... | Don`t set route.
2888 | | ... | *Arguments:*
2889 | | ... | - dut1_dut2_ip4_address - IPv4 address from DUT1 to DUT2.
2890 | | ... | Type: string
2891 | | ... | - dut1_tg_ip6_address - IPv6 address from DUT1 to tg. Type: string
2892 | | ... | - dut2_dut1_ip4_address - IPv4 address from DUT2 to DUT1.
2893 | | ... | Type: string
2894 | | ... | - dut1_tg_ip6_address - IPv6 address from DUT1 to tg. Type: string
2895 | | ... | - prefix4 - IPv4 prefix. Type: int
2896 | | ... | - prefix6 - IPv6 prefix. Type: int
2899 | | ... | - No value returned
2901 | | ... | *Example:*
2902 | | ... | \| Lisp IPv6 over IPv4 forwarding initialized in a 3-node circular \
2903 | | ... | topology \| ${dut1_dut2_ip4_address} \| ${dut1_tg_ip6_address} \
2904 | | ... | \| ${dut2_dut1_ip4_address} \| ${dut2_tg_ip6_address} \
2905 | | ... | \| ${prefix6} \| ${prefix4} \|
2907 | | [Arguments] | ${dut1_dut2_ip4_address} | ${dut1_tg_ip6_address}
2908 | | ... | ${dut2_dut1_ip4_address} | ${dut2_tg_ip6_address}
2909 | | ... | ${prefix6} | ${prefix4}
2911 | | Set interfaces in path up
2912 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2913 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2914 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2915 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2916 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_tg_ip6_address}
2917 | | ... | ${prefix6}
2918 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
2919 | | ... | ${dut1_dut2_ip4_address} | ${prefix4}
2920 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
2921 | | ... | ${dut2_dut1_ip4_address} | ${prefix4}
2922 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_tg_ip6_address}
2923 | | ... | ${prefix6}
2924 | | Suppress ICMPv6 router advertisement message | ${nodes}
2925 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
2926 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
2927 | | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip4_address}
2928 | | ... | ${dut2_if1_mac}
2929 | | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip4_address}
2930 | | ... | ${dut1_if2_mac}
2932 | Initialize NAT44 in circular topology
2933 | | [Documentation] | Initialization of 2-node / 3-node topology with NAT44
2934 | | ... | between DUTs:
2935 | | ... | - set interfaces up
2936 | | ... | - set IP addresses
2938 | | ... | - create routes
2939 | | ... | - set NAT44 - only on DUT1
2941 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
2942 | | ... | Variable Should Exist | ${dut2}
2944 | | Set interfaces in path up
2946 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 10.0.0.1 | 20
2947 | | Run Keyword If | '${dut2_status}' == 'PASS'
2948 | | ... | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 11.0.0.1 | 20
2949 | | Run Keyword If | '${dut2_status}' == 'PASS'
2950 | | ... | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 11.0.0.2 | 20
2951 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
2952 | | ... | Set Variable | ${dut2}
2953 | | ... | ELSE | Set Variable | ${dut1}
2954 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
2955 | | ... | Set Variable | ${dut2_if2}
2956 | | ... | ELSE | Set Variable | ${dut1_if2}
2957 | | Configure IP addresses on interfaces | ${dut} | ${dut_if2} | 12.0.0.1 | 20
2959 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2960 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2961 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
2962 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
2963 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
2964 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
2966 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.0.0.2 | ${tg_if1_mac}
2967 | | Run Keyword If | '${dut2_status}' == 'PASS'
2968 | | ... | Add arp on dut | ${dut1} | ${dut1_if2} | 11.0.0.2 | ${dut2_if1_mac}
2969 | | Run Keyword If | '${dut2_status}' == 'PASS'
2970 | | ... | Add arp on dut | ${dut2} | ${dut2_if1} | 11.0.0.1 | ${dut1_if2_mac}
2971 | | Add arp on dut | ${dut} | ${dut_if2} | 12.0.0.2 | ${tg_if2_mac}
2973 | | Vpp Route Add | ${dut1} | 20.0.0.0 | 18 | gateway=10.0.0.2
2974 | | ... | interface=${dut1_if1}
2975 | | Run Keyword If | '${dut2_status}' == 'PASS'
2976 | | ... | Vpp Route Add | ${dut1} | 12.0.0.2 | 32 | gateway=11.0.0.2
2977 | | ... | interface=${dut1_if2}
2978 | | Run Keyword If | '${dut2_status}' == 'PASS'
2979 | | ... | Vpp Route Add | ${dut2} | 12.0.0.0 | 24 | gateway=12.0.0.2
2980 | | ... | interface=${dut2_if2}
2981 | | Run Keyword If | '${dut2_status}' == 'PASS'
2982 | | ... | Vpp Route Add | ${dut2} | 200.0.0.0 | 30 | gateway=11.0.0.1
2983 | | ... | interface=${dut2_if1}
2985 | | Configure inside and outside interfaces
2986 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if2}
2987 | | Configure deterministic mode for NAT44
2988 | | ... | ${dut1} | 20.0.0.0 | 18 | 200.0.0.0 | 30
2990 | Initialize L2 xconnect with memif pairs on DUT node
2992 | | ... | Create pairs of Memif interfaces on DUT node. Cross connect each Memif
2993 | | ... | interface with one physical interface or virtual interface to create
2994 | | ... | a chain accross DUT node.
2996 | | ... | *Arguments:*
2997 | | ... | - dut - DUT node. Type: dictionary
2998 | | ... | - count - Number of memif pairs (containers). Type: integer
3001 | | ... | Socket paths for Memif are defined in following format:
3002 | | ... | - /tmp/memif-\${dut}_CNF\${number}-\${sid}
3004 | | ... | KW uses test variable \${rxq_count_int} set by KW Add worker threads
3005 | | ... | and rxqueues to all DUTs
3007 | | ... | *Example:*
3009 | | ... | \| Initialize L2 xconnect with memif pairs on DUT node \| ${dut} \
3010 | | ... | \| ${1} \|
3012 | | [Arguments] | ${dut} | ${count}
3014 | | :FOR | ${number} | IN RANGE | 1 | ${count}+1
3015 | | | ${sock1}= | Set Variable | memif-${dut}_CNF
3016 | | | ${sock2}= | Set Variable | memif-${dut}_CNF
3017 | | | ${prev_index}= | Evaluate | ${number}-1
3018 | | | Set up memif interfaces on DUT node | ${nodes['${dut}']}
3019 | | | ... | ${sock1} | ${sock2} | ${number} | ${dut}-memif-${number}-if1
3020 | | | ... | ${dut}-memif-${number}-if2 | ${rxq_count_int} | ${rxq_count_int}
3021 | | | ${xconnect_if1}= | Set Variable If | ${number}==1 | ${${dut}_if1}
3022 | | | ... | ${${dut}-memif-${prev_index}-if2}
3023 | | | Configure L2XC | ${nodes['${dut}']} | ${xconnect_if1}
3024 | | | ... | ${${dut}-memif-${number}-if1}
3025 | | | Run Keyword If | ${number}==${count} | Configure L2XC
3026 | | | ... | ${nodes['${dut}']} | ${${dut}-memif-${number}-if2} | ${${dut}_if2}
3028 | Initialize L2 xconnect with memif pairs
3030 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Cross
3031 | | ... | connect each Memif interface with one physical interface or virtual
3032 | | ... | interface to create a chain accross DUT node.
3034 | | ... | *Arguments:*
3035 | | ... | - count - Number of memif pairs (containers). Type: integer
3037 | | ... | *Example:*
3039 | | ... | \| Initialize L2 xconnect with memif pairs \| ${1} \|
3041 | | [Arguments] | ${count}=${1}
3043 | | ${duts}= | Get Matches | ${nodes} | DUT*
3044 | | :FOR | ${dut} | IN | @{duts}
3045 | | | Initialize L2 xconnect with memif pairs on DUT node | ${dut} | ${count}
3046 | | Set interfaces in path up
3047 | | Show Memif on all DUTs | ${nodes}
3048 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
3050 | Initialize L2 Bridge Domain with memif pairs on DUT node
3052 | | ... | Create pairs of Memif interfaces on DUT node. Put each Memif interface
3053 | | ... | to separate L2 bridge domain with one physical or memif interface
3054 | | ... | to create a chain accross DUT node.
3056 | | ... | *Arguments:*
3057 | | ... | - dut - DUT node. Type: dictionary
3058 | | ... | - nf_chain - NF chain. Type: integer
3059 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
3060 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
3061 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
3064 | | ... | Socket paths for Memif are defined in following format:
3065 | | ... | - /tmp/memif-\${dut}_CNF\${nf_id}-\${sid}
3067 | | ... | *Example:*
3069 | | ... | \| Initialize L2 Bridge Domain with memif pairs on DUT node \
3070 | | ... | \| ${dut} \| 1 \| 1 \|
3072 | | [Arguments] | ${dut} | ${nf_chain}=${1} | ${nf_nodes}=${1}
3073 | | ... | ${auto_scale}=${True}
3075 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
3076 | | ... | Set Variable | ${rxq_count_int}
3077 | | ... | ELSE | Set Variable | ${1}
3078 | | ${bd_id2}= | Evaluate | ${nf_nodes}+1
3079 | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1} | ${1}
3080 | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if2}
3082 | | :FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes}+1
3083 | | | ${nf_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
3084 | | | ${sock1}= | Set Variable | memif-${dut}_CNF
3085 | | | ${sock2}= | Set Variable | memif-${dut}_CNF
3086 | | | Set up memif interfaces on DUT node | ${nodes['${dut}']}
3087 | | | ... | ${sock1} | ${sock2} | ${nf_id} | ${dut}-memif-${nf_id}-if1
3088 | | | ... | ${dut}-memif-${nf_id}-if2 | ${rxq} | ${rxq}
3089 | | | ${bd_id2}= | Evaluate | ${nf_node}+1
3090 | | | Add interface to bridge domain | ${nodes['${dut}']}
3091 | | | ... | ${${dut}-memif-${nf_id}-if1} | ${nf_node}
3092 | | | Add interface to bridge domain | ${nodes['${dut}']}
3093 | | | ... | ${${dut}-memif-${nf_id}-if2} | ${bd_id2}
3095 | Initialize L2 Bridge Domain with memif pairs
3097 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
3098 | | ... | Memif interface to separate L2 bridge domain with one physical or
3099 | | ... | virtual interface to create a chain accross DUT node.
3101 | | ... | *Arguments:*
3102 | | ... | - nf_chain - NF chain. Type: integer
3103 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
3104 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
3105 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
3107 | | ... | *Example:*
3109 | | ... | \| Initialize L2 Bridge Domain with memif pairs \| 1 \| 1 \|
3111 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
3113 | | ${duts}= | Get Matches | ${nodes} | DUT*
3114 | | :FOR | ${dut} | IN | @{duts}
3115 | | | Initialize L2 Bridge Domain with memif pairs on DUT node | ${dut}
3116 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
3117 | | | ... | auto_scale=${auto_scale}
3119 | Initialize L2 Bridge Domain for multiple chains with memif pairs
3121 | | ... | Create pairs of Memif interfaces for defined number of NF chains
3122 | | ... | with defined number of NF nodes on all defined VPP nodes. Add each
3123 | | ... | Memif interface into L2 bridge domains with learning enabled
3124 | | ... | with physical inteface or Memif interface of another NF.
3126 | | ... | *Arguments:*
3127 | | ... | - nf_chains - Number of chains of NFs. Type: integer
3128 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
3129 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
3130 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
3132 | | ... | *Example:*
3134 | | ... | \| Initialize L2 Bridge Domain for multiple chains with memif pairs \
3135 | | ... | \| 1 \| 1 \|
3137 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
3139 | | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
3140 | | | Initialize L2 Bridge Domain with memif pairs | nf_chain=${nf_chain}
3141 | | | ... | nf_nodes=${nf_nodes} | auto_scale=${auto_scale}
3142 | | Set interfaces in path up
3143 | | Show Memif on all DUTs | ${nodes}
3144 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
3146 | Initialize L2 Bridge Domain for pipeline with memif pairs
3148 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
3149 | | ... | Memif interface to separate L2 bridge domain with one physical or
3150 | | ... | virtual interface to create a service pipeline on DUT node.
3152 | | ... | *Arguments:*
3153 | | ... | - nf_chain - NF pipe. Type: integer
3154 | | ... | - nf_nodes - Number of NFs nodes per pipeline. Type: integer
3155 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
3156 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
3158 | | ... | *Example:*
3160 | | ... | \| Initialize L2 Bridge Domain for pipeline with memif pairs \
3161 | | ... | \| 1 \| 1 \|
3163 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
3165 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
3166 | | ... | Set Variable | ${rxq_count_int}
3167 | | ... | ELSE | Set Variable | ${1}
3168 | | ${duts}= | Get Matches | ${nodes} | DUT*
3169 | | :FOR | ${dut} | IN | @{duts}
3170 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1} | ${1}
3171 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if2} | ${2}
3172 | | | ${nf_id_frst}= | Evaluate | (${nf_chain}-${1}) * ${nf_nodes} + ${1}
3173 | | | ${nf_id_last}= | Evaluate | (${nf_chain}-${1}) * ${nf_nodes} + ${nf_nodes}
3174 | | | ${sid_frst}= | Evaluate | ${nf_id_frst} * ${2} - ${1}
3175 | | | ${sid_last}= | Evaluate | ${nf_id_last} * ${2}
3176 | | | Set up single memif interface on DUT node | ${nodes['${dut}']}
3177 | | | ... | memif-${dut}_CNF | mid=${nf_id_frst} | sid=${sid_frst}
3178 | | | ... | memif_if=${dut}-memif-${nf_id_frst}-if1
3179 | | | ... | rxq=${rxq} | txq=${rxq}
3180 | | | Set up single memif interface on DUT node | ${nodes['${dut}']}
3181 | | | ... | memif-${dut}_CNF | mid=${nf_id_last} | sid=${sid_last}
3182 | | | ... | memif_if=${dut}-memif-${nf_id_last}-if2
3183 | | | ... | rxq=${rxq} | txq=${rxq}
3184 | | | Add interface to bridge domain | ${nodes['${dut}']}
3185 | | | ... | ${${dut}-memif-${nf_id_frst}-if1} | ${1}
3186 | | | Add interface to bridge domain | ${nodes['${dut}']}
3187 | | | ... | ${${dut}-memif-${nf_id_last}-if2} | ${2}
3189 | Initialize L2 Bridge Domain for multiple pipelines with memif pairs
3191 | | ... | Create pairs of Memif interfaces for defined number of NF pipelines
3192 | | ... | with defined number of NF nodes on all defined VPP nodes. Add each
3193 | | ... | Memif interface into L2 bridge domains with learning enabled
3194 | | ... | with physical inteface or Memif interface of another NF.
3196 | | ... | *Arguments:*
3197 | | ... | - nf_chains - Number of pipelines of NFs. Type: integer
3198 | | ... | - nf_nodes - Number of NFs nodes per pipeline. Type: integer
3199 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
3200 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
3202 | | ... | *Example:*
3204 | | ... | \| Initialize L2 Bridge Domain for multiple pipelines with memif \
3205 | | ... | pairs \| 1 \| 1 \|
3207 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
3209 | | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
3210 | | | Initialize L2 Bridge Domain for pipeline with memif pairs
3211 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
3212 | | | ... | auto_scale=${auto_scale}
3213 | | Set interfaces in path up
3214 | | Show Memif on all DUTs | ${nodes}
3215 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
3217 | Initialize L2 Bridge Domain with memif pairs and VLAN in circular topology
3219 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
3220 | | ... | Memif interface to separate L2 bridge domain with one physical or
3221 | | ... | virtual interface to create a chain accross DUT node. In case of
3222 | | ... | 3-node topology create VLAN sub-interfaces between DUTs. In case of
3223 | | ... | 2-node topology create VLAN sub-interface on dut1-if2 interface. All
3224 | | ... | interfaces are brought up.
3226 | | ... | *Arguments:*
3227 | | ... | - bd_id1 - Bridge domain ID. Type: integer
3228 | | ... | - bd_id2 - Bridge domain ID. Type: integer
3229 | | ... | - subid - ID of the sub-interface to be created. Type: string
3230 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
3232 | | ... | *Example:*
3234 | | ... | \| Initialize L2 Bridge Domain with memif pairs and VLAN in circular\
3235 | | ... | topology \| 1 \| 2 \| 10 \| pop-1 \|
3237 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
3239 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
3240 | | ... | Variable Should Exist | ${dut2}
3242 | | Set interfaces in path up
3244 | | Run Keyword If | '${dut2_status}' == 'PASS'
3245 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
3246 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
3247 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
3248 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
3249 | | Run Keyword If | '${dut2_status}' == 'PASS'
3250 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
3251 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
3252 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
3253 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
3255 | | ${number}= | Set Variable | ${1}
3256 | | ${sock1}= | Set Variable | memif-DUT1_CNF
3257 | | ${sock2}= | Set Variable | memif-DUT1_CNF
3258 | | ${memif_if1_name}= | Set Variable | DUT1-memif-${number}-if1
3259 | | ${memif_if2_name}= | Set Variable | DUT1-memif-${number}-if2
3260 | | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock2}
3261 | | ... | ${number} | ${memif_if1_name} | ${memif_if2_name} | ${rxq_count_int}
3262 | | ... | ${rxq_count_int}
3263 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
3264 | | Add interface to bridge domain | ${dut1} | ${${memif_if1_name}} | ${bd_id1}
3265 | | Add interface to bridge domain | ${dut1} | ${${memif_if2_name}} | ${bd_id2}
3266 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
3267 | | ${sock1}= | Run Keyword If | '${dut2_status}' == 'PASS'
3268 | | ... | Set Variable | memif-DUT2_CNF
3269 | | ${sock2}= | Run Keyword If | '${dut2_status}' == 'PASS'
3270 | | ... | Set Variable | memif-DUT2_CNF
3271 | | ${memif_if1_name}= | Run Keyword If | '${dut2_status}' == 'PASS'
3272 | | ... | Set Variable | DUT2-memif-${number}-if1
3273 | | ${memif_if2_name}= | Run Keyword If | '${dut2_status}' == 'PASS'
3274 | | ... | Set Variable | DUT2-memif-${number}-if2
3275 | | Run Keyword If | '${dut2_status}' == 'PASS'
3276 | | ... | Set up memif interfaces on DUT node | ${dut2} | ${sock1} | ${sock2}
3277 | | ... | ${number} | ${memif_if1_name} | ${memif_if2_name} | ${rxq_count_int}
3278 | | ... | ${rxq_count_int}
3279 | | Run Keyword If | '${dut2_status}' == 'PASS'
3280 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
3282 | | Run Keyword If | '${dut2_status}' == 'PASS'
3283 | | ... | Add interface to bridge domain | ${dut2} | ${${memif_if1_name}}
3285 | | Run Keyword If | '${dut2_status}' == 'PASS'
3286 | | ... | Add interface to bridge domain | ${dut2} | ${${memif_if2_name}}
3288 | | Run Keyword If | '${dut2_status}' == 'PASS'
3289 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
3291 | | Show Memif on all DUTs | ${nodes}
3292 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
3294 | Initialize IPv4 routing with memif pairs on DUT node
3296 | | ... | Create pairs of Memif interfaces on DUT node. Put each Memif interface
3297 | | ... | to separate IPv4 VRF with one physical or virtual interface
3298 | | ... | to create a chain accross DUT node.
3300 | | ... | *Arguments:*
3301 | | ... | - dut - DUT node. Type: dictionary
3302 | | ... | - count - Number of memif pairs (containers). Type: integer
3305 | | ... | Socket paths for Memif are defined in following format:
3306 | | ... | - /tmp/memif-\${dut}_CNF\${number}-\${sid}
3308 | | ... | *Example:*
3310 | | ... | \| Initialize IPv4 routing with memif pairs on DUT node \
3311 | | ... | \| ${dut} \| ${1} \|
3313 | | [Arguments] | ${dut} | ${count}
3315 | | @{duts}= | Get Matches | ${nodes} | DUT*
3316 | | ${dut_index}= | Get Index From List | ${duts} | ${dut}
3317 | | ${duts_length}= | Get Length | ${duts}
3318 | | ${last_dut_index}= | Evaluate | ${duts_length} - ${1}
3320 | | ${tg_if1_net}= | Set Variable | 10.10.10.0
3321 | | ${tg_if2_net}= | Set Variable | 20.20.20.0
3323 | | ${fib_table_1}= | Set Variable | ${10}
3324 | | Run Keyword If | ${fib_table_1} > ${0}
3325 | | ... | Add Fib Table | ${nodes['${dut}']} | ${fib_table_1}
3326 | | ${ip_base_if1}= | Evaluate | ${dut_index} + ${1}
3327 | | ${ip_net_if1}= | Set Variable
3328 | | ... | ${ip_base_if1}.${ip_base_if1}.${ip_base_if1}
3329 | | Vpp Route Add | ${nodes['${dut}']} | ${tg_if1_net} | 24
3330 | | ... | vrf=${fib_table_1} | gateway=${ip_net_if1}.1
3331 | | ... | interface=${${dut}_if1} | multipath=${TRUE}
3332 | | Assign Interface To Fib Table | ${nodes['${dut}']} | ${${dut}_if1}
3333 | | ... | ${fib_table_1}
3334 | | Configure IP addresses on interfaces | ${nodes['${dut}']} | ${${dut}_if1}
3335 | | ... | ${ip_net_if1}.2 | 30
3336 | | ${prev_node}= | Run Keyword If | ${dut_index} == ${0}
3337 | | ... | Set Variable | TG
3338 | | ... | ELSE | Get From List | ${duts} | ${dut_index-${1}}
3339 | | ${prev_if}= | Run Keyword If | ${dut_index} == ${0}
3340 | | ... | Set Variable | if1
3341 | | ... | ELSE | Set Variable | if2
3342 | | ${prev_if_mac}= | Get Interface MAC | ${nodes['${prev_node}']}
3343 | | ... | ${${prev_node}_${prev_if}}
3344 | | Add ARP on DUT | ${nodes['${dut}']} | ${${dut}_if1} | ${ip_net_if1}.1
3345 | | ... | ${prev_if_mac}
3347 | | ${fib_table_2}= | Evaluate | ${fib_table_1} + ${count}
3348 | | Add Fib Table | ${nodes['${dut}']} | ${fib_table_2}
3349 | | ${ip_base_if2}= | Evaluate | ${ip_base_if1} + ${1}
3350 | | ${ip_net_if2}= | Set Variable
3351 | | ... | ${ip_base_if2}.${ip_base_if2}.${ip_base_if2}
3352 | | Vpp Route Add | ${nodes['${dut}']} | ${tg_if2_net} | 24
3353 | | ... | vrf=${fib_table_2} | gateway=${ip_net_if2}.2
3354 | | ... | interface=${${dut}_if2} | multipath=${TRUE}
3355 | | Assign Interface To Fib Table | ${nodes['${dut}']} | ${${dut}_if2}
3356 | | ... | ${fib_table_2}
3357 | | Configure IP addresses on interfaces | ${nodes['${dut}']} | ${${dut}_if2}
3358 | | ... | ${ip_net_if2}.1 | 30
3359 | | ${next_node}= | Run Keyword If | ${dut_index} == ${last_dut_index}
3360 | | ... | Set Variable | TG
3361 | | ... | ELSE | Get From List | ${duts} | ${dut_index+${1}}
3362 | | ${next_if}= | Run Keyword If | ${dut_index} == ${last_dut_index}
3363 | | ... | Set Variable | if2
3364 | | ... | ELSE | Set Variable | if1
3365 | | ${next_if_mac}= | Get Interface MAC | ${nodes['${next_node}']}
3366 | | ... | ${${next_node}_${next_if}}
3367 | | Add ARP on DUT | ${nodes['${dut}']} | ${${dut}_if2} | ${ip_net_if2}.2
3368 | | ... | ${next_if_mac}
3370 | | ${fib_table_1}= | Evaluate | ${fib_table_1} - ${1}
3371 | | ${ip_base_start}= | Set Variable | ${31}
3372 | | :FOR | ${number} | IN RANGE | 1 | ${count+${1}}
3373 | | | ${sock1}= | Set Variable | memif-${dut}_CNF
3374 | | | ${sock2}= | Set Variable | memif-${dut}_CNF
3375 | | | Set up memif interfaces on DUT node | ${nodes['${dut}']}
3376 | | | ... | ${sock1} | ${sock2} | ${number} | ${dut}-memif-${number}-if1
3377 | | | ... | ${dut}-memif-${number}-if2 | ${rxq_count_int} | ${rxq_count_int}
3378 | | | ${memif1}= | Set Variable | ${${dut}-memif-${number}-if1}
3379 | | | ${memif2}= | Set Variable | ${${dut}-memif-${number}-if2}
3380 | | | ${fib_table_1}= | Evaluate | ${fib_table_1} + ${1}
3381 | | | ${fib_table_2}= | Evaluate | ${fib_table_1} + ${1}
3382 | | | Run Keyword Unless | ${number} == ${count}
3383 | | | ... | Add Fib Table | ${nodes['${dut}']} | ${fib_table_2}
3384 | | | Assign Interface To Fib Table | ${nodes['${dut}']}
3385 | | | ... | ${memif1} | ${fib_table_1}
3386 | | | Assign Interface To Fib Table | ${nodes['${dut}']}
3387 | | | ... | ${memif2} | ${fib_table_2}
3388 | | | ${ip_base_memif1}= | Evaluate
3389 | | | ... | ${ip_base_start} + (${number} - ${1}) * ${2}
3390 | | | ${ip_base_memif2}= | Evaluate | ${ip_base_memif1} + ${1}
3391 | | | ${ip_net_memif1}= | Set Variable
3392 | | | ... | ${ip_base_memif1}.${ip_base_memif1}.${ip_base_memif1}
3393 | | | ${ip_net_memif2}= | Set Variable
3394 | | | ... | ${ip_base_memif2}.${ip_base_memif2}.${ip_base_memif2}
3395 | | | Configure IP addresses on interfaces
3396 | | | ... | ${nodes['${dut}']} | ${memif1} | ${ip_net_memif1}.1 | 30
3397 | | | ... | ${nodes['${dut}']} | ${memif2} | ${ip_net_memif2}.1 | 30
3398 | | | Vpp Route Add | ${nodes['${dut}']} | ${tg_if2_net} | 24
3399 | | | ... | vrf=${fib_table_1} | gateway=${ip_net_memif2}.1
3400 | | | ... | interface=${memif1}
3401 | | | Vpp Route Add | ${nodes['${dut}']} | ${tg_if1_net} | 24
3402 | | | ... | vrf=${fib_table_2} | gateway=${ip_net_memif1}.1
3403 | | | ... | interface=${memif2}
3404 | | | ${memif_if1_key}= | Get interface by sw index | ${nodes['${dut}']}
3405 | | | ... | ${memif1}
3406 | | | ${memif_if1_mac}= | Get interface mac | ${nodes['${dut}']}
3407 | | | ... | ${memif_if1_key}
3408 | | | ${memif_if2_key}= | Get interface by sw index | ${nodes['${dut}']}
3409 | | | ... | ${memif2}
3410 | | | ${memif_if2_mac}= | Get interface mac | ${nodes['${dut}']}
3411 | | | ... | ${memif_if2_key}
3412 | | | Add arp on dut | ${nodes['${dut}']} | ${memif1} | ${ip_net_memif2}.1
3413 | | | ... | ${memif_if2_mac}
3414 | | | Add arp on dut | ${nodes['${dut}']} | ${memif2} | ${ip_net_memif1}.1
3415 | | | ... | ${memif_if1_mac}
3417 | Initialize IPv4 routing with memif pairs
3419 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
3420 | | ... | Memif interface to separate IPv4 VRF with one physical or
3421 | | ... | virtual interface to create a chain accross DUT node.
3423 | | ... | *Arguments:*
3424 | | ... | - count - Number of memif pairs (containers). Type: integer
3426 | | ... | *Example:*
3428 | | ... | \| Initialize IPv4 routing with memif pairs \| ${1} \|
3430 | | [Arguments] | ${count}=${1}
3432 | | ${duts}= | Get Matches | ${nodes} | DUT*
3433 | | :FOR | ${dut} | IN | @{duts}
3434 | | | Initialize IPv4 routing with memif pairs on DUT node | ${dut} | ${count}
3435 | | Set interfaces in path up
3436 | | Show Memif on all DUTs | ${nodes}
3437 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
3439 | Initialize L2 xconnect for single memif
3441 | | ... | Create single Memif interface on all defined VPP nodes. Cross
3442 | | ... | connect Memif interface with one physical interface.
3444 | | ... | *Arguments:*
3445 | | ... | - number - Memif ID. Type: integer
3448 | | ... | Socket paths for Memif are defined in following format:
3449 | | ... | - /tmp/memif-DUT1_CNF\${number}-\${sid}
3451 | | ... | KW uses test variable ${rxq_count_int} set by KW Add worker threads
3452 | | ... | and rxqueues to all DUTs
3454 | | ... | *Example:*
3456 | | ... | \| Initialize L2 xconnect for single memif \| 1 \|
3458 | | [Arguments] | ${number}=${1}
3460 | | ${duts}= | Get Matches | ${nodes} | DUT*
3461 | | :FOR | ${dut} | IN | @{duts}
3462 | | | ${sock}= | Set Variable | memif-${dut}_CNF
3463 | | | ${sid}= | Evaluate | (${number} * ${2}) - ${1}
3464 | | | Set up single memif interface on DUT node | ${nodes['${dut}']} | ${sock}
3465 | | | ... | mid=${number} | sid=${sid} | memif_if=${dut}-memif-${number}-if1
3466 | | | ... | rxq=${rxq_count_int} | txq=${rxq_count_int}
3467 | | | Configure L2XC | ${nodes['${dut}']} | ${${dut}_if1}
3468 | | | ... | ${${dut}-memif-${number}-if1}
3469 | | Set single interfaces in path up
3470 | | Show Memif on all DUTs | ${nodes}
3471 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
3473 | Initialize L2 Bridge Domain for single memif
3475 | | ... | Create single Memif interface on all defined VPP nodes. Put Memif
3476 | | ... | interface to separate L2 bridge domain with one physical interface.
3478 | | ... | *Arguments:*
3479 | | ... | - number - Memif ID. Type: integer
3482 | | ... | Socket paths for Memif are defined in following format:
3483 | | ... | - /tmp/memif-DUT1_CNF\${number}-\${sid}
3485 | | ... | KW uses test variable ${rxq_count_int} set by KW Add worker threads
3486 | | ... | and rxqueues to all DUTs
3488 | | ... | *Example:*
3490 | | ... | \| Initialize L2 Bridge Domain for single memif \| 1 \|
3492 | | [Arguments] | ${number}=${1}
3494 | | ${duts}= | Get Matches | ${nodes} | DUT*
3495 | | :FOR | ${dut} | IN | @{duts}
3496 | | | ${sock}= | Set Variable | memif-${dut}_CNF
3497 | | | ${sid}= | Evaluate | (${number} * ${2}) - ${1}
3498 | | | Set up single memif interface on DUT node | ${nodes['${dut}']} | ${sock}
3499 | | | ... | mid=${number} | sid=${sid} | memif_if=${dut}-memif-${number}-if1
3500 | | | ... | rxq=${rxq_count_int} | txq=${rxq_count_int}
3501 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1}
3502 | | | ... | ${number}
3503 | | | Add interface to bridge domain | ${nodes['${dut}']}
3504 | | | ... | ${${dut}-memif-${number}-if1} | ${number}
3505 | | Set single interfaces in path up
3506 | | Show Memif on all DUTs | ${nodes}
3508 | Configure ACLs on a single interface
3510 | | ... | Configure ACL
3512 | | ... | *Arguments:*
3513 | | ... | - dut - DUT node. Type: string
3514 | | ... | - dut_if - DUT node interface name. Type: string
3515 | | ... | - acl_apply_type - To what path apply the ACL - input or output.
3516 | | ... | - acl_action - Action for the rule - deny, permit, permit+reflect.
3517 | | ... | - subnets - Subnets to apply the specific ACL. Type: list
3519 | | ... | *Example:*
3521 | | ... | \| Configure ACLs on a single interface \| ${nodes['DUT1']}
3522 | | ... | \| ... \| GigabitEthernet0/7/0 \| input \| permit | 0.0.0.0/0
3524 | | [Arguments] | ${dut} | ${dut_if} | ${acl_apply_type} | ${acl_action}
3525 | | ... | @{subnets}
3526 | | Set Test variable | ${acl} | ${EMPTY}
3527 | | :FOR | ${subnet} | IN | @{subnets}
3528 | | | ${acl} = | Run Keyword If | '${acl}' == '${EMPTY}'
3529 | | | ... | Set Variable | ipv4 ${acl_action} src ${subnet}
3531 | | | ... | Catenate | SEPARATOR=, | ${acl}
3532 | | | ... | ipv4 ${acl_action} src ${subnet}
3533 | | Add Replace Acl Multi Entries | ${dut} | rules=${acl}
3534 | | @{acl_list} = | Create List | ${0}
3535 | | Set Acl List For Interface | ${dut} | ${dut_if} | ${acl_apply_type}
3536 | | ... | ${acl_list}