VAT-to-PAPI: VPPUtils
[csit.git] / resources / libraries / robot / performance / performance_configuration.robot
1 # Copyright (c) 2019 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Library | Collections
16 | Library | String
17 | Library | resources.libraries.python.topology.Topology
18 | Library | resources.libraries.python.NodePath
19 | Library | resources.libraries.python.DpdkUtil
20 | Library | resources.libraries.python.InterfaceUtil
21 | Library | resources.libraries.python.VhostUser
22 | Library | resources.libraries.python.TrafficGenerator
23 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
24 | Library | resources.libraries.python.Classify
25 | Library | resources.libraries.python.IPUtil
26 | Library | resources.libraries.python.L2Util
27 | Resource | resources/libraries/robot/shared/default.robot
28 | Resource | resources/libraries/robot/shared/interfaces.robot
29 | Resource | resources/libraries/robot/shared/counters.robot
30 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
31 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
32 | Resource | resources/libraries/robot/l2/l2_patch.robot
33 | Resource | resources/libraries/robot/ip/ip4.robot
34 | Resource | resources/libraries/robot/ip/ip6.robot
35 | Resource | resources/libraries/robot/l2/tagging.robot
36 | Resource | resources/libraries/robot/overlay/srv6.robot
37 | Documentation | Performance suite keywords - configuration.
38
39 *** Keywords ***
40 | Set interfaces in path up
41 | | [Documentation]
42 | | ... | *Set UP state on VPP interfaces in path on all DUT nodes and set
43 | | ... | maximal MTU.*
44 | | ...
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
48 # library
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
55 | | | ... | ELSE
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
63 | | | ... | ELSE
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} | retries=${300}
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}
74 | | | ... | ELSE
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}
82 | | | ... | ELSE
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} | retries=${300}
87
88 | Set single interfaces in path up
89 | | [Documentation]
90 | | ... | *Set UP state on single VPP interfaces in path on all DUT nodes and set
91 | | ... | maximal MTU.*
92 | | ...
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
96 # library
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
103 | | | ... | ELSE
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} | retries=${300}
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}
114 | | | ... | ELSE
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}
119
120 | Initialize AVF interfaces
121 | | [Documentation]
122 | | ... | Initialize AVF interfaces on each DUT. Interfaces are brought up.
123 | | ...
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
137
138 | Initialize IPSec in 3-node circular topology
139 | | [Documentation]
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
145 | | ... | address.
146 | | ...
147 | | Set interfaces in path up
148 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
149 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
150 | | ${dut1_if1_mac}= | Get Interface MAC | ${dut1} | ${dut1_if1}
151 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
152 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
153 | | ${dut2_if2_mac}= | Get Interface MAC | ${dut2} | ${dut2_if2}
154 | | Set Test Variable | ${tg_if1_mac}
155 | | Set Test Variable | ${tg_if2_mac}
156 | | Set Test Variable | ${dut1_if1_mac}
157 | | Set Test Variable | ${dut1_if2_mac}
158 | | Set Test Variable | ${dut2_if1_mac}
159 | | Set Test Variable | ${dut2_if2_mac}
160 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
161 | | ... | ${dut1_if1_ip4} | 24
162 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2}
163 | | ... | ${dut2_if2_ip4} | 24
164 | | Add arp on dut | ${dut1} | ${dut1_if1} | ${tg_if1_ip4} | ${tg_if1_mac}
165 | | Add arp on dut | ${dut2} | ${dut2_if2} | ${tg_if2_ip4} | ${tg_if2_mac}
166 | | Vpp Route Add | ${dut1} | ${laddr_ip4} | 8 | gateway=${tg_if1_ip4}
167 | | ... | interface=${dut1_if1}
168 | | Vpp Route Add | ${dut2} | ${raddr_ip4} | 8 | gateway=${tg_if2_ip4}
169 | | ... | interface=${dut2_if2}
170
171 | Initialize IPv4 forwarding in circular topology
172 | | [Documentation]
173 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node
174 | | ... | circular topology. Get the interface MAC addresses and setup ARP on
175 | | ... | all VPP interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG
176 | | ... | links. In case of 3-node topology setup IPv4 adresses with /30 prefix
177 | | ... | on DUT1-DUT2 link and set routing on both DUT nodes with prefix /24
178 | | ... | and next hop of neighbour DUT interface IPv4 address.
179 | | ...
180 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
181 | | ... | Variable Should Exist | ${dut2}
182 | | ...
183 | | Set interfaces in path up
184 | | ...
185 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
186 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
187 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
188 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
189 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
190 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
191 | | ...
192 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
193 | | Run Keyword If | '${dut2_status}' == 'PASS'
194 | | ... | Add arp on dut | ${dut1} | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
195 | | Run Keyword If | '${dut2_status}' == 'PASS'
196 | | ... | Add arp on dut | ${dut2} | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
197 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
198 | | ... | Set Variable | ${dut2}
199 | | ... | ELSE | Set Variable | ${dut1}
200 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
201 | | ... | Set Variable | ${dut2_if2}
202 | | ... | ELSE | Set Variable | ${dut1_if2}
203 | | Add arp on dut | ${dut} | ${dut_if2} | 20.20.20.2 | ${tg1_if2_mac}
204 | | ...
205 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
206 | | ... | 10.10.10.1 | 24
207 | | Run Keyword If | '${dut2_status}' == 'PASS'
208 | | ... | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
209 | | ... | 1.1.1.1 | 30
210 | | Run Keyword If | '${dut2_status}' == 'PASS'
211 | | ... | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
212 | | ... | 1.1.1.2 | 30
213 | | Configure IP addresses on interfaces | ${dut} | ${dut_if2}
214 | | ... | 20.20.20.1 | 24
215 | | ...
216 | | Run Keyword If | '${dut2_status}' == 'PASS'
217 | | ... | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | gateway=1.1.1.2
218 | | ... | interface=${dut1_if2}
219 | | Run Keyword If | '${dut2_status}' == 'PASS'
220 | | ... | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=1.1.1.1
221 | | ... | interface=${dut2_if1}
222
223 | Initialize IPv4 forwarding with scaling in circular topology
224 | | [Documentation]
225 | | ... | Custom setup of IPv4 topology with scalability of ip routes on all
226 | | ... | DUT nodes in 2-node / 3-node circular topology
227 | | ...
228 | | ... | *Arguments:*
229 | | ... | - count - IP route count. Type: integer
230 | | ...
231 | | ... | *Return:*
232 | | ... | - No value returned
233 | | ...
234 | | ... | *Example:*
235 | | ...
236 | | ... | \| Initialize IPv4 forwarding with scaling in 3-node circular \
237 | | ... | topology \| 100000 \|
238 | | ...
239 | | [Arguments] | ${count}
240 | | ...
241 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
242 | | ... | Variable Should Exist | ${dut2}
243 | | ...
244 | | Set interfaces in path up
245 | | ...
246 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
247 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
248 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
249 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
250 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
251 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
252 | | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac}
253 | | Run Keyword If | '${dut2_status}' == 'PASS'
254 | | ... | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac}
255 | | Run Keyword If | '${dut2_status}' == 'PASS'
256 | | ... | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac}
257 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
258 | | ... | Set Variable | ${dut2}
259 | | ... | ELSE | Set Variable | ${dut1}
260 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
261 | | ... | Set Variable | ${dut2_if2}
262 | | ... | ELSE | Set Variable | ${dut1_if2}
263 | | Add arp on dut | ${dut} | ${dut_if2} | 3.3.3.1 | ${tg1_if2_mac}
264 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30
265 | | Run Keyword If | '${dut2_status}' == 'PASS'
266 | | ... | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1
267 | | ... | 30
268 | | Run Keyword If | '${dut2_status}' == 'PASS'
269 | | ... | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2
270 | | ... | 30
271 | | Configure IP addresses on interfaces | ${dut} | ${dut_if2} | 3.3.3.2 | 30
272 | | Vpp Route Add | ${dut1} | 10.0.0.0 | 32 | gateway=1.1.1.1
273 | | ... | interface=${dut1_if1} | count=${count}
274 | | Run Keyword If | '${dut2_status}' == 'PASS'
275 | | ... | Vpp Route Add | ${dut1} | 20.0.0.0 | 32 | gateway=2.2.2.2
276 | | ... | interface=${dut1_if2} | count=${count}
277 | | Run Keyword If | '${dut2_status}' == 'PASS'
278 | | ... | Vpp Route Add | ${dut2} | 10.0.0.0 | 32 | gateway=2.2.2.1
279 | | ... | interface=${dut2_if1} | count=${count}
280 | | Vpp Route Add | ${dut} | 20.0.0.0 | 32 | gateway=3.3.3.1
281 | | ... | interface=${dut_if2} | count=${count}
282
283 | Initialize IPv4 forwarding with vhost in 2-node circular topology
284 | | [Documentation]
285 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
286 | | ... | VPP node. Set UP state of all VPP interfaces in path. Create
287 | | ... | nf_nodes+1 FIB tables on DUT with multipath routing. Assign each
288 | | ... | Virtual interface to FIB table with Physical interface or Virtual
289 | | ... | interface on both nodes. Setup IPv4 addresses with /30 prefix on
290 | | ... | DUT-TG links. Set routing on DUT nodes in all FIB tables with prefix
291 | | ... | /8 and next hop of neighbour IPv4 address. Setup ARP on all VPP
292 | | ... | interfaces.
293 | | ...
294 | | ... | *Arguments:*
295 | | ... | - nf_nodes - Number of guest VMs. Type: integer
296 | | ...
297 | | ... | *Note:*
298 | | ... | Socket paths for VM are defined in following format:
299 | | ... | - /var/run/vpp/sock-${VM_ID}-1
300 | | ... | - /var/run/vpp/sock-${VM_ID}-2
301 | | ...
302 | | ... | *Example:*
303 | | ...
304 | | ... | \| IPv4 forwarding with Vhost-User initialized in a 2-node circular\
305 | | ... | topology \| 1 \|
306 | | ...
307 | | [Arguments] | ${nf_nodes}=${1}
308 | | ...
309 | | Set interfaces in path up
310 | | ${fib_table_1}= | Set Variable | ${101}
311 | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${nf_nodes}
312 | | Add Fib Table | ${dut1} | ${fib_table_1}
313 | | Add Fib Table | ${dut1} | ${fib_table_2}
314 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if1} | ${fib_table_1}
315 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if2} | ${fib_table_2}
316 | | Configure IP addresses on interfaces
317 | | ... | ${dut1} | ${dut1_if1} | 100.0.0.1 | 30
318 | | Configure IP addresses on interfaces
319 | | ... | ${dut1} | ${dut1_if2} | 200.0.0.1 | 30
320 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
321 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
322 | | Add arp on dut | ${dut1} | ${dut1_if1} | 100.0.0.2 | ${tg1_if1_mac}
323 | | Add arp on dut | ${dut1} | ${dut1_if2} | 200.0.0.2 | ${tg1_if2_mac}
324 | | Vpp Route Add | ${dut1} | 10.0.0.0 | 8 | gateway=100.0.0.2
325 | | ... | interface=${dut1_if1} | vrf=${fib_table_1}
326 | | Vpp Route Add | ${dut1} | 20.0.0.0 | 8 | gateway=200.0.0.2
327 | | ... | interface=${dut1_if2} | vrf=${fib_table_2}
328 | | :FOR | ${number} | IN RANGE | 1 | ${nf_nodes}+1
329 | | | ${fib_table_1}= | Evaluate | ${100}+${number}
330 | | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${1}
331 | | | Configure vhost interfaces for L2BD forwarding | ${dut1}
332 | | | ... | /var/run/vpp/sock-${number}-1 | /var/run/vpp/sock-${number}-2
333 | | | ... | dut1-vhost-${number}-if1 | dut1-vhost-${number}-if2
334 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if1} | up
335 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if2} | up
336 | | | Add Fib Table | ${dut1} | ${fib_table_1}
337 | | | Add Fib Table | ${dut1} | ${fib_table_2}
338 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if1}
339 | | | ... | ${fib_table_1}
340 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if2}
341 | | | ... | ${fib_table_2}
342 | | | Configure IP addresses on interfaces
343 | | | ... | ${dut1} | ${dut1-vhost-${number}-if1} | 1.1.1.2 | 30
344 | | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | 1.1.2.2 | 30
345 | | | Vpp Route Add | ${dut1} | 20.0.0.0 | 8 | gateway=1.1.1.1
346 | | | ... | interface=${dut1-vhost-${number}-if1} | vrf=${fib_table_1}
347 | | | Vpp Route Add | ${dut1} | 10.0.0.0 | 8 | gateway=1.1.2.1
348 | | | ... | interface=${dut1-vhost-${number}-if2} | vrf=${fib_table_2}
349
350 | Initialize IPv4 forwarding with vhost in 3-node circular topology
351 | | [Documentation]
352 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on all
353 | | ... | VPP nodes. Set UP state of all VPP interfaces in path. Create
354 | | ... | nf_nodes+1 FIB tables on each DUT with multipath routing. Assign
355 | | ... | each Virtual interface to FIB table with Physical interface or Virtual
356 | | ... | interface on both nodes. Setup IPv4 addresses with /30 prefix on
357 | | ... | DUT-TG links and /30 prefix on DUT1-DUT2 link. Set routing on all DUT
358 | | ... | nodes in all FIB tables with prefix /8 and next hop of neighbour IPv4
359 | | ... | address. Setup ARP on all VPP interfaces.
360 | | ...
361 | | ... | *Arguments:*
362 | | ... | - nf_nodes - Number of guest VMs. Type: integer
363 | | ...
364 | | ... | *Note:*
365 | | ... | Socket paths for VM are defined in following format:
366 | | ... | - /var/run/vpp/sock-\${VM_ID}-1
367 | | ... | - /var/run/vpp/sock-\${VM_ID}-2
368 | | ...
369 | | ... | *Example:*
370 | | ...
371 | | ... | \| IPv4 forwarding with Vhost-User initialized in a 3-node circular\
372 | | ... | topology \| 1 \|
373 | | ...
374 | | [Arguments] | ${nf_nodes}=${1}
375 | | ...
376 | | Set interfaces in path up
377 | | ${fib_table_1}= | Set Variable | ${101}
378 | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${nf_nodes}
379 | | Add Fib Table | ${dut1} | ${fib_table_1}
380 | | Add Fib Table | ${dut1} | ${fib_table_2}
381 | | Add Fib Table | ${dut2} | ${fib_table_1}
382 | | Add Fib Table | ${dut2} | ${fib_table_2}
383 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if1} | ${fib_table_1}
384 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if2} | ${fib_table_2}
385 | | Assign Interface To Fib Table | ${dut2} | ${dut2_if1} | ${fib_table_1}
386 | | Assign Interface To Fib Table | ${dut2} | ${dut2_if2} | ${fib_table_2}
387 | | Configure IP addresses on interfaces
388 | | ... | ${dut1} | ${dut1_if1} | 100.0.0.1 | 30
389 | | Configure IP addresses on interfaces
390 | | ... | ${dut1} | ${dut1_if2} | 150.0.0.1 | 30
391 | | Configure IP addresses on interfaces
392 | | ... | ${dut2} | ${dut2_if1} | 150.0.0.2 | 30
393 | | Configure IP addresses on interfaces
394 | | ... | ${dut2} | ${dut2_if2} | 200.0.0.1 | 30
395 | | Add arp on dut | ${dut1} | ${dut1_if1} | 100.0.0.2 | ${tg_if1_mac}
396 | | Add arp on dut | ${dut2} | ${dut2_if2} | 200.0.0.2 | ${tg_if2_mac}
397 | | Vpp Route Add | ${dut1} | 10.0.0.0 | 8 | gateway=100.0.0.2
398 | | ... | interface=${dut1_if1} | vrf=${fib_table_1}
399 | | Vpp Route Add | ${dut1} | 20.0.0.0 | 8 | gateway=150.0.0.2
400 | | ... | interface=${dut1_if2} | vrf=${fib_table_2}
401 | | Vpp Route Add | ${dut2} | 10.0.0.0 | 8 | gateway=150.0.0.1
402 | | ... | interface=${dut2_if1} | vrf=${fib_table_1}
403 | | Vpp Route Add | ${dut2} | 20.0.0.0 | 8 | gateway=200.0.0.2
404 | | ... | interface=${dut2_if2} | vrf=${fib_table_2}
405 | | :FOR | ${number} | IN RANGE | 1 | ${nf_nodes}+1
406 | | | ${fib_table_1}= | Evaluate | ${100}+${number}
407 | | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${1}
408 | | | Configure vhost interfaces for L2BD forwarding | ${dut1}
409 | | | ... | /var/run/vpp/sock-${number}-1 | /var/run/vpp/sock-${number}-2
410 | | | ... | dut1-vhost-${number}-if1 | dut1-vhost-${number}-if2
411 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if1} | up
412 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if2} | up
413 | | | Configure vhost interfaces for L2BD forwarding | ${dut2}
414 | | | ... | /var/run/vpp/sock-${number}-1 | /var/run/vpp/sock-${number}-2
415 | | | ... | dut2-vhost-${number}-if1 | dut2-vhost-${number}-if2
416 | | | Set Interface State | ${dut2} | ${dut2-vhost-${number}-if1} | up
417 | | | Set Interface State | ${dut2} | ${dut2-vhost-${number}-if2} | up
418 | | | Add Fib Table | ${dut1} | ${fib_table_1}
419 | | | Add Fib Table | ${dut1} | ${fib_table_2}
420 | | | Add Fib Table | ${dut2} | ${fib_table_1}
421 | | | Add Fib Table | ${dut2} | ${fib_table_2}
422 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if1}
423 | | | ... | ${fib_table_1}
424 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if2}
425 | | | ... | ${fib_table_2}
426 | | | Assign Interface To Fib Table | ${dut2} | ${dut2-vhost-${number}-if1}
427 | | | ... | ${fib_table_1}
428 | | | Assign Interface To Fib Table | ${dut2} | ${dut2-vhost-${number}-if2}
429 | | | ... | ${fib_table_2}
430 | | | Configure IP addresses on interfaces
431 | | | ... | ${dut1} | ${dut1-vhost-${number}-if1} | 1.1.1.2 | 30
432 | | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | 1.1.2.2 | 30
433 | | | ... | ${dut2} | ${dut2-vhost-${number}-if1} | 1.1.1.2 | 30
434 | | | ... | ${dut2} | ${dut2-vhost-${number}-if2} | 1.1.2.2 | 30
435 | | | Vpp Route Add | ${dut1} | 20.0.0.0 | 8 | gateway=1.1.1.1
436 | | | ... | interface=${dut1-vhost-${number}-if1} | vrf=${fib_table_1}
437 | | | Vpp Route Add | ${dut1} | 10.0.0.0 | 8 | gateway=1.1.2.1
438 | | | ... | interface=${dut1-vhost-${number}-if2} | vrf=${fib_table_2}
439 | | | Vpp Route Add | ${dut2} | 20.0.0.0 | 8 | gateway=1.1.1.1
440 | | | ... | interface=${dut2-vhost-${number}-if1} | vrf=${fib_table_1}
441 | | | Vpp Route Add | ${dut2} | 10.0.0.0 | 8 | gateway=1.1.2.1
442 | | | ... | interface=${dut2-vhost-${number}-if2} | vrf=${fib_table_2}
443
444 | Initialize IPv4 forwarding with VLAN dot1q sub-interfaces in circular topology
445 | | [Documentation]
446 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node
447 | | ... | circular topology. In case of 3-node topology create VLAN
448 | | ... | sub-interfaces between DUTs. In case of 2-node topology create VLAN
449 | | ... | sub-interface on dut1-if2 interface. Get the interface MAC addresses
450 | | ... | and setup ARPs. Setup IPv4 addresses with /30 prefix on DUT-TG links
451 | | ... | and set routing with prefix /30. In case of 3-node set IPv4 adresses
452 | | ... | with /30 prefix on VLAN and set routing on both DUT nodes with prefix
453 | | ... | /30. Set next hop of neighbour DUT interface IPv4 address. All
454 | | ... | interfaces are brought up.
455 | | ...
456 | | ... | *Arguments:*
457 | | ... | - tg_if1_net - TG interface 1 IP subnet used by traffic generator.
458 | | ... | Type: integer
459 | | ... | - tg_if2_net - TG interface 2 IP subnet used by traffic generator.
460 | | ... | Type: integer
461 | | ... | - subid - ID of the sub-interface to be created. Type: string
462 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
463 | | ...
464 | | ... | _NOTE:_ This KW uses following test case variables:
465 | | ... | - dut1 - DUT1 node.
466 | | ... | - dut2 - DUT2 node.
467 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
468 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
469 | | ...
470 | | ... | *Example:*
471 | | ...
472 | | ... | \| Initialize IPv4 forwarding with VLAN dot1q sub-interfaces\
473 | | ... | in circular topology \| 10.10.10.0 \| 20.20.20.0 \| 10 \| pop-1 \|
474 | | ...
475 | | [Arguments] | ${tg_if1_net} | ${tg_if2_net} | ${subid} | ${tag_rewrite}
476 | | ...
477 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
478 | | ... | Variable Should Exist | ${dut2}
479 | | ...
480 | | Set interfaces in path up
481 | | ...
482 | | Run Keyword If | '${dut2_status}' == 'PASS'
483 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
484 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
485 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
486 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
487 | | Run Keyword If | '${dut2_status}' == 'PASS'
488 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
489 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
490 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
491 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
492 | | ...
493 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
494 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
495 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
496 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
497 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
498 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
499 | | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac}
500 | | Run Keyword If | '${dut2_status}' == 'PASS'
501 | | ... | Add arp on dut | ${dut1} | ${subif_index_1} | 2.2.2.2
502 | | ... | ${dut2_if1_mac}
503 | | Run Keyword If | '${dut2_status}' == 'PASS'
504 | | ... | Add arp on dut | ${dut2} | ${subif_index_2} | 2.2.2.1
505 | | ... | ${dut1_if2_mac}
506 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
507 | | ... | Set Variable | ${dut2}
508 | | ... | ELSE | Set Variable | ${dut1}
509 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
510 | | ... | Set Variable | ${dut2_if2}
511 | | ... | ELSE | Set Variable | ${subif_index_1}
512 | | Add arp on dut | ${dut} | ${dut_if2} | 3.3.3.1 | ${tg1_if2_mac}
513 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30
514 | | Run Keyword If | '${dut2_status}' == 'PASS'
515 | | ... | Configure IP addresses on interfaces | ${dut1} | ${subif_index_1}
516 | | ... | 2.2.2.1 | 30
517 | | Run Keyword If | '${dut2_status}' == 'PASS'
518 | | ... | Configure IP addresses on interfaces | ${dut2} | ${subif_index_2}
519 | | ... | 2.2.2.2 | 30
520 | | Configure IP addresses on interfaces | ${dut} | ${dut_if2} | 3.3.3.2 | 30
521 | | Vpp Route Add | ${dut1} | ${tg_if1_net} | 30 | gateway=1.1.1.1
522 | | ... | interface=${dut1_if1}
523 | | Run Keyword If | '${dut2_status}' == 'PASS'
524 | | ... | Vpp Route Add | ${dut1} | ${tg_if2_net} | 30 | gateway=2.2.2.2
525 | | ... | interface=${subif_index_1}
526 | | Run Keyword If | '${dut2_status}' == 'PASS'
527 | | ... | Vpp Route Add | ${dut2} | ${tg_if1_net} | 30 | gateway=2.2.2.1
528 | | ... | interface=${subif_index_2}
529 | | Vpp Route Add | ${dut} | ${tg_if2_net} | 30 | gateway=3.3.3.1
530 | | ... | interface=${dut_if2}
531
532 | Initialize IPv4 policer 2r3c-${t} in circular topology
533 | | [Documentation]
534 | | ... | Setup of 2r3c color-aware or color-blind policer with dst ip match
535 | | ... | on all DUT nodes in 2-node / 3-node circular topology. Policer is
536 | | ... | applied on links TG - DUTx.
537 | | ...
538 | | ${dscp}= | DSCP AF22
539 | | Policer Set Name | policer1
540 | | Policer Set CIR | ${cir}
541 | | Policer Set EIR | ${eir}
542 | | Policer Set CB | ${cb}
543 | | Policer Set EB | ${eb}
544 | | Policer Set Rate Type pps
545 | | Policer Set Round Type Closest
546 | | Policer Set Type 2R3C 2698
547 | | Policer Set Conform Action Transmit
548 | | Policer Set Exceed Action Mark and Transmit | ${dscp}
549 | | Policer Set Violate Action Transmit
550 | | Policer Enable Color Aware
551 | | Run Keyword If | ${t} == 'ca' | Policer Enable Color Aware
552 | | Policer Classify Set Precolor Exceed
553 | | Policer Set Node | ${dut1}
554 | | Policer Classify Set Interface | ${dut1_if1}
555 | | Policer Classify Set Match IP | 20.20.20.2 | ${False}
556 | | Policer Set Configuration
557 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
558 | | ... | Variable Should Exist | ${dut2}
559 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
560 | | ... | Set Variable | ${dut2}
561 | | ... | ELSE | Set Variable | ${dut1}
562 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
563 | | ... | Set Variable | ${dut2_if2}
564 | | ... | ELSE | Set Variable | ${dut1_if2}
565 | | Run Keyword Unless | '${dut2_status}' == 'PASS'
566 | | ... | Policer Set Name | policer2
567 | | Policer Set Node | ${dut}
568 | | Policer Classify Set Interface | ${dut_if2}
569 | | Policer Classify Set Match IP | 10.10.10.2 | ${False}
570 | | Policer Set Configuration
571
572 | Initialize IPv6 forwarding in 2-node circular topology
573 | | [Documentation]
574 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node circular
575 | | ... | topology. Get the interface MAC addresses and setup neighbour on all
576 | | ... | VPP interfaces. Setup IPv6 addresses with /128 prefixes on all
577 | | ... | interfaces.
578 | | ...
579 | | Set interfaces in path up
580 | | ${prefix}= | Set Variable | 64
581 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
582 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
583 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:1::1 | ${prefix}
584 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:2::1 | ${prefix}
585 | | Suppress ICMPv6 router advertisement message | ${nodes}
586 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
587 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:2::2 | ${tg1_if2_mac}
588
589 | Initialize IPv6 forwarding in 3-node circular topology
590 | | [Documentation]
591 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
592 | | ... | topology. Get the interface MAC addresses and setup neighbour on all
593 | | ... | VPP interfaces. Setup IPv6 addresses with /128 prefixes on all
594 | | ... | interfaces. Set routing on both DUT nodes with prefix /64 and
595 | | ... | next hop of neighbour DUT interface IPv6 address.
596 | | ...
597 | | Set interfaces in path up
598 | | ${prefix}= | Set Variable | 64
599 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
600 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
601 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
602 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
603 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:1::1 | ${prefix}
604 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:3::1 | ${prefix}
605 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:3::2 | ${prefix}
606 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | 2001:2::1 | ${prefix}
607 | | Suppress ICMPv6 router advertisement message | ${nodes}
608 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
609 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
610 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:3::2 | ${dut2_if1_mac}
611 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:3::1 | ${dut1_if2_mac}
612 | | Vpp Route Add | ${dut1} | 2001:2::0 | ${prefix} | gateway=2001:3::2
613 | | ... | interface=${dut1_if2}
614 | | Vpp Route Add | ${dut2} | 2001:1::0 | ${prefix} | gateway=2001:3::1
615 | | ... | interface=${dut2_if1}
616
617 | Initialize IPv6 forwarding with scaling in circular topology
618 | | [Documentation]
619 | | ... | Custom setup of IPv6 topology with scalability of ip routes on all
620 | | ... | DUT nodes in 2-node / 3-node circular topology
621 | | ...
622 | | ... | *Arguments:*
623 | | ... | - count - IP route count. Type: integer
624 | | ...
625 | | ... | *Return:*
626 | | ... | - No value returned
627 | | ...
628 | | ... | *Example:*
629 | | ...
630 | | ... | \| Initialize IPv6 forwarding with scaling in circular \
631 | | ... | topology \| 100000 \|
632 | | ...
633 | | [Arguments] | ${count}
634 | | ...
635 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
636 | | ... | Variable Should Exist | ${dut2}
637 | | ...
638 | | Set interfaces in path up
639 | | ...
640 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
641 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
642 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
643 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
644 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
645 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
646 | | ${prefix}= | Set Variable | 64
647 | | ${host_prefix}= | Set Variable | 128
648 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:3::1 | ${prefix}
649 | | Run Keyword If | '${dut2_status}' == 'PASS'
650 | | ... | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:4::1 | ${prefix}
651 | | Run Keyword If | '${dut2_status}' == 'PASS'
652 | | ... | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:4::2 | ${prefix}
653 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
654 | | ... | Set Variable | ${dut2}
655 | | ... | ELSE | Set Variable | ${dut1}
656 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
657 | | ... | Set Variable | ${dut2_if2}
658 | | ... | ELSE | Set Variable | ${dut1_if2}
659 | | VPP Set If IPv6 Addr | ${dut} | ${dut_if2} | 2001:5::1 | ${prefix}
660 | | Suppress ICMPv6 router advertisement message | ${nodes}
661 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:3::2 | ${tg1_if1_mac}
662 | | Run Keyword If | '${dut2_status}' == 'PASS'
663 | | ... | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:4::2 | ${dut2_if1_mac}
664 | | Run Keyword If | '${dut2_status}' == 'PASS'
665 | | ... | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:4::1 | ${dut1_if2_mac}
666 | | Add Ip Neighbor | ${dut} | ${dut_if2} | 2001:5::2 | ${tg1_if2_mac}
667 | | Vpp Route Add | ${dut1} | 2001:1::0 | ${host_prefix} | gateway=2001:3::2
668 | | ... | interface=${dut1_if1} | count=${count}
669 | | Run Keyword If | '${dut2_status}' == 'PASS'
670 | | ... | Vpp Route Add | ${dut1} | 2001:2::0 | ${host_prefix}
671 | | ... | gateway=2001:4::2 | interface=${dut1_if2} | count=${count}
672 | | Run Keyword If | '${dut2_status}' == 'PASS'
673 | | ... | Vpp Route Add | ${dut2} | 2001:1::0 | ${host_prefix}
674 | | ... | gateway=2001:4::1 | interface=${dut2_if1} | count=${count}
675 | | Vpp Route Add | ${dut} | 2001:2::0 | ${host_prefix} | gateway=2001:5::2
676 | | ... | interface=${dut_if2} | count=${count}
677
678 | Initialize IPv6 forwarding with VLAN dot1q sub-interfaces in circular topology
679 | | [Documentation]
680 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node
681 | | ... | circular topology. In case of 3-node topology create VLAN
682 | | ... | sub-interfaces between DUTs. In case of 2-node topology create VLAN
683 | | ... | sub-interface on dut1-if2 interface. Get the interface MAC addresses
684 | | ... | and setup ARPs. Setup IPv6 addresses with /64 prefix on DUT-TG links
685 | | ... | and set routing with prefix /64. In case of 3-node set IPv6 adresses
686 | | ... | with /64 prefix on VLAN and set routing on both DUT nodes with prefix
687 | | ... | /64. Set next hop of neighbour DUT interface IPv6 address. All
688 | | ... | interfaces are brought up.
689 | | ...
690 | | ... | *Arguments:*
691 | | ... | - tg_if1_net - TG interface 1 IPv6 subnet used by traffic generator.
692 | | ... | Type: integer
693 | | ... | - tg_if2_net - TG interface 2 IPv6 subnet used by traffic generator.
694 | | ... | Type: integer
695 | | ... | - subid - ID of the sub-interface to be created. Type: string
696 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
697 | | ...
698 | | ... | _NOTE:_ This KW uses following test case variables:
699 | | ... | - dut1 - DUT1 node.
700 | | ... | - dut2 - DUT2 node.
701 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
702 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
703 | | ...
704 | | ... | *Example:*
705 | | ...
706 | | ... | \| Initialize IPv6 forwarding with VLAN dot1q sub-interfaces\
707 | | ... | in circular topology \| 2001:1::0 \| 2001:2::0 \| 10 \| pop-1 \|
708 | | ...
709 | | [Arguments] | ${tg_if1_net} | ${tg_if2_net} | ${subid} | ${tag_rewrite}
710 | | ...
711 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
712 | | ... | Variable Should Exist | ${dut2}
713 | | ...
714 | | Set interfaces in path up
715 | | ...
716 | | Run Keyword If | '${dut2_status}' == 'PASS'
717 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
718 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
719 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
720 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
721 | | Run Keyword If | '${dut2_status}' == 'PASS'
722 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
723 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
724 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
725 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
726 | | ...
727 | | ${prefix}= | Set Variable | 64
728 | | ${host_prefix}= | Set Variable | 64
729 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
730 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
731 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
732 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
733 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
734 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
735 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2002:1::1 | ${tg1_if1_mac}
736 | | Run Keyword If | '${dut2_status}' == 'PASS'
737 | | ... | Add Ip Neighbor | ${dut1} | ${subif_index_1} | 2002:2::2
738 | | ... | ${dut2_if1_mac}
739 | | Run Keyword If | '${dut2_status}' == 'PASS'
740 | | ... | Add Ip Neighbor | ${dut2} | ${subif_index_2} | 2002:2::1
741 | | ... | ${dut1_if2_mac}
742 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
743 | | ... | Set Variable | ${dut2}
744 | | ... | ELSE | Set Variable | ${dut1}
745 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
746 | | ... | Set Variable | ${dut2_if2}
747 | | ... | ELSE | Set Variable | ${subif_index_1}
748 | | Add Ip Neighbor | ${dut} | ${dut_if2} | 2002:3::1 | ${tg1_if2_mac}
749 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2002:1::2 | ${prefix}
750 | | Run Keyword If | '${dut2_status}' == 'PASS'
751 | | ... | VPP Set If IPv6 Addr | ${dut1} | ${subif_index_1} | 2002:2::1
752 | | ... | ${prefix}
753 | | Run Keyword If | '${dut2_status}' == 'PASS'
754 | | ... | VPP Set If IPv6 Addr | ${dut2} | ${subif_index_2} | 2002:2::2
755 | | ... | ${prefix}
756 | | VPP Set If IPv6 Addr | ${dut} | ${dut_if2} | 2002:3::2 | ${prefix}
757 | | Suppress ICMPv6 router advertisement message | ${nodes}
758 | | Vpp Route Add | ${dut1} | ${tg_if1_net} | ${host_prefix}
759 | | ... | gateway=2002:1::1 | interface=${dut1_if1}
760 | | Run Keyword If | '${dut2_status}' == 'PASS'
761 | | ... | Vpp Route Add | ${dut1} | ${tg_if2_net} | ${host_prefix}
762 | | ... | gateway=2002:2::2 | interface=${subif_index_1}
763 | | Run Keyword If | '${dut2_status}' == 'PASS'
764 | | ... | Vpp Route Add | ${dut2} | ${tg_if1_net} | ${host_prefix}
765 | | ... | gateway=2002:2::1 | interface=${subif_index_2}
766 | | Vpp Route Add | ${dut} | ${tg_if2_net} | ${host_prefix}
767 | | ... | gateway=2002:3::1 | interface=${dut_if2}
768
769 | Initialize IPv6 iAcl whitelist in 3-node circular topology
770 | | [Documentation]
771 | | ... | Creates classify L3 table on DUTs. IPv6 iAcl security whitelist
772 | | ... | ingress /64 filter entries applied on links TG - DUT1 and DUT2 - TG.
773 | | ...
774 | | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3
775 | | ... | ${dut1} | ip6 | dst
776 | | And Vpp Configures Classify Session L3
777 | | ... | ${dut1} | permit | ${table_idx} | ${skip_n} | ${match_n}
778 | | ... | ip6 | dst | 2001:2::2
779 | | And Vpp Enable Input Acl Interface
780 | | ... | ${dut1} | ${dut1_if1} | ip6 | ${table_idx}
781 | | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3
782 | | ... | ${dut2} | ip6 | dst
783 | | And Vpp Configures Classify Session L3
784 | | ... | ${dut2} | permit | ${table_idx} | ${skip_n} | ${match_n}
785 | | ... | ip6 | dst | 2001:1::2
786 | | And Vpp Enable Input Acl Interface
787 | | ... | ${dut2} | ${dut2_if2} | ip6 | ${table_idx}
788
789 | Initialize IPv6 forwarding over SRv6 with encapsulation with '${n}' x SID '${prepos}' decapsulation in 3-node circular topology
790 | | [Documentation]
791 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
792 | | ... | topology. Get the interface MAC addresses and setup neighbours on all
793 | | ... | VPP interfaces. Setup IPv6 addresses on all interfaces. Set segment
794 | | ... | routing for IPv6 for required number of SIDs and configure IPv6 routes
795 | | ... | on both DUT nodes.
796 | | ...
797 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
798 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
799 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
800 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
801 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_if1_ip6} | ${prefix}
802 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_if2_ip6} | ${prefix}
803 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_if1_ip6} | ${prefix}
804 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_if2_ip6} | ${prefix}
805 | | Suppress ICMPv6 router advertisement message | ${nodes}
806 | | :FOR | ${number} | IN RANGE | 2 | ${dst_addr_nr}+2
807 | | | ${hexa_nr}= | Convert To Hex | ${number}
808 | | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | ${tg_if1_ip6_subnet}${hexa_nr}
809 | | | ... | ${tg1_if1_mac}
810 | | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | ${tg_if2_ip6_subnet}${hexa_nr}
811 | | | ... | ${tg1_if2_mac}
812 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_if1_ip6} | ${dut2_if1_mac}
813 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_if2_ip6} | ${dut1_if2_mac}
814 | | ${sid1}= | Set Variable If
815 | | ... | "${n}" == "1" | ${dut2_sid1}
816 | | ... | "${n}" == "2" | ${dut2_sid1_1}
817 | | ${sid2}= | Set Variable If
818 | | ... | "${n}" == "1" | ${dut1_sid2}
819 | | ... | "${n}" == "2" | ${dut1_sid2_1}
820 | | Vpp Route Add | ${dut1} | ${sid1} | ${sid_prefix} | gateway=${dut2_if1_ip6}
821 | | ... | interface=${dut1_if2}
822 | | Vpp Route Add | ${dut2} | ${sid2} | ${sid_prefix} | gateway=${dut1_if2_ip6}
823 | | ... | interface=${dut2_if1}
824 # Configure SRv6 for direction0
825 | | Set SR Encaps Source Address on DUT | ${dut1} | ${dut1_sid1}
826 | | @{sid_list_dir0}= | Run Keyword If | "${n}" == "1"
827 | | ... | Create List | ${dut2_sid1}
828 | | ... | ELSE IF | "${n}" == "2"
829 | | ... | Create List | ${dut2_sid1_1} | ${dut2_sid1_2}
830 | | Configure SR Policy on DUT | ${dut1} | ${dut1_bsid} | encap
831 | | ... | @{sid_list_dir0}
832 | | Configure SR Steer on DUT | ${dut1} | L3 | ${dut1_bsid}
833 | | ... | ip_addr=${tg_if2_ip6_subnet} | prefix=${sid_prefix}
834 | | Run Keyword If | "${n}" == "1"
835 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.dx6
836 | | ... | interface=${dut2_if2} | next_hop=${tg_if2_ip6_subnet}2
837 | | Run Keyword If | "${n}" == "2"
838 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1_1} | end
839 | | Run Keyword If | "${n}" == "2" and "${prepos}" != "without"
840 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1_2} | end.dx6
841 | | ... | interface=${dut2_if2} | next_hop=${tg_if2_ip6_subnet}2
842 | | Run Keyword If | "${n}" == "2" and "${prepos}" == "without"
843 | | ... | Vpp Route Add | ${dut2} | ${dut2_sid1_2} | ${sid_prefix}
844 | | ... | gateway=${tg_if2_ip6_subnet}2 | interface=${dut2_if2}
845 # Configure SRv6 for direction1
846 | | Set SR Encaps Source Address on DUT | ${dut2} | ${dut2_sid2}
847 | | @{sid_list_dir1}= | Run Keyword If | "${n}" == "1"
848 | | ... | Create List | ${dut1_sid2}
849 | | ... | ELSE IF | "${n}" == "2"
850 | | ... | Create List | ${dut1_sid2_1} | ${dut1_sid2_2}
851 | | Configure SR Policy on DUT | ${dut2} | ${dut2_bsid} | encap
852 | | ... | @{sid_list_dir1}
853 | | Configure SR Steer on DUT | ${dut2} | L3 | ${dut2_bsid}
854 | | ... | ip_addr=${tg_if1_ip6_subnet} | prefix=${sid_prefix}
855 | | Run Keyword If | "${n}" == "1"
856 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.dx6
857 | | ... | interface=${dut1_if1} | next_hop=${tg_if1_ip6_subnet}2
858 | | Run Keyword If | "${n}" == "2"
859 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2_1} | end
860 | | Run Keyword If | "${n}" == "2" and "${prepos}" != "without"
861 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2_2} | end.dx6
862 | | ... | interface=${dut1_if1} | next_hop=${tg_if1_ip6_subnet}2
863 | | Run Keyword If | "${n}" == "2" and "${prepos}" == "without"
864 | | ... | Vpp Route Add | ${dut1} | ${dut1_sid2_2} | ${sid_prefix}
865 | | ... | gateway=${tg_if1_ip6_subnet}2 | interface=${dut1_if1}
866 | | Set interfaces in path up
867
868 | Initialize IPv6 forwarding over SRv6 with endpoint to SR-unaware Service Function via '${behavior}' behaviour in 3-node circular topology
869 | | [Documentation]
870 | | ... | Create pair of Memif interfaces on all defined VPP nodes. Set UP
871 | | ... | state on VPP interfaces in path on nodes in 3-node circular topology.
872 | | ... | Get the interface MAC addresses and setup neighbours on all VPP
873 | | ... | interfaces. Setup IPv6 addresses on all interfaces. Set segment
874 | | ... | routing for IPv6 with defined behaviour function and configure IPv6
875 | | ... | routes on both DUT nodes.
876 | | ...
877 | | ... | *Note:*
878 | | ... | KW uses test variable rxq_count_int set by KW Add worker threads
879 | | ... | and rxqueues to all DUTs
880 | | ...
881 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
882 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
883 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
884 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
885 | | ${sock1}= | Set Variable | memif-DUT1_CNF
886 | | ${sock2}= | Set Variable | memif-DUT2_CNF
887 | | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock1}
888 | | ... | ${1} | dut1-memif-1-if1 | dut1-memif-1-if2 | ${rxq_count_int}
889 | | ... | ${rxq_count_int}
890 | | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if1}
891 | | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if2}
892 | | Set up memif interfaces on DUT node | ${dut2} | ${sock2} | ${sock2}
893 | | ... | ${1} | dut2-memif-1-if1 | dut2-memif-1-if2 | ${rxq_count_int}
894 | | ... | ${rxq_count_int}
895 | | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if1}
896 | | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if2}
897 | | ${duts}= | Get Matches | ${nodes} | DUT*
898 | | :FOR | ${dut} | IN | @{duts}
899 | | | Show Memif | ${nodes['${dut}']}
900 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_if1_ip6} | ${prefix}
901 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_if2_ip6} | ${prefix}
902 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1-memif-1-if1}
903 | | ... | ${dut1-memif-1-if1_ip6} | ${prefix}
904 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1-memif-1-if2}
905 | | ... | ${dut1-memif-1-if2_ip6} | ${prefix}
906 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_if1_ip6} | ${prefix}
907 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_if2_ip6} | ${prefix}
908 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2-memif-1-if1}
909 | | ... | ${dut2-memif-1-if1_ip6} | ${prefix}
910 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2-memif-1-if2}
911 | | ... | ${dut2-memif-1-if2_ip6} | ${prefix}
912 | | Suppress ICMPv6 router advertisement message | ${nodes}
913 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_if1_ip6} | ${dut2_if1_mac}
914 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_if2_ip6} | ${dut1_if2_mac}
915 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | ${tg_if1_ip6_subnet}2
916 | | ... | ${tg1_if1_mac}
917 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | ${tg_if2_ip6_subnet}2
918 | | ... | ${tg1_if2_mac}
919 | | ${dut1-memif-1-if2_mac}= | Get Interface MAC | ${dut1} | memif2
920 | | ${dut2-memif-1-if2_mac}= | Get Interface MAC | ${dut2} | memif2
921 | | Add Ip Neighbor | ${dut1} | ${dut1-memif-1-if1} | ${dut1_nh}
922 | | ... | ${dut1-memif-1-if2_mac}
923 | | Add Ip Neighbor | ${dut2} | ${dut2-memif-1-if1} | ${dut2_nh}
924 | | ... | ${dut2-memif-1-if2_mac}
925 | | Vpp Route Add | ${dut1} | ${dut2_sid1} | ${sid_prefix}
926 | | ... | gateway=${dut2_if1_ip6} | interface=${dut1_if2}
927 | | Vpp Route Add | ${dut1} | ${out_sid2_1} | ${sid_prefix}
928 | | ... | gateway=${tg_if1_ip6_subnet}2 | interface=${dut1_if1}
929 | | Vpp Route Add | ${dut2} | ${dut1_sid2} | ${sid_prefix}
930 | | ... | gateway=${dut1_if2_ip6} | interface=${dut2_if1}
931 | | Vpp Route Add | ${dut2} | ${out_sid1_1} | ${sid_prefix}
932 | | ... | gateway=${tg_if2_ip6_subnet}2 | interface=${dut2_if2}
933 # Configure SRv6 for direction0 on DUT1
934 | | Set SR Encaps Source Address on DUT | ${dut1} | ${dut1_sid1}
935 | | @{sid_list_dir0}= | Create List | ${dut2_sid1} | ${out_sid1_1}
936 | | ... | ${out_sid1_2}
937 | | Configure SR Policy on DUT | ${dut1} | ${dut1_bsid} | encap
938 | | ... | @{sid_list_dir0}
939 | | Configure SR Steer on DUT | ${dut1} | L3 | ${dut1_bsid}
940 | | ... | ip_addr=${tg_if2_ip6_subnet} | prefix=${sid_prefix}
941 # Configure SRv6 for direction1 on DUT2
942 | | Set SR Encaps Source Address on DUT | ${dut2} | ${dut2_sid2}
943 | | @{sid_list_dir1}= | Create List | ${dut1_sid2} | ${out_sid2_1}
944 | | ... | ${out_sid2_2}
945 | | Configure SR Policy on DUT | ${dut2} | ${dut2_bsid} | encap
946 | | ... | @{sid_list_dir1}
947 | | Configure SR Steer on DUT | ${dut2} | L3 | ${dut2_bsid}
948 | | ... | ip_addr=${tg_if1_ip6_subnet} | prefix=${sid_prefix}
949 # Configure SRv6 for direction0 on DUT2
950 | | ${dut2_out_if}= | Get Interface Name | ${dut2} | memif1
951 | | ${dut2_in_if}= | Get Interface Name | ${dut2} | memif2
952 | | Remove Values From List | ${sid_list_dir0} | ${dut2_sid1}
953 | | Run Keyword If | "${behavior}" == "static_proxy"
954 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.as
955 | | ... | ${NONE} | ${dut2_nh} | ${NONE} | ${dut2_out_if} | ${dut2_in_if}
956 | | ... | ${dut1_sid1} | @{sid_list_dir0}
957 | | ... | ELSE IF | "${behavior}" == "dynamic_proxy"
958 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.ad
959 | | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
960 | | ... | ELSE IF | "${behavior}" == "masquerading"
961 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.am
962 | | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
963 | | ... | ELSE | Fail | Unsupported behaviour: ${behavior}
964 # Configure SRv6 for direction1 on DUT1
965 | | ${dut1_out_if}= | Get Interface Name | ${dut1} | memif1
966 | | ${dut1_in_if}= | Get Interface Name | ${dut1} | memif2
967 | | Remove Values From List | ${sid_list_dir1} | ${dut1_sid2}
968 | | Run Keyword If | "${behavior}" == "static_proxy"
969 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.as
970 | | ... | ${NONE} | ${dut1_nh} | ${NONE} | ${dut1_out_if} | ${dut1_in_if}
971 | | ... | ${dut2_sid2} | @{sid_list_dir1}
972 | | ... | ELSE IF | "${behavior}" == "dynamic_proxy"
973 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.ad
974 | | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
975 | | ... | ELSE IF | "${behavior}" == "masquerading"
976 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.am
977 | | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
978 | | ... | ELSE | Fail | Unsupported behaviour: ${behavior}
979 | | Set interfaces in path up
980
981 | Initialize L2 patch
982 | | [Documentation]
983 | | ... | Setup L2 patch topology by cross connecting two interfaces on
984 | | ... | each DUT. Interfaces are brought up.
985 | | ...
986 | | Set interfaces in path up
987 | | ${duts}= | Get Matches | ${nodes} | DUT*
988 | | :FOR | ${dut} | IN | @{duts}
989 | | | Configure L2patch | ${nodes['${dut}']} | ${${dut}_if1} | ${${dut}_if2}
990
991 | Initialize L2 xconnect in 2-node circular topology
992 | | [Documentation]
993 | | ... | Setup L2 xconnect topology by cross connecting two interfaces on
994 | | ... | each DUT. Interfaces are brought up.
995 | | ...
996 | | Set interfaces in path up
997 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1_if2}
998
999 | Initialize L2 xconnect in 3-node circular topology
1000 | | [Documentation]
1001 | | ... | Setup L2 xconnect topology by cross connecting two interfaces on
1002 | | ... | each DUT. Interfaces are brought up.
1003 | | ... |
1004 | | Set interfaces in path up
1005 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1_if2}
1006 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
1007
1008 | Initialize L2 xconnect with VXLANoIPv4 in 3-node circular topology
1009 | | [Documentation]
1010 | | ... | Setup L2 xconnect topology with VXLANoIPv4 by cross connecting
1011 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
1012 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
1013 | | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as
1014 | | ... | interfaces.
1015 | | ...
1016 | | Set interfaces in path up
1017 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1 | 24
1018 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2 | 24
1019 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1020 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1021 | | Add arp on dut | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac}
1022 | | Add arp on dut | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac}
1023 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
1024 | | ... | 172.16.0.1 | 172.16.0.2
1025 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1s_vxlan}
1026 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
1027 | | ... | 172.16.0.2 | 172.16.0.1
1028 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${dut2s_vxlan}
1029
1030 | Initialize L2 xconnect with Vhost-User on node
1031 | | [Documentation]
1032 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
1033 | | ... | defined VPP node. Add each Vhost-User interface into L2 cross-connect
1034 | | ... | with with physical inteface or Vhost-User interface of another VM.
1035 | | ...
1036 | | ... | *Arguments:*
1037 | | ... | - dut - DUT node. Type: string
1038 | | ... | - nf_nodes - VM count. Type: integer
1039 | | ...
1040 | | ... | *Note:*
1041 | | ... | Socket paths for VM are defined in following format:
1042 | | ... | - /tmp/sock-\${VM_ID}-1
1043 | | ... | - /tmp/sock-\${VM_ID}-2
1044 | | ...
1045 | | ... | *Example:*
1046 | | ...
1047 | | ... | \| Initialize L2 xconnect with Vhost-User on node \| DUT1 \| 1 \|
1048 | | ...
1049 | | [Arguments] | ${dut} | ${nf_nodes}=${1}
1050 | | ...
1051 | | :FOR | ${number} | IN RANGE | 1 | ${nf_nodes}+1
1052 | | | ${sock1}= | Set Variable | /var/run/vpp/sock-${number}-1
1053 | | | ${sock2}= | Set Variable | /var/run/vpp/sock-${number}-2
1054 | | | ${prev_index}= | Evaluate | ${number}-1
1055 | | | Configure vhost interfaces for L2BD forwarding | ${nodes['${dut}']}
1056 | | | ... | ${sock1} | ${sock2} | ${dut}-vhost-${number}-if1
1057 | | | ... | ${dut}-vhost-${number}-if2
1058 | | | ${dut_xconnect_if1}= | Set Variable If | ${number}==1 | ${${dut}_if1}
1059 | | | ... | ${${dut}-vhost-${prev_index}-if2}
1060 | | | Configure L2XC | ${nodes['${dut}']} | ${dut_xconnect_if1}
1061 | | | ... | ${${dut}-vhost-${number}-if1}
1062 | | | Run Keyword If | ${number}==${nf_nodes} | Configure L2XC
1063 | | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${number}-if2} | ${${dut}_if2}
1064
1065 | Initialize L2 xconnect with Vhost-User
1066 | | [Documentation]
1067 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
1068 | | ... | all VPP nodes. Add each Vhost-User interface into L2 cross-connect
1069 | | ... | with with physical inteface or Vhost-User interface of another VM.
1070 | | ...
1071 | | ... | *Arguments:*
1072 | | ... | - nf_nodes - VM count. Type: integer
1073 | | ...
1074 | | ... | *Example:*
1075 | | ...
1076 | | ... | \| Initialize L2 xconnect with Vhost-User \| 1 \|
1077 | | ...
1078 | | [Arguments] | ${nf_nodes}=${1}
1079 | | ...
1080 | | ${duts}= | Get Matches | ${nodes} | DUT*
1081 | | :FOR | ${dut} | IN | @{duts}
1082 | | | Initialize L2 xconnect with Vhost-User on node | ${dut}
1083 | | | ... | nf_nodes=${nf_nodes}
1084
1085 | Initialize L2 xconnect with Vhost-User and VLAN in 3-node circular topology
1086 | | [Documentation]
1087 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Cross
1088 | | ... | connect each Vhost interface with one physical interface.
1089 | | ... | Setup VLAN between DUTs. All interfaces are brought up.
1090 | | ...
1091 | | ... | *Arguments:*
1092 | | ... | - subid - ID of the sub-interface to be created. Type: string
1093 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1094 | | ...
1095 | | ... | *Example:*
1096 | | ...
1097 | | ... | \| L2 xconnect with Vhost-User and VLAN initialized in a 3-node\
1098 | | ... | circular topology \| 10 \| pop-1 \|
1099 | | ...
1100 | | [Arguments] | ${subid} | ${tag_rewrite}
1101 | | ...
1102 | | Set interfaces in path up
1103 | | Initialize VLAN dot1q sub-interfaces in circular topology
1104 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
1105 | | Configure L2 tag rewrite method on interfaces
1106 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1107 | | ... | ${tag_rewrite}
1108 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1109 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
1110 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1}
1111 | | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2}
1112 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1113 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
1114 | | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1}
1115 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2}
1116
1117 | Initialize L2 xconnect with Vhost-User and VLAN with DPDK link bonding in 3-node circular topology
1118 | | [Documentation]
1119 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Setup VLAN
1120 | | ... | on BondEthernet interfaces between DUTs. Cross connect one Vhost
1121 | | ... | interface with physical interface towards TG and other Vhost interface
1122 | | ... | with VLAN sub-interface. All interfaces are brought up.
1123 | | ...
1124 | | ... | *Arguments:*
1125 | | ... | - subid - ID of the sub-interface to be created. Type: string
1126 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1127 | | ...
1128 | | ... | *Example:*
1129 | | ...
1130 | | ... | \| Initialize L2 xconnect with Vhost-User and VLAN with DPDK link\
1131 | | ... | bonding in 3-node circular topology \| 10 \| pop-1 \|
1132 | | ...
1133 | | [Arguments] | ${subid} | ${tag_rewrite}
1134 | | ...
1135 | | Set interfaces in path up
1136 | | Add DPDK bonded ethernet interfaces to topology file in 3-node single link topology
1137 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
1138 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
1139 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
1140 | | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1}
1141 | | Initialize VLAN dot1q sub-interfaces in circular topology
1142 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
1143 | | ... | ${subid}
1144 | | Configure L2 tag rewrite method on interfaces
1145 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1146 | | ... | ${tag_rewrite}
1147 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1148 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
1149 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1}
1150 | | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2}
1151 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1152 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
1153 | | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1}
1154 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2}
1155
1156 | Initialize L2 xconnect with Vhost-User and VLAN with VPP link bonding in 3-node circular topology
1157 | | [Documentation]
1158 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Create one
1159 | | ... | link bonding (BondEthernet) interface on both VPP nodes. Enslave one
1160 | | ... | physical interface towards next DUT by BondEthernet interface. Setup
1161 | | ... | VLAN on BondEthernet interfaces between DUTs. Cross connect one Vhost
1162 | | ... | interface with physical interface towards TG and other Vhost interface
1163 | | ... | with VLAN sub-interface. All interfaces are brought up.
1164 | | ...
1165 | | ... | *Arguments:*
1166 | | ... | - subid - ID of the sub-interface to be created. Type: string
1167 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1168 | | ... | - bond_mode - Link bonding mode. Type: string
1169 | | ... | - lb_mode - Load balance mode. Type: string
1170 | | ...
1171 | | ... | *Example:*
1172 | | ...
1173 | | ... | \| Initialize L2 xconnect with Vhost-User and VLAN with VPP link\
1174 | | ... | bonding in 3-node circular topology \| 10 \| pop-1 \| xor \| l34 \|
1175 | | ...
1176 | | [Arguments] | ${subid} | ${tag_rewrite} | ${bond_mode} | ${lb_mode}
1177 | | ...
1178 | | Set interfaces in path up
1179 | | ${dut1_eth_bond_if1}= | VPP Create Bond Interface | ${dut1} | ${bond_mode}
1180 | | ... | ${lb_mode}
1181 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
1182 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
1183 | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
1184 | | ... | Variable Should Exist | ${dut1_if2}
1185 | | Run Keyword If | '${if2_status}' == 'PASS'
1186 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2}
1187 | | ... | ${dut1_eth_bond_if1}
1188 | | ... | ELSE
1189 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_1}
1190 | | ... | ${dut1_eth_bond_if1}
1191 | | Run Keyword Unless | '${if2_status}' == 'PASS'
1192 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_2}
1193 | | ... | ${dut1_eth_bond_if1}
1194 | | ${dut2_eth_bond_if1}= | VPP Create Bond Interface | ${dut2} | ${bond_mode}
1195 | | ... | ${lb_mode}
1196 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
1197 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
1198 | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
1199 | | ... | Variable Should Exist | ${dut2_if1}
1200 | | Run Keyword If | '${if1_status}' == 'PASS'
1201 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1}
1202 | | ... | ${dut2_eth_bond_if1}
1203 | | ... | ELSE
1204 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_1}
1205 | | ... | ${dut2_eth_bond_if1}
1206 | | Run Keyword Unless | '${if2_status}' == 'PASS'
1207 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_2}
1208 | | ... | ${dut2_eth_bond_if1}
1209 | | VPP Show Bond Data On All Nodes | ${nodes} | details=${TRUE}
1210 | | Initialize VLAN dot1q sub-interfaces in circular topology
1211 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
1212 | | ... | ${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}
1224
1225 | Initialize L2 bridge domain in circular topology
1226 | | [Documentation]
1227 | | ... | Setup L2 DB topology by adding two interfaces on each DUT into BD
1228 | | ... | that is created automatically with index 1. Learning is enabled.
1229 | | ... | Interfaces are brought up.
1230 | | ...
1231 | | ... | *Arguments:*
1232 | | ... | - bd_id - Bridge domain ID. Type: integer
1233 | | ...
1234 | | ... | *Example:*
1235 | | ...
1236 | | ... | \| Initialize L2 bridge domain in circular topology \| 1 \|
1237 | | ...
1238 | | [Arguments] | ${bd_id}=${1}
1239 | | ...
1240 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
1241 | | ... | Variable Should Exist | ${dut2}
1242 | | ...
1243 | | Set interfaces in path up
1244 | | ...
1245 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id}
1246 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id}
1247 | | Run Keyword If | '${dut2_status}' == 'PASS'
1248 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${bd_id}
1249 | | Run Keyword If | '${dut2_status}' == 'PASS'
1250 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id}
1251
1252 | Configure IPv4 ACLs
1253 | | [Documentation]
1254 | | ... | Configure ACL with required number of not-hitting permit ACEs plus two
1255 | | ... | hitting ACEs for both traffic directions.
1256 | | ...
1257 | | ... | *Arguments:*
1258 | | ... | - dut_node - DUT node. Type: dictionary
1259 | | ... | - dut_if1 - DUT node interface1 name (Optional). Type: string
1260 | | ... | - dut_if2 - DUT node interface2 name (Optional). Type: string
1261 | | ...
1262 | | ... | *Example:*
1263 | | ...
1264 | | ... | \| Configure IPv4 ACLs \| ${nodes['DUT1']} \| GigabitEthernet0/7/0 \
1265 | | ... | \| GigabitEthernet0/8/0 \|
1266 | | ...
1267 | | ... | _NOTE:_ This KW uses following test case variables:
1268 | | ... | - src_ip_start - Source IP address start. Type: string
1269 | | ... | - dst_ip_start - Destination IP address start. Type: string
1270 | | ... | - ip_step - IP address step. Type: string
1271 | | ... | - sport_start - Source port number start. Type: string
1272 | | ... | - dport_start - Destination port number start. Type: string
1273 | | ... | - port_step - Port number step. Type: string
1274 | | ... | - no_hit_aces_number - Number of not-hitting ACEs to be configured.
1275 | | ... | Type: integer
1276 | | ... | - acl_apply_type - To what path apply the ACL - input or output.
1277 | | ... | Type: string
1278 | | ... | - acl_action - Action for the rule - deny, permit, permit+reflect.
1279 | | ... | Type: string
1280 | | ... | - trex_stream1_subnet - IP subnet used by T-Rex in direction 0->1.
1281 | | ... | Type: string
1282 | | ... | - trex_stream2_subnet - IP subnet used by T-Rex in direction 1->0.
1283 | | ... | Type: string
1284 | | ...
1285 | | [Arguments] | ${dut} | ${dut_if1}=${NONE} | ${dut_if2}=${NONE}
1286 | | ${src_ip_int} = | Evaluate
1287 | | ... | int(ipaddress.ip_address(unicode($src_ip_start))) - $ip_step
1288 | | ... | modules=ipaddress
1289 | | ${dst_ip_int} = | Evaluate
1290 | | ... | int(ipaddress.ip_address(unicode($dst_ip_start))) - $ip_step
1291 | | ... | modules=ipaddress
1292 | | ${ip_limit} = | Set Variable | 255.255.255.255
1293 | | ${ip_limit_int} = | Evaluate
1294 | | ... | int(ipaddress.ip_address(unicode($ip_limit))) | modules=ipaddress
1295 | | ${sport}= | Evaluate | $sport_start - $port_step
1296 | | ${dport}= | Evaluate | $dport_start - $port_step
1297 | | ${port_limit}= | Set Variable | ${65535}
1298 | | ${acl}= | Set Variable | ipv4 permit
1299 | | :FOR | ${nr} | IN RANGE | 0 | ${no_hit_aces_number}
1300 | | | ${src_ip_int} = | Evaluate | $src_ip_int + $ip_step
1301 | | | ${dst_ip_int} = | Evaluate | $dst_ip_int + $ip_step
1302 | | | ${sport}= | Evaluate | $sport + $port_step
1303 | | | ${dport}= | Evaluate | $dport + $port_step
1304 | | | ${ipv4_limit_reached}= | Set Variable If
1305 | | | ... | $src_ip_int > $ip_limit_int or $src_ip_int > $ip_limit_int
1306 | | | ... | ${TRUE}
1307 | | | ${udp_limit_reached}= | Set Variable If
1308 | | | ... | $sport > $port_limit or $dport > $port_limit | ${TRUE}
1309 | | | Run Keyword If | $ipv4_limit_reached is True | Log
1310 | | | ... | Can't do more iterations - IPv4 address limit has been reached.
1311 | | | ... | WARN
1312 | | | Run Keyword If | $udp_limit_reached is True | Log
1313 | | | ... | Can't do more iterations - UDP port limit has been reached.
1314 | | | ... | WARN
1315 | | | ${src_ip} = | Run Keyword If | $ipv4_limit_reached is True
1316 | | | ... | Set Variable | ${ip_limit}
1317 | | | ... | ELSE | Evaluate | str(ipaddress.ip_address($src_ip_int))
1318 | | | ... | modules=ipaddress
1319 | | | ${dst_ip} = | Run Keyword If | $ipv4_limit_reached is True
1320 | | | ... | Set Variable | ${ip_limit}
1321 | | | ... | ELSE | Evaluate | str(ipaddress.ip_address($dst_ip_int))
1322 | | | ... | modules=ipaddress
1323 | | | ${sport}= | Set Variable If | ${sport} > $port_limit | $port_limit
1324 | | | ... | ${sport}
1325 | | | ${dport}= | Set Variable If | ${dport} > $port_limit | $port_limit
1326 | | | ... | ${dport}
1327 | | | ${acl}= | Catenate | ${acl} | src ${src_ip}/32 dst ${dst_ip}/32
1328 | | | ... | sport ${sport} | dport ${dport},
1329 | | | Exit For Loop If
1330 | | | ... | $ipv4_limit_reached is True or $udp_limit_reached is True
1331 | | ${acl}= | Catenate | ${acl}
1332 | | ... | ipv4 ${acl_action} src ${trex_stream1_subnet},
1333 | | ... | ipv4 ${acl_action} src ${trex_stream2_subnet}
1334 | | Add Replace Acl Multi Entries | ${dut} | rules=${acl}
1335 | | @{acl_list}= | Create List | ${0}
1336 | | Run Keyword If | 'input' in $acl_apply_type and $dut_if1 is not None
1337 | | ... | Set Acl List For Interface | ${dut} | ${dut_if1} | input | ${acl_list}
1338 | | Run Keyword If | 'input' in $acl_apply_type and $dut_if2 is not None
1339 | | ... | Set Acl List For Interface | ${dut} | ${dut_if2} | input | ${acl_list}
1340 | | Run Keyword If | 'output' in $acl_apply_type and $dut_if1 is not None
1341 | | ... | Set Acl List For Interface | ${dut} | ${dut_if1} | output
1342 | | ... | ${acl_list}
1343 | | Run Keyword If | 'output' in $acl_apply_type and $dut_if2 is not None
1344 | | ... | Set Acl List For Interface | ${dut} | ${dut_if2} | output
1345 | | ... | ${acl_list}
1346
1347 | Initialize L2 bridge domain with IPv4 ACLs on DUT1 in 3-node circular topology
1348 | | [Documentation]
1349 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
1350 | | ... | domain that is created automatically with index 1. Learning is
1351 | | ... | enabled. Interfaces are brought up. Apply required ACL rules to DUT1
1352 | | ... | interfaces.
1353 | | ...
1354 | | ... | *Arguments:*
1355 | | ... | _None_
1356 | | ...
1357 | | ... | *Example:*
1358 | | ...
1359 | | ... | \| Initialize L2 bridge domain with IPv4 ACLs on DUT1 in 3-node \
1360 | | ... | circular topology \|
1361 | | ...
1362 | | ... | _NOTE:_ This KW uses following test case variables:
1363 | | ... | - dut1 - DUT1 node.
1364 | | ... | - dut2 - DUT2 node.
1365 | | ... | - dut1_if1 - DUT1 interface towards TG.
1366 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
1367 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
1368 | | ... | - dut2_if2 - DUT2 interface towards TG.
1369 | | ...
1370 | | Set interfaces in path up
1371 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1_if2}
1372 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
1373 | | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
1374
1375 | Initialize IPv4 routing for '${ip_nr}' addresses with IPv4 ACLs on DUT1 in circular topology
1376 | | [Documentation]
1377 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node
1378 | | ... | circular topology. Get the interface MAC addresses and setup ARP on
1379 | | ... | all VPP interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG
1380 | | ... | links. In case of 3-node topology setup IPv4 adresses with /30 prefix
1381 | | ... | on DUT1-DUT2 link and set routing on both DUT nodes with prefix /24
1382 | | ... | and next hop of neighbour DUT interface IPv4 address.
1383 | | ... | Apply required ACL rules to DUT1 interfaces.
1384 | | ...
1385 | | ... | *Arguments:*
1386 | | ... | - ip_nr - Number of IPs to be used. Type: integer or string
1387 | | ...
1388 | | ... | *Example:*
1389 | | ...
1390 | | ... | \| Initialize IPv4 routing for '10' addresses with IPv4 ACLs on DUT1 \
1391 | | ... | in 3-node circular topology \|
1392 | | ...
1393 | | ... | _NOTE:_ This KW uses following test case variables:
1394 | | ... | - tg - TG node.
1395 | | ... | - dut1 - DUT1 node.
1396 | | ... | - dut2 - DUT2 node.
1397 | | ... | - tg_if1 - TG interface 1 towards DUT1.
1398 | | ... | - tg_if2 - TG interface 2 towards DUT2 (3-node topo) or DUT1
1399 | | ... | (2-node topo).
1400 | | ... | - dut1_if1 - DUT1 interface 1 towards TG.
1401 | | ... | - dut1_if2 - DUT1 interface 2 towards DUT2 (3-node topo) or TG
1402 | | ... | (2-node topo).
1403 | | ... | - dut2_if1 - DUT2 interface 1 towards DUT1.
1404 | | ... | - dut2_if2 - DUT2 interface 2 towards TG.
1405 | | ...
1406 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
1407 | | ... | Variable Should Exist | ${dut2}
1408 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
1409 | | ... | Set Variable | ${dut2}
1410 | | ... | ELSE | Set Variable | ${dut1}
1411 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
1412 | | ... | Set Variable | ${dut2_if2}
1413 | | ... | ELSE | Set Variable | ${dut1_if2}
1414 | | ...
1415 | | Set interfaces in path up
1416 | | ...
1417 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1418 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1419 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
1420 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
1421 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
1422 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
1423 | | ...
1424 | | :FOR | ${number} | IN RANGE | 2 | ${ip_nr}+2
1425 | | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.${number}
1426 | | | ... | ${tg1_if1_mac}
1427 | | | Add arp on dut | ${dut} | ${dut_if2} | 20.20.20.${number}
1428 | | | ... | ${tg1_if2_mac}
1429 | | Run Keyword If | '${dut2_status}' == 'PASS'
1430 | | ... | Add arp on dut | ${dut1} | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
1431 | | Run Keyword If | '${dut2_status}' == 'PASS'
1432 | | ... | Add arp on dut | ${dut2} | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
1433 | | ...
1434 | | Configure IP addresses on interfaces
1435 | | ... | ${dut1} | ${dut1_if1} | 10.10.10.1 | 24
1436 | | ... | ${dut} | ${dut_if2} | 20.20.20.1 | 24
1437 | | Run Keyword If | '${dut2_status}' == 'PASS'
1438 | | ... | Configure IP addresses on interfaces
1439 | | ... | ${dut1} | ${dut1_if2} | 1.1.1.1 | 30
1440 | | ... | ${dut2} | ${dut2_if1} | 1.1.1.2 | 30
1441 | | ...
1442 | | Run Keyword If | '${dut2_status}' == 'PASS'
1443 | | ... | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | gateway=1.1.1.2
1444 | | ... | interface=${dut1_if2}
1445 | | Run Keyword If | '${dut2_status}' == 'PASS'
1446 | | ... | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=1.1.1.1
1447 | | ... | interface=${dut2_if1}
1448 | | ...
1449 | | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
1450
1451 | Configure MACIP ACLs
1452 | | [Documentation]
1453 | | ... | Configure MACIP ACL with required number of not-hitting permit ACEs
1454 | | ... | plus two hitting ACEs for both traffic directions.
1455 | | ...
1456 | | ... | *Arguments:*
1457 | | ... | - dut_node - DUT node. Type: dictionary
1458 | | ... | - dut_if1 - DUT node interface1 name (Optional). Type: string
1459 | | ... | - dut_if2 - DUT node interface2 name (Optional). Type: string
1460 | | ...
1461 | | ... | *Example:*
1462 | | ...
1463 | | ... | \| Configure MACIP ACLs \| ${nodes['DUT1']} \| GigabitEthernet0/7/0 \
1464 | | ... | \| GigabitEthernet0/8/0 \|
1465 | | ...
1466 | | ... | _NOTE:_ This KW uses following test case variables:
1467 | | ... | - src_ip_start - Source IP address start. Type: string
1468 | | ... | - ip_step - IP address step. Type: string
1469 | | ... | - src_mac_start - Source MAC address start in format with colons.
1470 | | ... | Type: string
1471 | | ... | - src_mac_step - Source MAC address step. Type: string
1472 | | ... | - src_mac_mask - Source MAC address mask. 00:00:00:00:00:00 is a
1473 | | ... | wildcard mask. Type: string
1474 | | ... | - no_hit_aces_number - Number of not-hitting ACEs to be configured.
1475 | | ... | Type: integer
1476 | | ... | - acl_action - Action for the rule - deny, permit, permit+reflect.
1477 | | ... | Type: string
1478 | | ... | - tg_stream1_subnet - IP subnet used by TG in direction 0->1.
1479 | | ... | Type: string
1480 | | ... | - tg_stream2_subnet - IP subnet used by TG in direction 1->0.
1481 | | ... | Type: string
1482 | | ... | - tg_stream1_mac - Source MAC address of traffic stream 1.
1483 | | ... | Type: string
1484 | | ... | - tg_stream2_mac - Source MAC address of traffic stream 2.
1485 | | ... | Type: string
1486 | | ... | - tg_mac_mask - MAC address mask for traffic streams.
1487 | | ... | 00:00:00:00:00:00 is a wildcard mask. Type: string
1488 | | ...
1489 | | [Arguments] | ${dut} | ${dut_if1}=${NONE} | ${dut_if2}=${NONE}
1490 | | ...
1491 | | ${src_ip_int} = | IP To Int | ${src_ip_start}
1492 | | ${src_ip_int} = | Evaluate | ${src_ip_int} - ${ip_step}
1493 | | ...
1494 | | ${ip_limit} = | Set Variable | 255.255.255.255
1495 | | ${ip_limit_int} = | IP To Int | ${ip_limit}
1496 | | ...
1497 | | ${src_mac_int} = | Mac To Int | ${src_mac_start}
1498 | | ${src_mac_int} = | Evaluate | ${src_mac_int} - ${src_mac_step}
1499 | | ...
1500 | | ${mac_limit} = | Set Variable | ff:ff:ff:ff:ff:ff
1501 | | ${mac_limit_int} = | Mac To Int | ${mac_limit}
1502 | | ...
1503 | | ${acl}= | Set Variable | ipv4 permit
1504 | | :FOR | ${nr} | IN RANGE | 0 | ${no_hit_aces_number}
1505 | | | ${src_ip_int} = | Evaluate | ${src_ip_int} + ${ip_step}
1506 | | | ${src_mac_int} = | Evaluate | ${src_mac_int} + ${src_mac_step}
1507 | | | ${ipv4_limit_reached}= | Set Variable If
1508 | | | ... | ${src_ip_int} > ${ip_limit_int} | ${TRUE}
1509 | | | ${mac_limit_reached}= | Set Variable If
1510 | | | ... | ${src_mac_int} > ${mac_limit_int} | ${TRUE}
1511 | | | Run Keyword If | '${ipv4_limit_reached}' == '${TRUE}' | Log
1512 | | | ... | Can't do more iterations - IPv4 address limit has been reached.
1513 | | | ... | WARN
1514 | | | Run Keyword If | '${mac_limit_reached}' == '${TRUE}' | Log
1515 | | | ... | Can't do more iterations - MAC address limit has been reached.
1516 | | | ... | WARN
1517 | | | ${src_ip} = | Run Keyword If | '${ipv4_limit_reached}' == '${TRUE}'
1518 | | | ... | Set Variable | ${ip_limit}
1519 | | | ... | ELSE | Int To IP | ${src_ip_int}
1520 | | | ${src_mac}= | Run Keyword If | '${mac_limit_reached}' == '${TRUE}'
1521 | | | ... | Set Variable | ${mac_limit}
1522 | | | ... | ELSE | Int To Mac | ${src_mac_int}
1523 | | | ${acl}= | Catenate | ${acl} | ip ${src_ip}/32
1524 | | | ... | mac ${src_mac} | mask ${src_mac_mask},
1525 | | | Exit For Loop If | '${ipv4_limit_reached}' == '${TRUE}' or '${mac_limit_reached}' == '${TRUE}'
1526 | | ${acl0}= | Catenate | ${acl}
1527 | | ... | ipv4 ${acl_action} ip ${tg_stream1_subnet} mac ${tg_stream1_mac}
1528 | | ... | mask ${tg_mac_mask}
1529 | | ${acl1}= | Catenate | ${acl}
1530 | | ... | ipv4 ${acl_action} ip ${tg_stream2_subnet} mac ${tg_stream2_mac}
1531 | | ... | mask ${tg_mac_mask}
1532 | | Add Macip Acl Multi Entries | ${dut} | rules=${acl0}
1533 | | Add Macip Acl Multi Entries | ${dut} | rules=${acl1}
1534 | | ${acl_idx}= | Set Variable | 0
1535 | | Run Keyword Unless | '${dut_if1}' == '${NONE}'
1536 | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if1} | add | ${acl_idx}
1537 | | ${acl_idx}= | Set Variable | 1
1538 | | Run Keyword Unless | '${dut_if2}' == '${NONE}'
1539 | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if2} | add | ${acl_idx}
1540
1541 | Initialize L2 bridge domain with MACIP ACLs on DUT1 in 3-node circular topology
1542 | | [Documentation]
1543 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
1544 | | ... | domain that is created automatically with index 1. Learning is
1545 | | ... | enabled. Interfaces are brought up. Apply required MACIP ACL rules to
1546 | | ... | DUT1 interfaces.
1547 | | ...
1548 | | ... | *Arguments:*
1549 | | ... | _None_
1550 | | ...
1551 | | ... | *Example:*
1552 | | ...
1553 | | ... | \| Initialize L2 bridge domain with MACIP ACLs on DUT1 in 3-node \
1554 | | ... | circular topology \|
1555 | | ...
1556 | | ... | _NOTE 1:_ This KW uses following test case variables:
1557 | | ... | - tg - TG node.
1558 | | ... | - dut1 - DUT1 node.
1559 | | ... | - dut2 - DUT2 node.
1560 | | ... | - tg_if1 - TG interface towards DUT1.
1561 | | ... | - tg_if2 - TG interface towards DUT2.
1562 | | ... | - dut1_if1 - DUT1 interface towards TG.
1563 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
1564 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
1565 | | ... | - dut2_if2 - DUT2 interface towards TG.
1566 | | ...
1567 | | Set interfaces in path up
1568 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1_if2}
1569 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
1570 | | Configure MACIP ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
1571
1572 | Initialize L2 bridge domains with Vhost-User on node
1573 | | [Documentation]
1574 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
1575 | | ... | defined VPP node. Add each Vhost-User interface into L2 bridge
1576 | | ... | domains with learning enabled with physical inteface or Vhost-User
1577 | | ... | interface of another VM.
1578 | | ...
1579 | | ... | *Arguments:*
1580 | | ... | - dut - DUT node. Type: string
1581 | | ... | - nf_chain - NF chain. Type: integer
1582 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
1583 | | ...
1584 | | ... | *Note:*
1585 | | ... | Socket paths for VM are defined in following format:
1586 | | ... | - /tmp/sock-\${VM_ID}-1
1587 | | ... | - /tmp/sock-\${VM_ID}-2
1588 | | ...
1589 | | ... | *Example:*
1590 | | ...
1591 | | ... | \| Initialize L2 bridge domains with Vhost-User on node \| DUT1 \
1592 | | ... | \| 1 \| 1 \|
1593 | | ...
1594 | | [Arguments] | ${dut} | ${nf_chain}=${1} | ${nf_nodes}=${1}
1595 | | ...
1596 | | ${bd_id2}= | Evaluate | ${nf_nodes}+1
1597 | | Add interface to bridge domain | ${nodes['${dut}']}
1598 | | ... | ${${dut}_if1} | ${1}
1599 | | Add interface to bridge domain | ${nodes['${dut}']}
1600 | | ... | ${${dut}_if2} | ${bd_id2}
1601 | | :FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes}+1
1602 | | | ${qemu_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
1603 | | | ${sock1}= | Set Variable | /var/run/vpp/sock-${qemu_id}-1
1604 | | | ${sock2}= | Set Variable | /var/run/vpp/sock-${qemu_id}-2
1605 | | | Configure vhost interfaces for L2BD forwarding | ${nodes['${dut}']}
1606 | | | ... | ${sock1} | ${sock2}
1607 | | | ... | ${dut}-vhost-${qemu_id}-if1
1608 | | | ... | ${dut}-vhost-${qemu_id}-if2
1609 | | | ${bd_id2}= | Evaluate | ${nf_node}+1
1610 | | | Add interface to bridge domain | ${nodes['${dut}']}
1611 | | | ... | ${${dut}-vhost-${qemu_id}-if1} | ${nf_node}
1612 | | | Add interface to bridge domain | ${nodes['${dut}']}
1613 | | | ... | ${${dut}-vhost-${qemu_id}-if2} | ${bd_id2}
1614
1615 | Initialize L2 bridge domains with Vhost-User
1616 | | [Documentation]
1617 | | ... | Create pairs of Vhost-User interfaces for defined number of VNF nodes
1618 | | ... | on all defined VPP nodes. Add each Vhost-User interface into L2 bridge
1619 | | ... | domains with learning enabled with physical inteface or Vhost-User
1620 | | ... | interface of another VM.
1621 | | ...
1622 | | ... | *Arguments:*
1623 | | ... | - nf_chain - NF chain. Type: integer
1624 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
1625 | | ...
1626 | | ... | *Example:*
1627 | | ...
1628 | | ... | \| Initialize L2 bridge domains with Vhost-User \| 1 \| 1 \|
1629 | | ...
1630 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1}
1631 | | ...
1632 | | ${duts}= | Get Matches | ${nodes} | DUT*
1633 | | :FOR | ${dut} | IN | @{duts}
1634 | | | Initialize L2 bridge domains with Vhost-User on node | ${dut}
1635 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
1636
1637 | Initialize L2 bridge domains for multiple chains with Vhost-User
1638 | | [Documentation]
1639 | | ... | Create pairs of Vhost-User interfaces for defined number of NF chains
1640 | | ... | with defined number of VNF nodes on all defined VPP nodes. Add each
1641 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1642 | | ... | with physical inteface or Vhost-User interface of another VM.
1643 | | ...
1644 | | ... | *Arguments:*
1645 | | ... | - nf_chains - Number of chains of NFs. Type: integer
1646 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
1647 | | ...
1648 | | ... | *Example:*
1649 | | ...
1650 | | ... | \| Initialize L2 bridge domains for multiple chains with Vhost-User \
1651 | | ... | \| 1 \| 1 \|
1652 | | ...
1653 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1}
1654 | | ...
1655 | | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
1656 | | | Initialize L2 bridge domains with Vhost-User | nf_chain=${nf_chain}
1657 | | | ... | nf_nodes=${nf_nodes}
1658
1659 | Initialize L2 bridge domain with VXLANoIPv4 in 3-node circular topology
1660 | | [Documentation]
1661 | | ... | Setup L2 bridge domain topology with VXLANoIPv4 by connecting
1662 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
1663 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
1664 | | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as
1665 | | ... | interfaces.
1666 | | ...
1667 | | Set interfaces in path up
1668 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1
1669 | | ... | 24
1670 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2
1671 | | ... | 24
1672 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1673 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1674 | | Add arp on dut | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac}
1675 | | Add arp on dut | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac}
1676 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
1677 | | ... | 172.16.0.1 | 172.16.0.2
1678 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
1679 | | ... | 172.16.0.2 | 172.16.0.1
1680 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1s_vxlan}
1681 | | Configure L2BD forwarding | ${dut2} | ${dut2_if2} | ${dut2s_vxlan}
1682
1683 | Initialize L2 bridge domain with VLAN and VXLANoIPv4 in 3-node circular topology
1684 | | [Documentation]
1685 | | ... | Setup L2 bridge domain topology with VLAN and VXLANoIPv4 by connecting
1686 | | ... | pairs of VLAN sub-interface and VXLAN interface to separate L2 bridge
1687 | | ... | domain on each DUT. All interfaces are brought up. IPv4 addresses
1688 | | ... | with prefix /32 are configured on interfaces between DUTs. VXLAN
1689 | | ... | sub-interfaces has same IPv4 address as interfaces.
1690 | | ...
1691 | | ... | *Arguments:*
1692 | | ... | - vxlan_count - VXLAN count. Type: integer
1693 | | ...
1694 | | ... | *Example:*
1695 | | ...
1696 | | ... | \| Initialize L2 bridge domain with VLAN and VXLANoIPv4 in 3-node \
1697 | | ... | \| circular topology \| ${1} \|
1698 | | ...
1699 | | [Arguments] | ${vxlan_count}=${1}
1700 | | ...
1701 | | Set interfaces in path up
1702 | | ...
1703 | | ${bd_id_start}= | Set Variable | ${1}
1704 | | ${vni_start} = | Set Variable | ${20}
1705 | | ...
1706 | | ${ip_step} = | Set Variable | ${2}
1707 | | ${dut1_ip_start}= | Set Variable | 172.16.0.1
1708 | | ${dut2_ip_start}= | Set Variable | 172.16.0.2
1709 | | ...
1710 | | ${ip_limit} = | Set Variable | 255.255.255.255
1711 | | ...
1712 | | Vpp create multiple VXLAN IPv4 tunnels | node=${dut1}
1713 | | ... | node_vxlan_if=${dut1_if2} | node_vlan_if=${dut1_if1}
1714 | | ... | op_node=${dut2} | op_node_if=${dut2_if1} | n_tunnels=${vxlan_count}
1715 | | ... | vni_start=${vni_start} | src_ip_start=${dut1_ip_start}
1716 | | ... | dst_ip_start=${dut2_ip_start} | ip_step=${ip_step}
1717 | | ... | ip_limit=${ip_limit} | bd_id_start=${bd_id_start}
1718 | | Vpp create multiple VXLAN IPv4 tunnels | node=${dut2}
1719 | | ... | node_vxlan_if=${dut2_if1} | node_vlan_if=${dut2_if2}
1720 | | ... | op_node=${dut1} | op_node_if=${dut1_if2} | n_tunnels=${vxlan_count}
1721 | | ... | vni_start=${vni_start} | src_ip_start=${dut2_ip_start}
1722 | | ... | dst_ip_start=${dut1_ip_start} | ip_step=${ip_step}
1723 | | ... | ip_limit=${ip_limit} | bd_id_start=${bd_id_start}
1724
1725 | Initialize L2 bridge domains with Vhost-User and VXLANoIPv4 in 3-node circular topology
1726 | | [Documentation]
1727 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
1728 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1729 | | ... | with physical inteface.
1730 | | ... | Setup VXLANoIPv4 between DUTs by connecting physical and vxlan
1731 | | ... | interfaces on each DUT. All interfaces are brought up.
1732 | | ... | IPv4 addresses with prefix /24 are configured on interfaces between
1733 | | ... | DUTs. VXLAN sub-interfaces has same IPv4 address as interfaces.
1734 | | ...
1735 | | ... | *Arguments:*
1736 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1737 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1738 | | ...
1739 | | ... | *Example:*
1740 | | ...
1741 | | ... | \| L2 bridge domains with Vhost-User and VXLANoIPv4 initialized in a\
1742 | | ... | 3-node circular topology \| 1 \| 2 \|
1743 | | ...
1744 | | [Arguments] | ${bd_id1} | ${bd_id2}
1745 | | ...
1746 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1
1747 | | ... | 24
1748 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2
1749 | | ... | 24
1750 | | Set interfaces in path up
1751 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
1752 | | ... | 172.16.0.1 | 172.16.0.2
1753 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
1754 | | ... | 172.16.0.2 | 172.16.0.1
1755 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1756 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1757 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1758 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1759 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1760 | | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${bd_id2}
1761 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1762 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1763 | | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${bd_id1}
1764 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
1765 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
1766 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1767
1768 | Init L2 bridge domains with single DUT with Vhost-User and VXLANoIPv4 in 3-node circular topology
1769 | | [Documentation]
1770 | | ... | Create two Vhost-User interfaces on one VPP node. Add each
1771 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1772 | | ... | one connected to physical interface, the other to VXLAN.
1773 | | ... | Setup VXLANoIPv4 between DUTs and TG by connecting physical and vxlan
1774 | | ... | interfaces on the DUT. All interfaces are brought up.
1775 | | ... | IPv4 addresses with prefix /24 are configured on interfaces between
1776 | | ... | DUT and TG.
1777 | | ...
1778 | | ... | *Arguments:*
1779 | | ... | - dut1_address - Address of physical interface on DUT1. Type: string
1780 | | ... | - dut1_address_subnet - Subnet of the address of physical interface on
1781 | | ... |                         DUT1. Type: string
1782 | | ... | - dut2_address - Address of physical interface on DUT2. Type: string
1783 | | ... | - dut2_address_subnet - Subnet of the address of physical interface on
1784 | | ... |                         DUT2. Type: string
1785 | | ... | - dut1_gw - Address of the _gateway_ to which the traffic will be
1786 | | ... |             forwarded on DUT1. Type: string
1787 | | ... | - dut2_gw - Address of the _gateway_ to which the traffic will be
1788 | | ... |             forwarded on DUT2. Type: string
1789 | | ... | - dut1_vxlans - List of VXLAN params to be configured on DUT1.
1790 | | ... |                 Type: list of dicts, dict params vni, vtep
1791 | | ... | - dut2_vxlans - List of VXLAN params to be configured on DUT2.
1792 | | ... |                 Type: list of dicts, dict params vni, vtep
1793 | | ... | - dut1_route_subnet - Subnet address to forward to  _gateway_ on DUT1.
1794 | | ... |                       Type: string
1795 | | ... | - dut1_route_mask - Subnet address mask to forward to  _gateway_
1796 | | ... |                     on DUT1. Type: string
1797 | | ... | - dut2_route_subnet - Subnet address to forward to  _gateway_ on DUT2.
1798 | | ... |                       Type: string
1799 | | ... | - dut2_route_mask - Subnet address mask to forward to  _gateway_
1800 | | ... |                     on DUT2. Type: string
1801 | | ...
1802 | | ... | *Example:*
1803 | | ...
1804 | | [Arguments] | ${dut1_address} | ${dut1_address_subnet} |
1805 | | ... | ${dut2_address} | ${dut2_address_subnet} | ${dut1_gw} | ${dut2_gw} |
1806 | | ... | ${dut1_vxlans} | ${dut2_vxlans} | ${dut1_route_subnet} |
1807 | | ... | ${dut1_route_mask} | ${dut2_route_subnet} | ${dut2_route_mask}
1808 | | ...
1809 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1810 | | ... | /var/run/vpp/sock-1-${dut1_bd_id1}
1811 | | ... | /var/run/vpp/sock-1-${dut1_bd_id2}
1812 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} |
1813 | | ... | ${dut1_address} | ${dut1_address_subnet}
1814 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} |
1815 | | ... | ${dut2_address} | ${dut2_address_subnet}
1816 | | ${dut1_bd_id1}= | Set Variable | 1
1817 | | ${dut1_bd_id2}= | Set Variable | 2
1818 | | ${dut2_bd_id1}= | Set Variable | 1
1819 | | :FOR | ${vxlan} | IN | @{dut1_vxlans}
1820 | | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | ${vxlan.vni}
1821 | | | ... | ${dut1_address} | ${vxlan.vtep}
1822 | | | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${dut1_bd_id1}
1823 | | :FOR | ${vxlan} | IN | @{dut2_vxlans}
1824 | | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | ${vxlan.vni}
1825 | | | ... | ${dut2_address} | ${vxlan.vtep}
1826 | | | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${dut2_bd_id1}
1827 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1828 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1829 | | Add arp on dut | ${dut1} | ${dut1_if1} | ${dut1_gw} | ${tg_if1_mac}
1830 | | Add arp on dut | ${dut2} | ${dut2_if2} | ${dut2_gw} | ${tg_if2_mac}
1831 | | Vpp Route Add | ${dut1} | ${dut1_route_subnet} | ${dut1_route_mask}
1832 | | ... | gateway=${dut1_gw} | interface=${dut1_if1}
1833 | | Vpp Route Add | ${dut2} | ${dut2_route_subnet} | ${dut2_route_mask}
1834 | | ... | gateway=${dut2_gw} | interface=${dut2_if2}
1835 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${dut1_bd_id2}
1836 | | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${dut2_bd_id1}
1837 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${dut1_bd_id1}
1838 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${dut1_bd_id2}
1839
1840 | Initialize L2 bridge domains with VLAN dot1q sub-interfaces in circular topology
1841 | | [Documentation]
1842 | | ... | Setup L2 bridge domain topology with learning enabled with VLAN by
1843 | | ... | connecting physical and vlan interfaces on each DUT. In case of 3-node
1844 | | ... | topology create VLAN sub-interfaces between DUTs. In case of 2-node
1845 | | ... | topology create VLAN sub-interface on dut1-if2 interface. All
1846 | | ... | interfaces are brought up.
1847 | | ...
1848 | | ... | *Arguments:*
1849 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1850 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1851 | | ... | - subid - ID of the sub-interface to be created. Type: string
1852 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1853 | | ...
1854 | | ... | _NOTE:_ This KW uses following test case variables:
1855 | | ... | - dut1 - DUT1 node.
1856 | | ... | - dut2 - DUT2 node.
1857 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
1858 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
1859 | | ...
1860 | | ... | *Example:*
1861 | | ...
1862 | | ... | \| Initialize L2 bridge domains with VLAN dot1q sub-interfaces
1863 | | ... | in a 3-node circular topology \| 1 \| 2 \| 10 \| pop-1 \|
1864 | | ...
1865 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
1866 | | ...
1867 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
1868 | | ... | Variable Should Exist | ${dut2}
1869 | | ...
1870 | | Set interfaces in path up
1871 | | ...
1872 | | Run Keyword If | '${dut2_status}' == 'PASS'
1873 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
1874 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
1875 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
1876 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
1877 | | Run Keyword If | '${dut2_status}' == 'PASS'
1878 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
1879 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
1880 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
1881 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
1882 | | ...
1883 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1884 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id1}
1885 | | Run Keyword If | '${dut2_status}' == 'PASS'
1886 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
1887 | | ... | ${bd_id2}
1888 | | Run Keyword If | '${dut2_status}' == 'PASS'
1889 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2}
1890 | | ... | ${bd_id2}
1891
1892 | Initialize L2 bridge domains with Vhost-User and VLAN in circular topology
1893 | | [Documentation]
1894 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
1895 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1896 | | ... | with physical inteface. In case of 3-node topology create VLAN
1897 | | ... | sub-interfaces between DUTs. In case of 2-node topology create VLAN
1898 | | ... | sub-interface on dut1-if2 interface. All interfaces are brought up.
1899 | | ...
1900 | | ... | *Arguments:*
1901 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1902 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1903 | | ... | - subid - ID of the sub-interface to be created. Type: string
1904 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1905 | | ...
1906 | | ... | *Example:*
1907 | | ...
1908 | | ... | \| L2 bridge domains with Vhost-User and VLAN initialized in circular\
1909 | | ... | topology \| 1 \| 2 \| 10 \| pop-1 \|
1910 | | ...
1911 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
1912 | | ...
1913 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
1914 | | ... | Variable Should Exist | ${dut2}
1915 | | ...
1916 | | Set interfaces in path up
1917 | | ...
1918 | | Run Keyword If | '${dut2_status}' == 'PASS'
1919 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
1920 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
1921 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
1922 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
1923 | | Run Keyword If | '${dut2_status}' == 'PASS'
1924 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
1925 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
1926 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
1927 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
1928 | | ...
1929 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1930 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1931 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1932 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1933 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1934 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
1935 | | Run Keyword If | '${dut2_status}' == 'PASS'
1936 | | ... | Configure vhost interfaces for L2BD forwarding | ${dut2}
1937 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1938 | | Run Keyword If | '${dut2_status}' == 'PASS'
1939 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
1940 | | ... | ${bd_id1}
1941 | | Run Keyword If | '${dut2_status}' == 'PASS'
1942 | | ... | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
1943 | | Run Keyword If | '${dut2_status}' == 'PASS'
1944 | | ... | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
1945 | | Run Keyword If | '${dut2_status}' == 'PASS'
1946 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1947
1948 | Initialize L2 bridge domains with Vhost-User and VLAN with DPDK link bonding in a 3-node circular topology
1949 | | [Documentation]
1950 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Setup VLAN
1951 | | ... | on BondEthernet interfaces between DUTs. Add one Vhost-User interface
1952 | | ... | into L2 bridge domains with learning enabled with physical interface
1953 | | ... | towards TG and other Vhost-User interface into L2 bridge domains with
1954 | | ... | learning enabled with VLAN sub-interface. All interfaces are brought
1955 | | ... | up.
1956 | | ...
1957 | | ... | *Arguments:*
1958 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1959 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1960 | | ... | - subid - ID of the sub-interface to be created. Type: string
1961 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1962 | | ...
1963 | | ... | *Example:*
1964 | | ...
1965 | | ... | \| Initialize L2 bridge domains with Vhost-User and VLAN with DPDK\
1966 | | ... | link bonding in a 3-node circular topology \| 1 \| 2 \| /tmp/sock1 \
1967 | | ... | \| /tmp/sock2 \| 10 \| pop-1 \|
1968 | | ...
1969 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
1970 | | ...
1971 | | Set interfaces in path up
1972 | | Add DPDK bonded ethernet interfaces to topology file in 3-node single link topology
1973 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
1974 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
1975 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
1976 | | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1}
1977 | | Initialize VLAN dot1q sub-interfaces in circular topology
1978 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
1979 | | ... | ${subid}
1980 | | Configure L2 tag rewrite method on interfaces
1981 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1982 | | ... | ${tag_rewrite}
1983 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1984 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1985 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1986 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1987 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1988 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
1989 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1990 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1991 | | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id1}
1992 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
1993 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
1994 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1995
1996 | Initialize L2 bridge domains with Vhost-User and VLAN with VPP link bonding in a 3-node circular topology
1997 | | [Documentation]
1998 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Create one
1999 | | ... | link bonding (BondEthernet) interface on both VPP nodes. Enslave one
2000 | | ... | physical interface towards next DUT by BondEthernet interface. Setup
2001 | | ... | VLAN on BondEthernet interfaces between DUTs. Add one Vhost-User
2002 | | ... | interface into L2 bridge domains with learning enabled with physical
2003 | | ... | interface towards TG and other Vhost-User interface into L2 bridge
2004 | | ... | domains with learning enabled with VLAN sub-interface. All interfaces
2005 | | ... | are brought up.
2006 | | ...
2007 | | ... | *Arguments:*
2008 | | ... | - bd_id1 - Bridge domain ID. Type: integer
2009 | | ... | - bd_id2 - Bridge domain ID. Type: integer
2010 | | ... | - subid - ID of the sub-interface to be created. Type: string
2011 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
2012 | | ... | - bond_mode - Link bonding mode. Type: string
2013 | | ... | - lb_mode - Load balance mode. Type: string
2014 | | ...
2015 | | ... | *Example:*
2016 | | ...
2017 | | ... | \| Initialize L2 bridge domains with Vhost-User and VLAN with VPP\
2018 | | ... | link bonding in a 3-node circular topology \| 1 \| 2 \
2019 | | ... | \| 10 \| pop-1 \| xor \| l34 \|
2020 | | ...
2021 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
2022 | | ... | ${bond_mode} | ${lb_mode}
2023 | | ...
2024 | | Set interfaces in path up
2025 | | ${dut1_eth_bond_if1}= | VPP Create Bond Interface | ${dut1} | ${bond_mode}
2026 | | ... | ${lb_mode}
2027 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
2028 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
2029 | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
2030 | | ... | Variable Should Exist | ${dut1_if2}
2031 | | Run Keyword If | '${if2_status}' == 'PASS'
2032 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2}
2033 | | ... | ${dut1_eth_bond_if1}
2034 | | ... | ELSE
2035 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_1}
2036 | | ... | ${dut1_eth_bond_if1}
2037 | | Run Keyword Unless | '${if2_status}' == 'PASS'
2038 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_2}
2039 | | ... | ${dut1_eth_bond_if1}
2040 | | ${dut2_eth_bond_if1}= | VPP Create Bond Interface | ${dut2} | ${bond_mode}
2041 | | ... | ${lb_mode}
2042 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
2043 | | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1}
2044 | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
2045 | | ... | Variable Should Exist | ${dut2_if1}
2046 | | Run Keyword If | '${if1_status}' == 'PASS'
2047 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1}
2048 | | ... | ${dut2_eth_bond_if1}
2049 | | ... | ELSE
2050 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_1}
2051 | | ... | ${dut2_eth_bond_if1}
2052 | | Run Keyword Unless | '${if2_status}' == 'PASS'
2053 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_2}
2054 | | ... | ${dut2_eth_bond_if1}
2055 | | VPP Show Bond Data On All Nodes | ${nodes} | details=${TRUE}
2056 | | Initialize VLAN dot1q sub-interfaces in circular topology
2057 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
2058 | | ... | ${subid}
2059 | | Configure L2 tag rewrite method on interfaces
2060 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
2061 | | ... | ${tag_rewrite}
2062 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
2063 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
2064 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
2065 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
2066 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
2067 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
2068 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
2069 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
2070 | | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id1}
2071 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
2072 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
2073 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
2074
2075 | Add PCI devices to all DUTs
2076 | | [Documentation]
2077 | | ... | Add PCI devices to VPP configuration file.
2078 | | ...
2079 | | ${duts}= | Get Matches | ${nodes} | DUT*
2080 | | :FOR | ${dut} | IN | @{duts}
2081 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
2082 | | | ... | Variable Should Exist | ${${dut}_if1}
2083 | | | ${if1_pci}= | Run Keyword If | '${if1_status}' == 'PASS'
2084 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1}
2085 | | | ${if1_1_pci}= | Run Keyword Unless | '${if1_status}' == 'PASS'
2086 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1_1}
2087 | | | ${if1_2_pci}= | Run Keyword Unless | '${if1_status}' == 'PASS'
2088 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1_2}
2089 | | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
2090 | | | ... | Variable Should Exist | ${${dut}_if2}
2091 | | | ${if2_pci}= | Run Keyword If | '${if2_status}' == 'PASS'
2092 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2}
2093 | | | ${if2_1_pci}= | Run Keyword Unless | '${if2_status}' == 'PASS'
2094 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2_1}
2095 | | | ${if2_2_pci}= | Run Keyword Unless | '${if2_status}' == 'PASS'
2096 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if2_2}
2097 | | | @{pci_devs}= | Run Keyword If | '${if1_status}' == 'PASS'
2098 | | | ... | Create List | ${if1_pci}
2099 | | | ... | ELSE
2100 | | | ... | Create List | ${if1_1_pci} | ${if1_2_pci}
2101 | | | Run Keyword If | '${if2_status}' == 'PASS'
2102 | | | ... | Append To List | ${pci_devs} | ${if2_pci}
2103 | | | ... | ELSE
2104 | | | ... | Append To List | ${pci_devs} | ${if2_1_pci} | ${if2_2_pci}
2105 | | | Run keyword | ${dut}.Add DPDK Dev | @{pci_devs}
2106 | | | Run Keyword If | '${if1_status}' == 'PASS'
2107 | | | ... | Set Test Variable | ${${dut}_if1_pci} | ${if1_pci}
2108 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
2109 | | | ... | Set Test Variable | ${${dut}_if1_1_pci} | ${if1_1_pci}
2110 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
2111 | | | ... | Set Test Variable | ${${dut}_if1_2_pci} | ${if1_2_pci}
2112 | | | Run Keyword If | '${if2_status}' == 'PASS'
2113 | | | ... | Set Test Variable | ${${dut}_if2_pci} | ${if2_pci}
2114 | | | Run Keyword Unless | '${if2_status}' == 'PASS'
2115 | | | ... | Set Test Variable | ${${dut}_if2_1_pci} | ${if2_1_pci}
2116 | | | Run Keyword Unless | '${if2_status}' == 'PASS'
2117 | | | ... | Set Test Variable | ${${dut}_if2_2_pci} | ${if2_2_pci}
2118
2119 | Add single PCI device to all DUTs
2120 | | [Documentation]
2121 | | ... | Add single (first) PCI device on DUT1 and single (last) PCI device on
2122 | | ... | DUT2 to VPP configuration file.
2123 | | ...
2124 | | ${duts}= | Get Matches | ${nodes} | DUT*
2125 | | :FOR | ${dut} | IN | @{duts}
2126 | | | ${if1_pci}= |  Get Interface PCI Addr | ${nodes['${dut}']} | ${${dut}_if1}
2127 | | | Run keyword | ${dut}.Add DPDK Dev | ${if1_pci}
2128 | | | Set Test Variable | ${${dut}_if1_pci} | ${if1_pci}
2129
2130 | Add VLAN strip offload switch off between DUTs in 3-node single link topology
2131 | | [Documentation]
2132 | | ... | Add VLAN Strip Offload switch off on PCI devices between DUTs to VPP
2133 | | ... | configuration file.
2134 | | ...
2135 | | Run keyword | DUT1.Add DPDK Dev Parameter | ${dut1_if2_pci}
2136 | | ... | vlan-strip-offload | off
2137 | | Run keyword | DUT2.Add DPDK Dev Parameter | ${dut2_if1_pci}
2138 | | ... | vlan-strip-offload | off
2139
2140 | Add VLAN strip offload switch off between DUTs in 3-node double link topology
2141 | | [Documentation]
2142 | | ... | Add VLAN Strip Offload switch off on PCI devices between DUTs to VPP
2143 | | ... | configuration file.
2144 | | ...
2145 | | Run keyword | DUT1.Add DPDK Dev Parameter | ${dut1_if2_1_pci}
2146 | | ... | vlan-strip-offload | off
2147 | | Run keyword | DUT1.Add DPDK Dev Parameter | ${dut1_if2_2_pci}
2148 | | ... | vlan-strip-offload | off
2149 | | Run keyword | DUT2.Add DPDK Dev Parameter | ${dut2_if1_1_pci}
2150 | | ... | vlan-strip-offload | off
2151 | | Run keyword | DUT2.Add DPDK Dev Parameter | ${dut2_if1_2_pci}
2152 | | ... | vlan-strip-offload | off
2153
2154 | Add DPDK bonded ethernet interfaces to DUTs in 3-node single link topology
2155 | | [Documentation]
2156 | | ... | Add DPDK bonded Ethernet interfaces with mode XOR and transmit policy
2157 | | ... | l34 to VPP configuration file.
2158 | | ...
2159 | | Run keyword | DUT1.Add DPDK Eth Bond Dev | 0 | 2 | l34 | ${dut1_if2_pci}
2160 | | Run keyword | DUT2.Add DPDK Eth Bond Dev | 0 | 2 | l34 | ${dut2_if1_pci}
2161
2162 | Add DPDK bonded ethernet interfaces to topology file in 3-node single link topology
2163 | | Add Eth Interface | ${dut1} | ${dut1_eth_bond_if1_name} | ifc_pfx=eth_bond
2164 | | Add Eth Interface | ${dut2} | ${dut2_eth_bond_if1_name} | ifc_pfx=eth_bond
2165
2166 | Configure chains of NFs connected via vhost-user
2167 | | [Documentation]
2168 | | ... | Start 1..N chains of 1..N QEMU guests (VNFs) with two vhost-user\
2169 | | ... | interfaces and interconnecting NF.
2170 | | ...
2171 | | ... | *Arguments:*
2172 | | ... | - nf_chains - Number of chains of NFs. Type: integer
2173 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
2174 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
2175 | | ... | in the test. Type: boolean
2176 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer
2177 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2178 | | ... | Type: boolean
2179 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
2180 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
2181 | | ... | - vnf - Network function as a payload. Type: string
2182 | | ...
2183 | | ... | *Example:*
2184 | | ...
2185 | | ... | \| Configure chains of VMs connected via vhost-user
2186 | | ... | \| 1 \| 1 \| False \| 1024 \| False \| False \| vpp
2187 | | ...
2188 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${jumbo}=${False}
2189 | | ... | ${perf_qemu_qsz}=${1024} | ${use_tuned_cfs}=${False}
2190 | | ... | ${auto_scale}=${True} | ${vnf}=vpp
2191 | | ...
2192 | | Import Library | resources.libraries.python.QemuManager | ${nodes}
2193 | | ... | WITH NAME | vnf_manager
2194 | | Run Keyword | vnf_manager.Construct VMs on all nodes
2195 | | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | jumbo=${jumbo}
2196 | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs}
2197 | | ... | auto_scale=${auto_scale} | vnf=${vnf}
2198 | | ... | tg_if1_mac=${tg_if1_mac} | tg_if2_mac=${tg_if2_mac}
2199 | | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr}
2200 | | ... | rxq_count_int=${rxq_count_int}
2201 | | Run Keyword | vnf_manager.Start All VMs | pinning=${True}
2202 | | All VPP Interfaces Ready Wait | ${nodes} | retries=${300}
2203 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual
2204
2205 | Configure chains of NFs connected via vhost-user on single node
2206 | | [Documentation]
2207 | | ... | Start 1..N chains of 1..N QEMU guests (VNFs) with two vhost-user\
2208 | | ... | interfaces and interconnecting NF on single DUT node.
2209 | | ...
2210 | | ... | *Arguments:*
2211 | | ... | - node - DUT node. Type: dictionary
2212 | | ... | - nf_chains - Number of chains of NFs. Type: integer
2213 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
2214 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
2215 | | ... | in the test. Type: boolean
2216 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer
2217 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
2218 | | ... | Type: boolean
2219 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
2220 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
2221 | | ... | - vnf - Network function as a payload. Type: string
2222 | | ...
2223 | | ... | *Example:*
2224 | | ...
2225 | | ... | \| Configure chains of NFs connected via vhost-user on single node
2226 | | ... | \| DUT1 \| 1 \| 1 \| False \| 1024 \| False \| False \| vpp
2227 | | ...
2228 | | [Arguments] | ${node} | ${nf_chains}=${1} | ${nf_nodes}=${1}
2229 | | ... | ${jumbo}=${False} | ${perf_qemu_qsz}=${1024}
2230 | | ... | ${use_tuned_cfs}=${False} | ${auto_scale}=${True} | ${vnf}=vpp
2231 | | ...
2232 | | Import Library | resources.libraries.python.QemuManager | ${nodes}
2233 | | ... | WITH NAME | vnf_manager
2234 | | Run Keyword | vnf_manager.Initialize
2235 | | Run Keyword | vnf_manager.Construct VMs on node
2236 | | ... | node=${node}
2237 | | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | jumbo=${jumbo}
2238 | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs}
2239 | | ... | auto_scale=${auto_scale} | vnf=${vnf}
2240 | | ... | tg_if1_mac=${tg_if1_mac} | tg_if2_mac=${tg_if2_mac}
2241 | | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr}
2242 | | ... | rxq_count_int=${rxq_count_int}
2243 | | Run Keyword | vnf_manager.Start All VMs | pinning=${True}
2244 | | All VPP Interfaces Ready Wait | ${nodes} | retries=${300}
2245 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual
2246
2247 | Initialize LISP IPv4 forwarding in 3-node circular topology
2248 | | [Documentation] | Custom setup of IPv4 addresses on all DUT nodes and TG \
2249 | | ... | Don`t set route.
2250 | | ...
2251 | | ... | *Arguments:*
2252 | | ... | - dut1_dut2_address - Ip address from DUT1 to DUT2. Type: string
2253 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
2254 | | ... | - dut2_dut1_address - Ip address from DUT2 to DUT1. Type: string
2255 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
2256 | | ... | - duts_prefix - ip prefix. Type: int
2257 | | ...
2258 | | ... | *Return:*
2259 | | ... | - No value returned
2260 | | ...
2261 | | ... | *Example:*
2262 | | ... | \| Initialize LISP IPv4 forwarding in 3-node circular topology \
2263 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
2264 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
2265 | | ...
2266 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
2267 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${duts_prefix}
2268 | | ...
2269 | | Set interfaces in path up
2270 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2271 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2272 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2273 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2274 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
2275 | | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_dut1_address}
2276 | | ... | ${dut2_if1_mac}
2277 | | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_dut2_address}
2278 | | ... | ${dut1_if2_mac}
2279 | | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
2280 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
2281 | | ... | ${dut1_tg_address} | ${duts_prefix}
2282 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
2283 | | ... | ${dut1_dut2_address} | ${duts_prefix}
2284 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
2285 | | ... | ${dut2_dut1_address} | ${duts_prefix}
2286 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2}
2287 | | ... | ${dut2_tg_address} | ${duts_prefix}
2288
2289 | Initialize LISP GPE IPv4 over IPsec in 3-node circular topology
2290 | | [Documentation] | Setup Lisp GPE IPv4 forwarding over IPsec.
2291 | | ...
2292 | | ... | *Arguments:*
2293 | | ... | - encr_alg - Encryption algorithm. Type: string
2294 | | ... | - auth_alg - Authentication algorithm. Type: string
2295 | | ...
2296 | | ... | *Return:*
2297 | | ... | - No value returned
2298 | | ...
2299 | | ... | *Example:*
2300 | | ... | \| Initialize LISP GPE IPv4 over IPsec in 3-node circular topology\
2301 | | ... | \| ${encr_alg} \| ${auth_alg}
2302 | | ...
2303 | | [Arguments] | ${encr_alg} | ${auth_alg}
2304 | | ...
2305 | | Generate keys for IPSec | ${encr_alg} | ${auth_alg}
2306 | | Initialize LISP IPv4 forwarding in 3-node circular topology
2307 | | ... | ${dut1_to_dut2_ip4} | ${dut1_to_tg_ip4} | ${dut2_to_dut1_ip4}
2308 | | ... | ${dut2_to_tg_ip4} | ${prefix4}
2309 | | Configure LISP GPE topology in 3-node circular topology
2310 | | ... | ${dut1} | ${dut1_if2} | ${NONE}
2311 | | ... | ${dut2} | ${dut2_if1} | ${NONE}
2312 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
2313 | | ... | ${dut1_ip4_static_adjacency} | ${dut2_ip4_static_adjacency}
2314 | | Configure manual keyed connection for IPSec
2315 | | ... | ${dut1} | ${dut1_if2} | ${encr_alg} | ${encr_key}
2316 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
2317 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
2318 | | Configure manual keyed connection for IPSec
2319 | | ... | ${dut2} | ${dut2_if1} | ${encr_alg} | ${encr_key}
2320 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
2321 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
2322
2323 | Initialize LISP IPv6 forwarding in 3-node circular topology
2324 | | [Documentation] | Custom setup of IPv6 topology on all DUT nodes \
2325 | | ... | Don`t set route.
2326 | | ...
2327 | | ... | *Arguments:*
2328 | | ... | - dut1_dut2_address - Ip address from DUT1 to DUT2. Type: string
2329 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
2330 | | ... | - dut2_dut1_address - Ip address from DUT2 to DUT1. Type: string
2331 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
2332 | | ... | - duts_prefix - ip prefix. Type: int
2333 | | ...
2334 | | ... | *Return:*
2335 | | ... | - No value returned
2336 | | ...
2337 | | ... | *Example:*
2338 | | ... | \| Initialize LISP IPv6 forwarding in 3-node circular topology \
2339 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
2340 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
2341 | | ...
2342 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
2343 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${prefix}
2344 | | ...
2345 | | Set interfaces in path up
2346 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2347 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2348 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2349 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2350 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_tg_address}
2351 | | ... | ${prefix}
2352 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_dut2_address}
2353 | | ... | ${prefix}
2354 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_dut1_address}
2355 | | ... | ${prefix}
2356 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_tg_address}
2357 | | ... | ${prefix}
2358 | | Suppress ICMPv6 router advertisement message | ${nodes}
2359 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
2360 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
2361 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_dut1_address}
2362 | | ... | ${dut2_if1_mac}
2363 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_dut2_address}
2364 | | ... | ${dut1_if2_mac}
2365
2366 | Initialize LISP IPv4 over IPv6 forwarding in 3-node circular topology
2367 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
2368 | | ... | Don`t set route.
2369 | | ...
2370 | | ... | *Arguments:*
2371 | | ... | - dut1_dut2_ip6_address - IPv6 address from DUT1 to DUT2.
2372 | | ... | Type: string
2373 | | ... | - dut1_tg_ip4_address - IPv4 address from DUT1 to tg. Type: string
2374 | | ... | - dut2_dut1_ip6_address - IPv6 address from DUT2 to DUT1.
2375 | | ... | Type: string
2376 | | ... | - dut1_tg_ip4_address - IPv4 address from DUT1 to tg. Type: string
2377 | | ... | - prefix4 - IPv4 prefix. Type: int
2378 | | ... | - prefix6 - IPv6 prefix. Type: int
2379 | | ...
2380 | | ... | *Return:*
2381 | | ... | - No value returned
2382 | | ...
2383 | | ... | *Example:*
2384 | | ... | \| Lisp IPv4 over IPv6 forwarding initialized in a 3-node circular \
2385 | | ... | topology \| ${dut1_dut2_ip6_address} \| ${dut1_tg_ip4_address} \
2386 | | ... | \| ${dut2_dut1_ip6_address} \| ${dut2_tg_ip4_address} \
2387 | | ... | \| ${prefix4} \| ${prefix6} \|
2388 | | ...
2389 | | [Arguments] | ${dut1_dut2_ip6_address} | ${dut1_tg_ip4_address}
2390 | | ... | ${dut2_dut1_ip6_address} | ${dut2_tg_ip4_address}
2391 | | ... | ${prefix4} | ${prefix6}
2392 | | ...
2393 | | Set interfaces in path up
2394 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2395 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2396 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2397 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2398 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
2399 | | ... | ${dut1_tg_ip4_address} | ${prefix4}
2400 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_dut2_ip6_address}
2401 | | ... | ${prefix6}
2402 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_dut1_ip6_address}
2403 | | ... | ${prefix6}
2404 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2}
2405 | | ... | ${dut2_tg_ip4_address} | ${prefix4}
2406 | | Suppress ICMPv6 router advertisement message | ${nodes}
2407 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
2408 | | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
2409 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip6_address}
2410 | | ... | ${dut2_if1_mac}
2411 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip6_address}
2412 | | ... | ${dut1_if2_mac}
2413
2414 | Initialize LISP IPv6 over IPv4 forwarding in 3-node circular topology
2415 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
2416 | | ... | Don`t set route.
2417 | | ...
2418 | | ... | *Arguments:*
2419 | | ... | - dut1_dut2_ip4_address - IPv4 address from DUT1 to DUT2.
2420 | | ... | Type: string
2421 | | ... | - dut1_tg_ip6_address - IPv6 address from DUT1 to tg. Type: string
2422 | | ... | - dut2_dut1_ip4_address - IPv4 address from DUT2 to DUT1.
2423 | | ... | Type: string
2424 | | ... | - dut1_tg_ip6_address - IPv6 address from DUT1 to tg. Type: string
2425 | | ... | - prefix4 - IPv4 prefix. Type: int
2426 | | ... | - prefix6 - IPv6 prefix. Type: int
2427 | | ...
2428 | | ... | *Return:*
2429 | | ... | - No value returned
2430 | | ...
2431 | | ... | *Example:*
2432 | | ... | \| Lisp IPv6 over IPv4 forwarding initialized in a 3-node circular \
2433 | | ... | topology \| ${dut1_dut2_ip4_address} \| ${dut1_tg_ip6_address} \
2434 | | ... | \| ${dut2_dut1_ip4_address} \| ${dut2_tg_ip6_address} \
2435 | | ... | \| ${prefix6} \| ${prefix4} \|
2436 | | ...
2437 | | [Arguments] | ${dut1_dut2_ip4_address} | ${dut1_tg_ip6_address}
2438 | | ... | ${dut2_dut1_ip4_address} | ${dut2_tg_ip6_address}
2439 | | ... | ${prefix6} | ${prefix4}
2440 | | ...
2441 | | Set interfaces in path up
2442 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2443 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2444 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2445 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2446 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_tg_ip6_address}
2447 | | ... | ${prefix6}
2448 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
2449 | | ... | ${dut1_dut2_ip4_address} | ${prefix4}
2450 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
2451 | | ... | ${dut2_dut1_ip4_address} | ${prefix4}
2452 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_tg_ip6_address}
2453 | | ... | ${prefix6}
2454 | | Suppress ICMPv6 router advertisement message | ${nodes}
2455 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
2456 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
2457 | | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip4_address}
2458 | | ... | ${dut2_if1_mac}
2459 | | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip4_address}
2460 | | ... | ${dut1_if2_mac}
2461
2462 | Initialize NAT44 in circular topology
2463 | | [Documentation] | Initialization of 2-node / 3-node topology with NAT44
2464 | | ... | between DUTs:
2465 | | ... | - set interfaces up
2466 | | ... | - set IP addresses
2467 | | ... | - set ARP
2468 | | ... | - create routes
2469 | | ... | - set NAT44 - only on DUT1
2470 | | ...
2471 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
2472 | | ... | Variable Should Exist | ${dut2}
2473 | | ...
2474 | | Set interfaces in path up
2475 | | ...
2476 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 10.0.0.1 | 20
2477 | | Run Keyword If | '${dut2_status}' == 'PASS'
2478 | | ... | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 11.0.0.1 | 20
2479 | | Run Keyword If | '${dut2_status}' == 'PASS'
2480 | | ... | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 11.0.0.2 | 20
2481 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
2482 | | ... | Set Variable | ${dut2}
2483 | | ... | ELSE | Set Variable | ${dut1}
2484 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
2485 | | ... | Set Variable | ${dut2_if2}
2486 | | ... | ELSE | Set Variable | ${dut1_if2}
2487 | | Configure IP addresses on interfaces | ${dut} | ${dut_if2} | 12.0.0.1 | 20
2488 | | ...
2489 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2490 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2491 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
2492 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
2493 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
2494 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
2495 | | ...
2496 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.0.0.2 | ${tg_if1_mac}
2497 | | Run Keyword If | '${dut2_status}' == 'PASS'
2498 | | ... | Add arp on dut | ${dut1} | ${dut1_if2} | 11.0.0.2 | ${dut2_if1_mac}
2499 | | Run Keyword If | '${dut2_status}' == 'PASS'
2500 | | ... | Add arp on dut | ${dut2} | ${dut2_if1} | 11.0.0.1 | ${dut1_if2_mac}
2501 | | Add arp on dut | ${dut} | ${dut_if2} | 12.0.0.2 | ${tg_if2_mac}
2502 | | ...
2503 | | Vpp Route Add | ${dut1} | 20.0.0.0 | 18 | gateway=10.0.0.2
2504 | | ... | interface=${dut1_if1}
2505 | | Run Keyword If | '${dut2_status}' == 'PASS'
2506 | | ... | Vpp Route Add | ${dut1} | 12.0.0.2 | 32 | gateway=11.0.0.2
2507 | | ... | interface=${dut1_if2}
2508 | | Run Keyword If | '${dut2_status}' == 'PASS'
2509 | | ... | Vpp Route Add | ${dut2} | 12.0.0.0 | 24 | gateway=12.0.0.2
2510 | | ... | interface=${dut2_if2}
2511 | | Run Keyword If | '${dut2_status}' == 'PASS'
2512 | | ... | Vpp Route Add | ${dut2} | 200.0.0.0 | 30 | gateway=11.0.0.1
2513 | | ... | interface=${dut2_if1}
2514 | | ...
2515 | | Configure inside and outside interfaces
2516 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if2}
2517 | | Configure deterministic mode for NAT44
2518 | | ... | ${dut1} | 20.0.0.0 | 18 | 200.0.0.0 | 30
2519
2520 | Initialize L2 xconnect with memif pairs on DUT node
2521 | | [Documentation]
2522 | | ... | Create pairs of Memif interfaces on DUT node. Cross connect each Memif
2523 | | ... | interface with one physical interface or virtual interface to create
2524 | | ... | a chain accross DUT node.
2525 | | ...
2526 | | ... | *Arguments:*
2527 | | ... | - dut - DUT node. Type: dictionary
2528 | | ... | - count - Number of memif pairs (containers). Type: integer
2529 | | ...
2530 | | ... | *Note:*
2531 | | ... | Socket paths for Memif are defined in following format:
2532 | | ... | - /tmp/memif-\${dut}_CNF\${number}-\${sid}
2533 | | ...
2534 | | ... | KW uses test variable \${rxq_count_int} set by KW Add worker threads
2535 | | ... | and rxqueues to all DUTs
2536 | | ...
2537 | | ... | *Example:*
2538 | | ...
2539 | | ... | \| Initialize L2 xconnect with memif pairs on DUT node \| ${dut} \
2540 | | ... | \| ${1} \|
2541 | | ...
2542 | | [Arguments] | ${dut} | ${count}
2543 | | ...
2544 | | :FOR | ${number} | IN RANGE | 1 | ${count}+1
2545 | | | ${sock1}= | Set Variable | memif-${dut}_CNF
2546 | | | ${sock2}= | Set Variable | memif-${dut}_CNF
2547 | | | ${prev_index}= | Evaluate | ${number}-1
2548 | | | Set up memif interfaces on DUT node | ${nodes['${dut}']}
2549 | | | ... | ${sock1} | ${sock2} | ${number} | ${dut}-memif-${number}-if1
2550 | | | ... | ${dut}-memif-${number}-if2 | ${rxq_count_int} | ${rxq_count_int}
2551 | | | ${xconnect_if1}= | Set Variable If | ${number}==1 | ${${dut}_if1}
2552 | | | ... | ${${dut}-memif-${prev_index}-if2}
2553 | | | Configure L2XC | ${nodes['${dut}']} | ${xconnect_if1}
2554 | | | ... | ${${dut}-memif-${number}-if1}
2555 | | | Run Keyword If | ${number}==${count} | Configure L2XC
2556 | | | ... | ${nodes['${dut}']} | ${${dut}-memif-${number}-if2} | ${${dut}_if2}
2557
2558 | Initialize L2 xconnect with memif pairs
2559 | | [Documentation]
2560 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Cross
2561 | | ... | connect each Memif interface with one physical interface or virtual
2562 | | ... | interface to create a chain accross DUT node.
2563 | | ...
2564 | | ... | *Arguments:*
2565 | | ... | - count - Number of memif pairs (containers). Type: integer
2566 | | ...
2567 | | ... | *Example:*
2568 | | ...
2569 | | ... | \| Initialize L2 xconnect with memif pairs \| ${1} \|
2570 | | ...
2571 | | [Arguments] | ${count}=${1}
2572 | | ...
2573 | | ${duts}= | Get Matches | ${nodes} | DUT*
2574 | | :FOR | ${dut} | IN | @{duts}
2575 | | | Initialize L2 xconnect with memif pairs on DUT node | ${dut} | ${count}
2576 | | Set interfaces in path up
2577 | | Show Memif on all DUTs | ${nodes}
2578 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
2579
2580 | Initialize L2 Bridge Domain with memif pairs on DUT node
2581 | | [Documentation]
2582 | | ... | Create pairs of Memif interfaces on DUT node. Put each Memif interface
2583 | | ... | to separate L2 bridge domain with one physical or memif interface
2584 | | ... | to create a chain accross DUT node.
2585 | | ...
2586 | | ... | *Arguments:*
2587 | | ... | - dut - DUT node. Type: dictionary
2588 | | ... | - nf_chain - NF chain. Type: integer
2589 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
2590 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
2591 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
2592 | | ...
2593 | | ... | *Note:*
2594 | | ... | Socket paths for Memif are defined in following format:
2595 | | ... | - /tmp/memif-\${dut}_CNF\${nf_id}-\${sid}
2596 | | ...
2597 | | ... | *Example:*
2598 | | ...
2599 | | ... | \| Initialize L2 Bridge Domain with memif pairs on DUT node \
2600 | | ... | \| ${dut} \| 1 \| 1 \|
2601 | | ...
2602 | | [Arguments] | ${dut} | ${nf_chain}=${1} | ${nf_nodes}=${1}
2603 | | ... | ${auto_scale}=${True}
2604 | | ...
2605 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
2606 | | ... | Set Variable | ${rxq_count_int}
2607 | | ... | ELSE | Set Variable | ${1}
2608 | | ${bd_id2}= | Evaluate | ${nf_nodes}+1
2609 | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1} | ${1}
2610 | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if2}
2611 | | ... | ${bd_id2}
2612 | | :FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes}+1
2613 | | | ${nf_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
2614 | | | ${sock1}= | Set Variable | memif-${dut}_CNF
2615 | | | ${sock2}= | Set Variable | memif-${dut}_CNF
2616 | | | Set up memif interfaces on DUT node | ${nodes['${dut}']}
2617 | | | ... | ${sock1} | ${sock2} | ${nf_id} | ${dut}-memif-${nf_id}-if1
2618 | | | ... | ${dut}-memif-${nf_id}-if2 | ${rxq} | ${rxq}
2619 | | | ${bd_id2}= | Evaluate | ${nf_node}+1
2620 | | | Add interface to bridge domain | ${nodes['${dut}']}
2621 | | | ... | ${${dut}-memif-${nf_id}-if1} | ${nf_node}
2622 | | | Add interface to bridge domain | ${nodes['${dut}']}
2623 | | | ... | ${${dut}-memif-${nf_id}-if2} | ${bd_id2}
2624
2625 | Initialize L2 Bridge Domain with memif pairs
2626 | | [Documentation]
2627 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
2628 | | ... | Memif interface to separate L2 bridge domain with one physical or
2629 | | ... | virtual interface to create a chain accross DUT node.
2630 | | ...
2631 | | ... | *Arguments:*
2632 | | ... | - nf_chain - NF chain. Type: integer
2633 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
2634 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
2635 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
2636 | | ...
2637 | | ... | *Example:*
2638 | | ...
2639 | | ... | \| Initialize L2 Bridge Domain with memif pairs \| 1 \| 1 \|
2640 | | ...
2641 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
2642 | | ...
2643 | | ${duts}= | Get Matches | ${nodes} | DUT*
2644 | | :FOR | ${dut} | IN | @{duts}
2645 | | | Initialize L2 Bridge Domain with memif pairs on DUT node | ${dut}
2646 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
2647 | | | ... | auto_scale=${auto_scale}
2648
2649 | Initialize L2 Bridge Domain for multiple chains with memif pairs
2650 | | [Documentation]
2651 | | ... | Create pairs of Memif interfaces for defined number of NF chains
2652 | | ... | with defined number of NF nodes on all defined VPP nodes. Add each
2653 | | ... | Memif interface into L2 bridge domains with learning enabled
2654 | | ... | with physical inteface or Memif interface of another NF.
2655 | | ...
2656 | | ... | *Arguments:*
2657 | | ... | - nf_chains - Number of chains of NFs. Type: integer
2658 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
2659 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
2660 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
2661 | | ...
2662 | | ... | *Example:*
2663 | | ...
2664 | | ... | \| Initialize L2 Bridge Domain for multiple chains with memif pairs \
2665 | | ... | \| 1 \| 1 \|
2666 | | ...
2667 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
2668 | | ...
2669 | | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
2670 | | | Initialize L2 Bridge Domain with memif pairs | nf_chain=${nf_chain}
2671 | | | ... | nf_nodes=${nf_nodes} | auto_scale=${auto_scale}
2672 | | Set interfaces in path up
2673 | | Show Memif on all DUTs | ${nodes}
2674 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
2675
2676 | Initialize L2 Bridge Domain for pipeline with memif pairs
2677 | | [Documentation]
2678 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
2679 | | ... | Memif interface to separate L2 bridge domain with one physical or
2680 | | ... | virtual interface to create a service pipeline on DUT node.
2681 | | ...
2682 | | ... | *Arguments:*
2683 | | ... | - nf_chain - NF pipe. Type: integer
2684 | | ... | - nf_nodes - Number of NFs nodes per pipeline. Type: integer
2685 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
2686 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
2687 | | ...
2688 | | ... | *Example:*
2689 | | ...
2690 | | ... | \| Initialize L2 Bridge Domain for pipeline with memif pairs \
2691 | | ... | \| 1 \| 1 \|
2692 | | ...
2693 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
2694 | | ...
2695 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
2696 | | ... | Set Variable | ${rxq_count_int}
2697 | | ... | ELSE | Set Variable | ${1}
2698 | | ${duts}= | Get Matches | ${nodes} | DUT*
2699 | | :FOR | ${dut} | IN | @{duts}
2700 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1} | ${1}
2701 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if2} | ${2}
2702 | | | ${nf_id_frst}= | Evaluate | (${nf_chain}-${1}) * ${nf_nodes} + ${1}
2703 | | | ${nf_id_last}= | Evaluate | (${nf_chain}-${1}) * ${nf_nodes} + ${nf_nodes}
2704 | | | ${sid_frst}= | Evaluate | ${nf_id_frst} * ${2} - ${1}
2705 | | | ${sid_last}= | Evaluate | ${nf_id_last} * ${2}
2706 | | | Set up single memif interface on DUT node | ${nodes['${dut}']}
2707 | | | ... | memif-${dut}_CNF | mid=${nf_id_frst} | sid=${sid_frst}
2708 | | | ... | memif_if=${dut}-memif-${nf_id_frst}-if1
2709 | | | ... | rxq=${rxq} | txq=${rxq}
2710 | | | Set up single memif interface on DUT node | ${nodes['${dut}']}
2711 | | | ... | memif-${dut}_CNF | mid=${nf_id_last} | sid=${sid_last}
2712 | | | ... | memif_if=${dut}-memif-${nf_id_last}-if2
2713 | | | ... | rxq=${rxq} | txq=${rxq}
2714 | | | Add interface to bridge domain | ${nodes['${dut}']}
2715 | | | ... | ${${dut}-memif-${nf_id_frst}-if1} | ${1}
2716 | | | Add interface to bridge domain | ${nodes['${dut}']}
2717 | | | ... | ${${dut}-memif-${nf_id_last}-if2} | ${2}
2718
2719 | Initialize L2 Bridge Domain for multiple pipelines with memif pairs
2720 | | [Documentation]
2721 | | ... | Create pairs of Memif interfaces for defined number of NF pipelines
2722 | | ... | with defined number of NF nodes on all defined VPP nodes. Add each
2723 | | ... | Memif interface into L2 bridge domains with learning enabled
2724 | | ... | with physical inteface or Memif interface of another NF.
2725 | | ...
2726 | | ... | *Arguments:*
2727 | | ... | - nf_chains - Number of pipelines of NFs. Type: integer
2728 | | ... | - nf_nodes - Number of NFs nodes per pipeline. Type: integer
2729 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
2730 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
2731 | | ...
2732 | | ... | *Example:*
2733 | | ...
2734 | | ... | \| Initialize L2 Bridge Domain for multiple pipelines with memif \
2735 | | ... | pairs \| 1 \| 1 \|
2736 | | ...
2737 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
2738 | | ...
2739 | | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
2740 | | | Initialize L2 Bridge Domain for pipeline with memif pairs
2741 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
2742 | | | ... | auto_scale=${auto_scale}
2743 | | Set interfaces in path up
2744 | | Show Memif on all DUTs | ${nodes}
2745 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
2746
2747 | Initialize L2 Bridge Domain with memif pairs and VLAN in circular topology
2748 | | [Documentation]
2749 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
2750 | | ... | Memif interface to separate L2 bridge domain with one physical or
2751 | | ... | virtual interface to create a chain accross DUT node. In case of
2752 | | ... | 3-node topology create VLAN sub-interfaces between DUTs. In case of
2753 | | ... | 2-node topology create VLAN sub-interface on dut1-if2 interface. All
2754 | | ... | interfaces are brought up.
2755 | | ...
2756 | | ... | *Arguments:*
2757 | | ... | - bd_id1 - Bridge domain ID. Type: integer
2758 | | ... | - bd_id2 - Bridge domain ID. Type: integer
2759 | | ... | - subid - ID of the sub-interface to be created. Type: string
2760 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
2761 | | ...
2762 | | ... | *Example:*
2763 | | ...
2764 | | ... | \| Initialize L2 Bridge Domain with memif pairs and VLAN in circular\
2765 | | ... | topology \| 1 \| 2 \| 10 \| pop-1 \|
2766 | | ...
2767 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
2768 | | ...
2769 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
2770 | | ... | Variable Should Exist | ${dut2}
2771 | | ...
2772 | | Set interfaces in path up
2773 | | ...
2774 | | Run Keyword If | '${dut2_status}' == 'PASS'
2775 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
2776 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
2777 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
2778 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
2779 | | Run Keyword If | '${dut2_status}' == 'PASS'
2780 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
2781 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
2782 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
2783 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
2784 | | ...
2785 | | ${number}= | Set Variable | ${1}
2786 | | ${sock1}= | Set Variable | memif-DUT1_CNF
2787 | | ${sock2}= | Set Variable | memif-DUT1_CNF
2788 | | ${memif_if1_name}= | Set Variable | DUT1-memif-${number}-if1
2789 | | ${memif_if2_name}= | Set Variable | DUT1-memif-${number}-if2
2790 | | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock2}
2791 | | ... | ${number} | ${memif_if1_name} | ${memif_if2_name} | ${rxq_count_int}
2792 | | ... | ${rxq_count_int}
2793 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
2794 | | Add interface to bridge domain | ${dut1} | ${${memif_if1_name}} | ${bd_id1}
2795 | | Add interface to bridge domain | ${dut1} | ${${memif_if2_name}} | ${bd_id2}
2796 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
2797 | | ${sock1}= | Run Keyword If | '${dut2_status}' == 'PASS'
2798 | | ... | Set Variable | memif-DUT2_CNF
2799 | | ${sock2}= | Run Keyword If | '${dut2_status}' == 'PASS'
2800 | | ... | Set Variable | memif-DUT2_CNF
2801 | | ${memif_if1_name}= | Run Keyword If | '${dut2_status}' == 'PASS'
2802 | | ... | Set Variable | DUT2-memif-${number}-if1
2803 | | ${memif_if2_name}= | Run Keyword If | '${dut2_status}' == 'PASS'
2804 | | ... | Set Variable | DUT2-memif-${number}-if2
2805 | | Run Keyword If | '${dut2_status}' == 'PASS'
2806 | | ... | Set up memif interfaces on DUT node | ${dut2} | ${sock1} | ${sock2}
2807 | | ... | ${number} | ${memif_if1_name} | ${memif_if2_name} | ${rxq_count_int}
2808 | | ... | ${rxq_count_int}
2809 | | Run Keyword If | '${dut2_status}' == 'PASS'
2810 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
2811 | | ... | ${bd_id1}
2812 | | Run Keyword If | '${dut2_status}' == 'PASS'
2813 | | ... | Add interface to bridge domain | ${dut2} | ${${memif_if1_name}}
2814 | | ... | ${bd_id1}
2815 | | Run Keyword If | '${dut2_status}' == 'PASS'
2816 | | ... | Add interface to bridge domain | ${dut2} | ${${memif_if2_name}}
2817 | | ... | ${bd_id2}
2818 | | Run Keyword If | '${dut2_status}' == 'PASS'
2819 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
2820 | | ...
2821 | | Show Memif on all DUTs | ${nodes}
2822 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
2823
2824 | Initialize IPv4 routing with memif pairs on DUT node
2825 | | [Documentation]
2826 | | ... | Create pairs of Memif interfaces on DUT node. Put each Memif interface
2827 | | ... | to separate IPv4 VRF with one physical or virtual interface
2828 | | ... | to create a chain accross DUT node.
2829 | | ...
2830 | | ... | *Arguments:*
2831 | | ... | - dut - DUT node. Type: dictionary
2832 | | ... | - count - Number of memif pairs (containers). Type: integer
2833 | | ...
2834 | | ... | *Note:*
2835 | | ... | Socket paths for Memif are defined in following format:
2836 | | ... | - /tmp/memif-\${dut}_CNF\${number}-\${sid}
2837 | | ...
2838 | | ... | *Example:*
2839 | | ...
2840 | | ... | \| Initialize IPv4 routing with memif pairs on DUT node \
2841 | | ... | \| ${dut} \| ${1} \|
2842 | | ...
2843 | | [Arguments] | ${dut} | ${count}
2844 | | ...
2845 | | @{duts}= | Get Matches | ${nodes} | DUT*
2846 | | ${dut_index}= | Get Index From List | ${duts} | ${dut}
2847 | | ${duts_length}= | Get Length | ${duts}
2848 | | ${last_dut_index}= | Evaluate | ${duts_length} - ${1}
2849 | | ...
2850 | | ${tg_if1_net}= | Set Variable | 10.10.10.0
2851 | | ${tg_if2_net}= | Set Variable | 20.20.20.0
2852 | | ...
2853 | | ${fib_table_1}= | Set Variable | ${10}
2854 | | Run Keyword If | ${fib_table_1} > ${0}
2855 | | ... | Add Fib Table | ${nodes['${dut}']} | ${fib_table_1}
2856 | | ${ip_base_if1}= | Evaluate | ${dut_index} + ${1}
2857 | | ${ip_net_if1}= | Set Variable
2858 | | ... | ${ip_base_if1}.${ip_base_if1}.${ip_base_if1}
2859 | | Vpp Route Add | ${nodes['${dut}']} | ${tg_if1_net} | 24
2860 | | ... | vrf=${fib_table_1} | gateway=${ip_net_if1}.1
2861 | | ... | interface=${${dut}_if1} | multipath=${TRUE}
2862 | | Assign Interface To Fib Table | ${nodes['${dut}']} | ${${dut}_if1}
2863 | | ... | ${fib_table_1}
2864 | | Configure IP addresses on interfaces | ${nodes['${dut}']} | ${${dut}_if1}
2865 | | ... | ${ip_net_if1}.2 | 30
2866 | | ${prev_node}= | Run Keyword If | ${dut_index} == ${0}
2867 | | ... | Set Variable | TG
2868 | | ... | ELSE | Get From List | ${duts} | ${dut_index-${1}}
2869 | | ${prev_if}= | Run Keyword If | ${dut_index} == ${0}
2870 | | ... | Set Variable | if1
2871 | | ... | ELSE | Set Variable | if2
2872 | | ${prev_if_mac}= | Get Interface MAC | ${nodes['${prev_node}']}
2873 | | ... | ${${prev_node}_${prev_if}}
2874 | | Add ARP on DUT | ${nodes['${dut}']} | ${${dut}_if1} | ${ip_net_if1}.1
2875 | | ... | ${prev_if_mac}
2876 | | ...
2877 | | ${fib_table_2}= | Evaluate | ${fib_table_1} + ${count}
2878 | | Add Fib Table | ${nodes['${dut}']} | ${fib_table_2}
2879 | | ${ip_base_if2}= | Evaluate | ${ip_base_if1} + ${1}
2880 | | ${ip_net_if2}= | Set Variable
2881 | | ... | ${ip_base_if2}.${ip_base_if2}.${ip_base_if2}
2882 | | Vpp Route Add | ${nodes['${dut}']} | ${tg_if2_net} | 24
2883 | | ... | vrf=${fib_table_2} | gateway=${ip_net_if2}.2
2884 | | ... | interface=${${dut}_if2} | multipath=${TRUE}
2885 | | Assign Interface To Fib Table | ${nodes['${dut}']} | ${${dut}_if2}
2886 | | ... | ${fib_table_2}
2887 | | Configure IP addresses on interfaces | ${nodes['${dut}']} | ${${dut}_if2}
2888 | | ... | ${ip_net_if2}.1 | 30
2889 | | ${next_node}= | Run Keyword If | ${dut_index} == ${last_dut_index}
2890 | | ... | Set Variable | TG
2891 | | ... | ELSE | Get From List | ${duts} | ${dut_index+${1}}
2892 | | ${next_if}= | Run Keyword If | ${dut_index} == ${last_dut_index}
2893 | | ... | Set Variable | if2
2894 | | ... | ELSE | Set Variable | if1
2895 | | ${next_if_mac}= | Get Interface MAC | ${nodes['${next_node}']}
2896 | | ... | ${${next_node}_${next_if}}
2897 | | Add ARP on DUT | ${nodes['${dut}']} | ${${dut}_if2} | ${ip_net_if2}.2
2898 | | ... | ${next_if_mac}
2899 | | ...
2900 | | ${fib_table_1}= | Evaluate | ${fib_table_1} - ${1}
2901 | | ${ip_base_start}= | Set Variable | ${31}
2902 | | :FOR | ${number} | IN RANGE | 1 | ${count+${1}}
2903 | | | ${sock1}= | Set Variable | memif-${dut}_CNF
2904 | | | ${sock2}= | Set Variable | memif-${dut}_CNF
2905 | | | Set up memif interfaces on DUT node | ${nodes['${dut}']}
2906 | | | ... | ${sock1} | ${sock2} | ${number} | ${dut}-memif-${number}-if1
2907 | | | ... | ${dut}-memif-${number}-if2 | ${rxq_count_int} | ${rxq_count_int}
2908 | | | ${memif1}= | Set Variable | ${${dut}-memif-${number}-if1}
2909 | | | ${memif2}= | Set Variable | ${${dut}-memif-${number}-if2}
2910 | | | ${fib_table_1}= | Evaluate | ${fib_table_1} + ${1}
2911 | | | ${fib_table_2}= | Evaluate | ${fib_table_1} + ${1}
2912 | | | Run Keyword Unless | ${number} == ${count}
2913 | | | ... | Add Fib Table | ${nodes['${dut}']} | ${fib_table_2}
2914 | | | Assign Interface To Fib Table | ${nodes['${dut}']}
2915 | | | ... | ${memif1} | ${fib_table_1}
2916 | | | Assign Interface To Fib Table | ${nodes['${dut}']}
2917 | | | ... | ${memif2} | ${fib_table_2}
2918 | | | ${ip_base_memif1}= | Evaluate
2919 | | | ... | ${ip_base_start} + (${number} - ${1}) * ${2}
2920 | | | ${ip_base_memif2}= | Evaluate | ${ip_base_memif1} + ${1}
2921 | | | ${ip_net_memif1}= | Set Variable
2922 | | | ... | ${ip_base_memif1}.${ip_base_memif1}.${ip_base_memif1}
2923 | | | ${ip_net_memif2}= | Set Variable
2924 | | | ... | ${ip_base_memif2}.${ip_base_memif2}.${ip_base_memif2}
2925 | | | Configure IP addresses on interfaces
2926 | | | ... | ${nodes['${dut}']} | ${memif1} | ${ip_net_memif1}.1 | 30
2927 | | | ... | ${nodes['${dut}']} | ${memif2} | ${ip_net_memif2}.1 | 30
2928 | | | Vpp Route Add | ${nodes['${dut}']} | ${tg_if2_net} | 24
2929 | | | ... | vrf=${fib_table_1} | gateway=${ip_net_memif2}.1
2930 | | | ... | interface=${memif1}
2931 | | | Vpp Route Add | ${nodes['${dut}']} | ${tg_if1_net} | 24
2932 | | | ... | vrf=${fib_table_2} | gateway=${ip_net_memif1}.1
2933 | | | ... | interface=${memif2}
2934 | | | ${memif_if1_key}= | Get interface by sw index | ${nodes['${dut}']}
2935 | | | ... | ${memif1}
2936 | | | ${memif_if1_mac}= | Get interface mac | ${nodes['${dut}']}
2937 | | | ... | ${memif_if1_key}
2938 | | | ${memif_if2_key}= | Get interface by sw index | ${nodes['${dut}']}
2939 | | | ... | ${memif2}
2940 | | | ${memif_if2_mac}= | Get interface mac | ${nodes['${dut}']}
2941 | | | ... | ${memif_if2_key}
2942 | | | Add arp on dut | ${nodes['${dut}']} | ${memif1} | ${ip_net_memif2}.1
2943 | | | ... | ${memif_if2_mac}
2944 | | | Add arp on dut | ${nodes['${dut}']} | ${memif2} | ${ip_net_memif1}.1
2945 | | | ... | ${memif_if1_mac}
2946
2947 | Initialize IPv4 routing with memif pairs
2948 | | [Documentation]
2949 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
2950 | | ... | Memif interface to separate IPv4 VRF with one physical or
2951 | | ... | virtual interface to create a chain accross DUT node.
2952 | | ...
2953 | | ... | *Arguments:*
2954 | | ... | - count - Number of memif pairs (containers). Type: integer
2955 | | ...
2956 | | ... | *Example:*
2957 | | ...
2958 | | ... | \| Initialize IPv4 routing with memif pairs \| ${1} \|
2959 | | ...
2960 | | [Arguments] | ${count}=${1}
2961 | | ...
2962 | | ${duts}= | Get Matches | ${nodes} | DUT*
2963 | | :FOR | ${dut} | IN | @{duts}
2964 | | | Initialize IPv4 routing with memif pairs on DUT node | ${dut} | ${count}
2965 | | Set interfaces in path up
2966 | | Show Memif on all DUTs | ${nodes}
2967 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
2968
2969 | Initialize L2 xconnect for single memif
2970 | | [Documentation]
2971 | | ... | Create single Memif interface on all defined VPP nodes. Cross
2972 | | ... | connect Memif interface with one physical interface.
2973 | | ...
2974 | | ... | *Arguments:*
2975 | | ... | - number - Memif ID. Type: integer
2976 | | ...
2977 | | ... | *Note:*
2978 | | ... | Socket paths for Memif are defined in following format:
2979 | | ... | - /tmp/memif-DUT1_CNF\${number}-\${sid}
2980 | | ...
2981 | | ... | KW uses test variable ${rxq_count_int} set by KW Add worker threads
2982 | | ... | and rxqueues to all DUTs
2983 | | ...
2984 | | ... | *Example:*
2985 | | ...
2986 | | ... | \| Initialize L2 xconnect for single memif \| 1 \|
2987 | | ...
2988 | | [Arguments] | ${number}=${1}
2989 | | ...
2990 | | ${duts}= | Get Matches | ${nodes} | DUT*
2991 | | :FOR | ${dut} | IN | @{duts}
2992 | | | ${sock}= | Set Variable | memif-${dut}_CNF
2993 | | | ${sid}= | Evaluate | (${number} * ${2}) - ${1}
2994 | | | Set up single memif interface on DUT node | ${nodes['${dut}']} | ${sock}
2995 | | | ... | mid=${number} | sid=${sid} | memif_if=${dut}-memif-${number}-if1
2996 | | | ... | rxq=${rxq_count_int} | txq=${rxq_count_int}
2997 | | | Configure L2XC | ${nodes['${dut}']} | ${${dut}_if1}
2998 | | | ... | ${${dut}-memif-${number}-if1}
2999 | | Set single interfaces in path up
3000 | | Show Memif on all DUTs | ${nodes}
3001 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
3002
3003 | Initialize L2 Bridge Domain for single memif
3004 | | [Documentation]
3005 | | ... | Create single Memif interface on all defined VPP nodes. Put Memif
3006 | | ... | interface to separate L2 bridge domain with one physical interface.
3007 | | ...
3008 | | ... | *Arguments:*
3009 | | ... | - number - Memif ID. Type: integer
3010 | | ...
3011 | | ... | *Note:*
3012 | | ... | Socket paths for Memif are defined in following format:
3013 | | ... | - /tmp/memif-DUT1_CNF\${number}-\${sid}
3014 | | ...
3015 | | ... | KW uses test variable ${rxq_count_int} set by KW Add worker threads
3016 | | ... | and rxqueues to all DUTs
3017 | | ...
3018 | | ... | *Example:*
3019 | | ...
3020 | | ... | \| Initialize L2 Bridge Domain for single memif \| 1 \|
3021 | | ...
3022 | | [Arguments] | ${number}=${1}
3023 | | ...
3024 | | ${duts}= | Get Matches | ${nodes} | DUT*
3025 | | :FOR | ${dut} | IN | @{duts}
3026 | | | ${sock}= | Set Variable | memif-${dut}_CNF
3027 | | | ${sid}= | Evaluate | (${number} * ${2}) - ${1}
3028 | | | Set up single memif interface on DUT node | ${nodes['${dut}']} | ${sock}
3029 | | | ... | mid=${number} | sid=${sid} | memif_if=${dut}-memif-${number}-if1
3030 | | | ... | rxq=${rxq_count_int} | txq=${rxq_count_int}
3031 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1}
3032 | | | ... | ${number}
3033 | | | Add interface to bridge domain | ${nodes['${dut}']}
3034 | | | ... | ${${dut}-memif-${number}-if1} | ${number}
3035 | | Set single interfaces in path up
3036 | | Show Memif on all DUTs | ${nodes}
3037
3038 | Configure ACLs on a single interface
3039 | | [Documentation]
3040 | | ... | Configure ACL
3041 | | ...
3042 | | ... | *Arguments:*
3043 | | ... | - dut - DUT node. Type: string
3044 | | ... | - dut_if - DUT node interface name. Type: string
3045 | | ... | - acl_apply_type - To what path apply the ACL - input or output.
3046 | | ... | - acl_action - Action for the rule - deny, permit, permit+reflect.
3047 | | ... | - subnets - Subnets to apply the specific ACL. Type: list
3048 | | ...
3049 | | ... | *Example:*
3050 | | ...
3051 | | ... | \| Configure ACLs on a single interface \| ${nodes['DUT1']}
3052 | | ... | \| ... \| GigabitEthernet0/7/0 \| input \| permit | 0.0.0.0/0
3053 | | ...
3054 | | [Arguments] | ${dut} | ${dut_if} | ${acl_apply_type} | ${acl_action}
3055 | | ... | @{subnets}
3056 | | Set Test variable | ${acl} | ${EMPTY}
3057 | | :FOR | ${subnet} | IN | @{subnets}
3058 | | | ${acl} = | Run Keyword If | '${acl}' == '${EMPTY}'
3059 | | | ... | Set Variable | ipv4 ${acl_action} src ${subnet}
3060 | | | ... | ELSE
3061 | | | ... | Catenate | SEPARATOR=, | ${acl}
3062 | | | ... | ipv4 ${acl_action} src ${subnet}
3063 | | Add Replace Acl Multi Entries | ${dut} | rules=${acl}
3064 | | @{acl_list} = | Create List | ${0}
3065 | | Set Acl List For Interface | ${dut} | ${dut_if} | ${acl_apply_type}
3066 | | ... | ${acl_list}