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