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