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