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