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