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