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