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