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