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