CSIT-675: SRv6 performance tests
[csit.git] / resources / libraries / robot / performance / performance_configuration.robot
1 # Copyright (c) 2018 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Library | Collections
16 | Library | String
17 | Library | resources.libraries.python.topology.Topology
18 | Library | resources.libraries.python.NodePath
19 | Library | resources.libraries.python.DpdkUtil
20 | Library | resources.libraries.python.InterfaceUtil
21 | Library | resources.libraries.python.VhostUser
22 | Library | resources.libraries.python.TrafficGenerator
23 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
24 | Library | resources.libraries.python.Classify
25 | Library | resources.libraries.python.IPUtil
26 | Library | resources.libraries.python.L2Util
27 | Resource | resources/libraries/robot/shared/default.robot
28 | Resource | resources/libraries/robot/shared/interfaces.robot
29 | Resource | resources/libraries/robot/shared/counters.robot
30 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
31 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
32 | Resource | resources/libraries/robot/ip/ip4.robot
33 | Resource | resources/libraries/robot/ip/ip6.robot
34 | Resource | resources/libraries/robot/vm/qemu.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 in 2-node circular topology up
41 | | [Documentation]
42 | | ... | *Set UP state on VPP interfaces in path on nodes in 2-node circular
43 | | ... | topology.*
44 | | ...
45 | | Set Interface State | ${dut1} | ${dut1_if1} | up
46 | | Set Interface State | ${dut1} | ${dut1_if2} | up
47 | | Vpp Node Interfaces Ready Wait | ${dut1}
48
49 | Set interfaces in path in 3-node circular topology up
50 | | [Documentation]
51 | | ... | *Set UP state on VPP interfaces in path on nodes in 3-node circular
52 | | ... | topology.*
53 | | ...
54 | | Set Interface State | ${dut1} | ${dut1_if1} | up
55 | | Set Interface State | ${dut1} | ${dut1_if2} | up
56 | | Set Interface State | ${dut2} | ${dut2_if1} | up
57 | | Set Interface State | ${dut2} | ${dut2_if2} | up
58 | | Vpp Node Interfaces Ready Wait | ${dut1}
59 | | Vpp Node Interfaces Ready Wait | ${dut2}
60
61 | Initialize IPSec in 3-node circular topology
62 | | [Documentation]
63 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
64 | | ... | topology. Get the interface MAC addresses and setup ARP on all VPP
65 | | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG and
66 | | ... | DUT1-DUT2 links. Set routing for encrypted traffic on both DUT nodes
67 | | ... | with prefix /8 and next hop of neighbour DUT or TG interface IPv4
68 | | ... | address.
69 | | ...
70 | | VPP Show Crypto Device Mapping | ${dut1}
71 | | VPP Show Crypto Device Mapping | ${dut2}
72 | | Set interfaces in path in 3-node circular topology up
73 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
74 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
75 | | ${dut1_if1_mac}= | Get Interface MAC | ${dut1} | ${dut1_if1}
76 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
77 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
78 | | ${dut2_if2_mac}= | Get Interface MAC | ${dut2} | ${dut2_if2}
79 | | Set Interface State | ${dut1} | ${dut1_if1} | up
80 | | Set Interface State | ${dut1} | ${dut1_if2} | up
81 | | Set Interface State | ${dut2} | ${dut2_if1} | up
82 | | Set Interface State | ${dut2} | ${dut2_if2} | up
83 | | Set Test Variable | ${tg_if1_mac}
84 | | Set Test Variable | ${tg_if2_mac}
85 | | Set Test Variable | ${dut1_if1_mac}
86 | | Set Test Variable | ${dut1_if2_mac}
87 | | Set Test Variable | ${dut2_if1_mac}
88 | | Set Test Variable | ${dut2_if2_mac}
89 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
90 | | ... | ${dut1_if1_ip4} | 24
91 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
92 | | ... | ${dut1_if2_ip4} | 24
93 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
94 | | ... | ${dut2_if1_ip4} | 24
95 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2}
96 | | ... | ${dut2_if2_ip4} | 24
97 | | Add arp on dut | ${dut1} | ${dut1_if1} | ${tg_if1_ip4} | ${tg_if1_mac}
98 | | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_if1_ip4} | ${dut2_if1_mac}
99 | | Add arp on dut | ${dut2} | ${dut2_if2} | ${tg_if2_ip4} | ${tg_if2_mac}
100 | | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_if2_ip4} | ${dut1_if2_mac}
101 | | Vpp Route Add | ${dut1} | ${laddr_ip4} | 8 | ${tg_if1_ip4} | ${dut1_if1}
102 | | Vpp Route Add | ${dut2} | ${raddr_ip4} | 8 | ${tg_if2_ip4} | ${dut2_if2}
103
104 | Initialize IPv4 forwarding in 3-node circular topology
105 | | [Documentation]
106 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
107 | | ... | topology. Get the interface MAC addresses and setup ARP on all VPP
108 | | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG links and
109 | | ... | /30 prefix on DUT1-DUT2 link. Set routing on both DUT nodes with
110 | | ... | prefix /24 and next hop of neighbour DUT interface IPv4 address.
111 | | ...
112 | | Set Interface State | ${dut1} | ${dut1_if1} | up
113 | | Set Interface State | ${dut1} | ${dut1_if2} | up
114 | | Set Interface State | ${dut2} | ${dut2_if1} | up
115 | | Set Interface State | ${dut2} | ${dut2_if2} | up
116 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
117 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
118 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
119 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
120 | | dut1_v4.set_arp | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
121 | | dut1_v4.set_arp | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
122 | | dut2_v4.set_arp | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
123 | | dut2_v4.set_arp | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
124 | | dut1_v4.set_ip | ${dut1_if1} | 10.10.10.1 | 24
125 | | dut1_v4.set_ip | ${dut1_if2} | 1.1.1.1 | 30
126 | | dut2_v4.set_ip | ${dut2_if1} | 1.1.1.2 | 30
127 | | dut2_v4.set_ip | ${dut2_if2} | 20.20.20.1 | 24
128 | | dut1_v4.set_route | 20.20.20.0 | 24 | 1.1.1.2 | ${dut1_if2}
129 | | dut2_v4.set_route | 10.10.10.0 | 24 | 1.1.1.1 | ${dut2_if1}
130 | | All Vpp Interfaces Ready Wait | ${nodes}
131
132 | Initialize IPv4 forwarding in 2-node circular topology
133 | | [Documentation]
134 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node circular
135 | | ... | topology. Get the interface MAC addresses and setup ARP on all VPP
136 | | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG links and
137 | | ... | /30 prefix on DUT1 link. Set routing on DUT node with prefix /24 and
138 | | ... | next hop of neighbour DUT interface IPv4 address.
139 | | ...
140 | | Set Interface State | ${dut1} | ${dut1_if1} | up
141 | | Set Interface State | ${dut1} | ${dut1_if2} | up
142 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
143 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
144 | | dut1_v4.set_arp | ${dut1_if1} | 10.10.10.3 | ${tg1_if1_mac}
145 | | dut1_v4.set_arp | ${dut1_if2} | 20.20.20.3 | ${tg1_if2_mac}
146 | | dut1_v4.set_ip | ${dut1_if1} | 10.10.10.2 | 24
147 | | dut1_v4.set_ip | ${dut1_if2} | 20.20.20.2 | 24
148 | | All Vpp Interfaces Ready Wait | ${nodes}
149
150 | Initialize IPv4 forwarding with scaling in 3-node circular topology
151 | | [Documentation]
152 | | ... | Custom setup of IPv4 topology with scalability of ip routes on all
153 | | ... | DUT nodes in 3-node circular topology
154 | | ...
155 | | ... | *Arguments:*
156 | | ... | - ${count} - IP route count. Type: integer
157 | | ...
158 | | ... | *Return:*
159 | | ... | - No value returned
160 | | ...
161 | | ... | *Example:*
162 | | ...
163 | | ... | \| Initialize IPv4 forwarding with scaling in 3-node circular \
164 | | ... | topology \| 100000 \|
165 | | ...
166 | | [Arguments] | ${count}
167 | | ...
168 | | Set Interface State | ${dut1} | ${dut1_if1} | up
169 | | Set Interface State | ${dut1} | ${dut1_if2} | up
170 | | Set Interface State | ${dut2} | ${dut2_if1} | up
171 | | Set Interface State | ${dut2} | ${dut2_if2} | up
172 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
173 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
174 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
175 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
176 | | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac}
177 | | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac}
178 | | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac}
179 | | Add arp on dut | ${dut2} | ${dut2_if2} | 3.3.3.1 | ${tg1_if2_mac}
180 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30
181 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30
182 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2 | 30
183 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 3.3.3.2 | 30
184 | | Vpp Route Add | ${dut1} | 10.0.0.0 | 32 | 1.1.1.1 | ${dut1_if1}
185 | | ... | count=${count}
186 | | Vpp Route Add | ${dut1} | 20.0.0.0 | 32 | 2.2.2.2 | ${dut1_if2}
187 | | ... | count=${count}
188 | | Vpp Route Add | ${dut2} | 10.0.0.0 | 32 | 2.2.2.1 | ${dut2_if1}
189 | | ... | count=${count}
190 | | Vpp Route Add | ${dut2} | 20.0.0.0 | 32 | 3.3.3.1 | ${dut2_if2}
191 | | ... | count=${count}
192 | | All Vpp Interfaces Ready Wait | ${nodes}
193
194 | Initialize IPv4 forwarding with vhost in 3-node circular topology
195 | | [Documentation]
196 | | ... | Create vhost-user interfaces in VPP. Set UP state of all VPP
197 | | ... | interfaces in path on nodes in 3-node circular topology. Create 2
198 | | ... | FIB tables on each DUT with multipath routing. Assign pair of
199 | | ... | Physical and Virtual interfaces on both nodes to each FIB table.
200 | | ... | Setup IPv4 addresses with /30 prefix on DUT-TG links and /30 prefix
201 | | ... | on DUT1-DUT2 link. Set routing on all DUT nodes in all FIB tables
202 | | ... | with prefix /24 and next hop of neighbour IPv4 address. Setup
203 | | ... | ARP on all VPP interfaces.
204 | | ...
205 | | ... | *Arguments:*
206 | | ... | - sock1 - Sock path for first Vhost-User interface. Type: string
207 | | ... | - sock2 - Sock path for second Vhost-User interface. Type: string
208 | | ...
209 | | ... | _NOTE:_ This KW uses following test case variables:
210 | | ... | - ${dut1} - DUT1 node.
211 | | ... | - ${dut2} - DUT2 node.
212 | | ... | - ${dut1_if1} - DUT1 interface towards TG.
213 | | ... | - ${dut1_if2} - DUT1 interface towards DUT2.
214 | | ... | - ${dut2_if1} - DUT2 interface towards DUT1.
215 | | ... | - ${dut2_if2} - DUT2 interface towards TG.
216 | | ...
217 | | ... | *Return:*
218 | | ... | - No value returned
219 | | ...
220 | | ... | *Example:*
221 | | ...
222 | | ... | \| IPv4 forwarding with vhost initialized in a 3-node circular \
223 | | ... | topology \| /tmp/sock1 \| /tmp/sock2 \|
224 | | ...
225 | | [Arguments] | ${sock1} | ${sock2}
226 | | ...
227 | | Set interfaces in path in 3-node circular topology up
228 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
229 | | ... | ${sock1} | ${sock2} | dut1_vhost_if1 | dut1_vhost_if2
230 | | ${dut1_vif1}= | Set Variable | ${dut1_vhost_if1}
231 | | ${dut1_vif2}= | Set Variable | ${dut1_vhost_if2}
232 | | Set Interface State | ${dut1} | ${dut1_vif1} | up
233 | | Set Interface State | ${dut1} | ${dut1_vif2} | up
234 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
235 | | ... | ${sock1} | ${sock2} | dut2_vhost_if1 | dut2_vhost_if2
236 | | ${dut2_vif1}= | Set Variable | ${dut2_vhost_if1}
237 | | ${dut2_vif2}= | Set Variable | ${dut2_vhost_if2}
238 | | Set Interface State | ${dut2} | ${dut2_vif1} | up
239 | | Set Interface State | ${dut2} | ${dut2_vif2} | up
240 | | Add Fib Table | ${dut1} | ${fib_table_1}
241 | | And Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | vrf=${fib_table_1}
242 | | ... | gateway=4.4.4.2 | interface=${dut1_vif1} | multipath=${TRUE}
243 | | Add Fib Table | ${dut1} | ${fib_table_1}
244 | | And Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | vrf=${fib_table_1}
245 | | ... | gateway=1.1.1.2 | interface=${dut1_if1} | multipath=${TRUE}
246 | | Add Fib Table | ${dut1} | ${fib_table_2}
247 | | And Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | vrf=${fib_table_2}
248 | | ... | gateway=2.2.2.2 | interface=${dut1_if2} | multipath=${TRUE}
249 | | Add Fib Table | ${dut1} | ${fib_table_2}
250 | | And Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | vrf=${fib_table_2}
251 | | ... | gateway=5.5.5.2 | interface=${dut1_vif2} | multipath=${TRUE}
252 | | Add Fib Table | ${dut2} | ${fib_table_1}
253 | | And Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | vrf=${fib_table_1}
254 | | ... | gateway=2.2.2.1 | interface=${dut2_if1} | multipath=${TRUE}
255 | | Add Fib Table | ${dut2} | ${fib_table_1}
256 | | And Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | vrf=${fib_table_1}
257 | | ... | gateway=4.4.4.1 | interface=${dut2_vif1} | multipath=${TRUE}
258 | | Add Fib Table | ${dut2} | ${fib_table_2}
259 | | And Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | vrf=${fib_table_2}
260 | | ... | gateway=5.5.5.2 | interface=${dut2_vif2} | multipath=${TRUE}
261 | | Add Fib Table | ${dut2} | ${fib_table_2}
262 | | And Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | vrf=${fib_table_2}
263 | | ... | gateway=3.3.3.2 | interface=${dut2_if2} | multipath=${TRUE}
264 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if1} | ${fib_table_1}
265 | | Assign Interface To Fib Table | ${dut1} | ${dut1_vif1} | ${fib_table_1}
266 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if2} | ${fib_table_2}
267 | | Assign Interface To Fib Table | ${dut1} | ${dut1_vif2} | ${fib_table_2}
268 | | Assign Interface To Fib Table | ${dut2} | ${dut2_if1} | ${fib_table_1}
269 | | Assign Interface To Fib Table | ${dut2} | ${dut2_vif1} | ${fib_table_1}
270 | | Assign Interface To Fib Table | ${dut2} | ${dut2_if2} | ${fib_table_2}
271 | | Assign Interface To Fib Table | ${dut2} | ${dut2_vif2} | ${fib_table_2}
272 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30
273 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30
274 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_vif1} | 4.4.4.1 | 30
275 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_vif2} | 5.5.5.1 | 30
276 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2 | 30
277 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 3.3.3.1 | 30
278 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_vif1} | 4.4.4.1 | 30
279 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_vif2} | 5.5.5.1 | 30
280 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
281 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
282 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
283 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
284 | | ${dut1_vif1_idx}= | Get Interface SW Index | ${dut1} | ${dut1_vif1}
285 | | ${dut1_vif2_idx}= | Get Interface SW Index | ${dut1} | ${dut1_vif2}
286 | | ${dut2_vif1_idx}= | Get Interface SW Index | ${dut2} | ${dut2_vif1}
287 | | ${dut2_vif2_idx}= | Get Interface SW Index | ${dut2} | ${dut2_vif2}
288 | | ${dut1_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut1}
289 | | ... | ${dut1_vif1_idx}
290 | | ${dut1_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut1}
291 | | ... | ${dut1_vif2_idx}
292 | | ${dut2_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut2}
293 | | ... | ${dut2_vif1_idx}
294 | | ${dut2_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut2}
295 | | ... | ${dut2_vif2_idx}
296 | | Set Test Variable | ${dut1_vif1_mac}
297 | | Set Test Variable | ${dut1_vif2_mac}
298 | | Set Test Variable | ${dut2_vif1_mac}
299 | | Set Test Variable | ${dut2_vif2_mac}
300 | | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac}
301 | | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac}
302 | | Add arp on dut | ${dut1} | ${dut1_vif1} | 4.4.4.2 | 52:54:00:00:04:01
303 | | Add arp on dut | ${dut1} | ${dut1_vif2} | 5.5.5.2 | 52:54:00:00:04:02
304 | | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac}
305 | | Add arp on dut | ${dut2} | ${dut2_if2} | 3.3.3.2 | ${tg1_if2_mac}
306 | | Add arp on dut | ${dut2} | ${dut2_vif1} | 4.4.4.2 | 52:54:00:00:04:01
307 | | Add arp on dut | ${dut2} | ${dut2_vif2} | 5.5.5.2 | 52:54:00:00:04:02
308 | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 4.4.4.2 | ${dut1_vif1}
309 | | ... | vrf=${fib_table_1}
310 | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | 1.1.1.1 | ${dut1_if1}
311 | | ... | vrf=${fib_table_1}
312 | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 2.2.2.2 | ${dut1_if2}
313 | | ... | vrf=${fib_table_2}
314 | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | 5.5.5.2 | ${dut1_vif2}
315 | | ... | vrf=${fib_table_2}
316 | | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | 4.4.4.2 | ${dut2_vif1}
317 | | ... | vrf=${fib_table_1}
318 | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | 2.2.2.1 | ${dut2_if1}
319 | | ... | vrf=${fib_table_1}
320 | | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | 3.3.3.2 | ${dut2_if2}
321 | | ... | vrf=${fib_table_2}
322 | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | 5.5.5.2 | ${dut2_vif2}
323 | | ... | vrf=${fib_table_2}
324
325 | Initialize IPv4 forwarding with vhost for '${nr}' VMs in 3-node circular topology
326 | | [Documentation]
327 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on all
328 | | ... | VPP nodes. Set UP state of all VPP interfaces in path. Create ${nr}+1
329 | | ... | FIB tables on each DUT with multipath routing. Assign each Virtual
330 | | ... | interface to FIB table with Physical interface or Virtual interface on
331 | | ... | both nodes. Setup IPv4 addresses with /30 prefix on DUT-TG links and
332 | | ... | /30 prefix on DUT1-DUT2 link. Set routing on all DUT nodes in all FIB
333 | | ... | tables with prefix /24 and next hop of neighbour IPv4 address. Setup
334 | | ... | ARP on all VPP interfaces.
335 | | ...
336 | | ... | *Arguments:*
337 | | ... | _None_
338 | | ...
339 | | ... | *Note:*
340 | | ... | Socket paths for VM are defined in following format:
341 | | ... | - /tmp/sock-${VM_ID}-1
342 | | ... | - /tmp/sock-${VM_ID}-2
343 | | ...
344 | | ... | *Return:*
345 | | ... | - No value returned
346 | | ...
347 | | ... | *Example:*
348 | | ...
349 | | ... | \| IPv4 forwarding with Vhost-User for '2' VMs initialized in \
350 | | ... | a 3-node circular topology \|
351 | | ...
352 | | Set interfaces in path in 3-node circular topology up
353 | | ${fib_table_1}= | Set Variable | ${101}
354 | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${nr}
355 | | Add Fib Table | ${dut1} | ${fib_table_1}
356 | | And Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | vrf=${fib_table_1}
357 | | ... | gateway=1.1.1.2 | interface=${dut1_if1} | multipath=${TRUE}
358 | | Add Fib Table | ${dut1} | ${fib_table_2}
359 | | And Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | vrf=${fib_table_2}
360 | | ... | gateway=2.2.2.2 | interface=${dut1_if2} | multipath=${TRUE}
361 | | Add Fib Table | ${dut2} | ${fib_table_1}
362 | | And Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | vrf=${fib_table_1}
363 | | ... | gateway=2.2.2.1 | interface=${dut2_if1} | multipath=${TRUE}
364 | | Add Fib Table | ${dut2} | ${fib_table_2}
365 | | And Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | vrf=${fib_table_2}
366 | | ... | gateway=3.3.3.2 | interface=${dut2_if2} | multipath=${TRUE}
367 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if1} | ${fib_table_1}
368 | | Assign Interface To Fib Table | ${dut1} | ${dut1_if2} | ${fib_table_2}
369 | | Assign Interface To Fib Table | ${dut2} | ${dut2_if1} | ${fib_table_1}
370 | | Assign Interface To Fib Table | ${dut2} | ${dut2_if2} | ${fib_table_2}
371 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30
372 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30
373 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2 | 30
374 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 3.3.3.1 | 30
375 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
376 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
377 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
378 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
379 | | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac}
380 | | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac}
381 | | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac}
382 | | Add arp on dut | ${dut2} | ${dut2_if2} | 3.3.3.2 | ${tg1_if2_mac}
383 | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | 1.1.1.1 | ${dut1_if1}
384 | | ... | vrf=${fib_table_1}
385 | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 2.2.2.2 | ${dut1_if2}
386 | | ... | vrf=${fib_table_2}
387 | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | 2.2.2.1 | ${dut2_if1}
388 | | ... | vrf=${fib_table_1}
389 | | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | 3.3.3.2 | ${dut2_if2}
390 | | ... | vrf=${fib_table_2}
391 | | ${ip_base_start}= | Set Variable | ${4}
392 | | :FOR | ${number} | IN RANGE | 1 | ${nr}+1
393 | | | ${sock1}= | Set Variable | /tmp/sock-${number}-1
394 | | | ${sock2}= | Set Variable | /tmp/sock-${number}-2
395 | | | ${fib_table_1}= | Evaluate | ${100}+${number}
396 | | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${1}
397 | | | ${ip_base_vif1}= | Evaluate | ${ip_base_start}+(${number}-1)*2
398 | | | ${ip_base_vif2}= | Evaluate | ${ip_base_vif1}+1
399 | | | ${ip_net_vif1}= | Set Variable
400 | | | ... | ${ip_base_vif1}.${ip_base_vif1}.${ip_base_vif1}
401 | | | ${ip_net_vif2}= | Set Variable
402 | | | ... | ${ip_base_vif2}.${ip_base_vif2}.${ip_base_vif2}
403 | | | Configure vhost interfaces for L2BD forwarding | ${dut1}
404 | | | ... | ${sock1} | ${sock2} | dut1-vhost-${number}-if1
405 | | | ... | dut1-vhost-${number}-if2
406 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if1} | up
407 | | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if2} | up
408 | | | Configure vhost interfaces for L2BD forwarding | ${dut2}
409 | | | ... | ${sock1} | ${sock2} | dut2-vhost-${number}-if1
410 | | | ... | dut2-vhost-${number}-if2
411 | | | Set Interface State | ${dut2} | ${dut2-vhost-${number}-if1} | up
412 | | | Set Interface State | ${dut2} | ${dut2-vhost-${number}-if2} | up
413 | | | Add Fib Table | ${dut1} | ${fib_table_1}
414 | | | And Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | vrf=${fib_table_1}
415 | | | ... | gateway=${ip_net_vif1}.1 | interface=${dut1-vhost-${number}-if1}
416 | | | ... | multipath=${TRUE}
417 | | | Add Fib Table | ${dut1} | ${fib_table_2}
418 | | | And Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | vrf=${fib_table_2}
419 | | | ... | gateway=${ip_net_vif2}.2 | interface=${dut1-vhost-${number}-if2}
420 | | | ... | multipath=${TRUE}
421 | | | Add Fib Table | ${dut2} | ${fib_table_1}
422 | | | And Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | vrf=${fib_table_1}
423 | | | ... | gateway=${ip_net_vif1}.1 | interface=${dut2-vhost-${number}-if1}
424 | | | ... | multipath=${TRUE}
425 | | | Add Fib Table | ${dut2} | ${fib_table_2}
426 | | | And Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | vrf=${fib_table_2}
427 | | | ... | gateway=${ip_net_vif2}.2 | interface=${dut2-vhost-${number}-if2}
428 | | | ... | multipath=${TRUE}
429 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if1}
430 | | | ... | ${fib_table_1}
431 | | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if2}
432 | | | ... | ${fib_table_2}
433 | | | Assign Interface To Fib Table | ${dut2} | ${dut2-vhost-${number}-if1}
434 | | | ... | ${fib_table_1}
435 | | | Assign Interface To Fib Table | ${dut2} | ${dut2-vhost-${number}-if2}
436 | | | ... | ${fib_table_2}
437 | | | Configure IP addresses on interfaces
438 | | | ... | ${dut1} | ${dut1-vhost-${number}-if1} | ${ip_net_vif1}.1 | 30
439 | | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | ${ip_net_vif2}.1 | 30
440 | | | ... | ${dut2} | ${dut2-vhost-${number}-if1} | ${ip_net_vif1}.1 | 30
441 | | | ... | ${dut2} | ${dut2-vhost-${number}-if2} | ${ip_net_vif2}.1 | 30
442 | | | ${dut1_vif1_idx}= | Get Interface SW Index | ${dut1}
443 | | | ... | ${dut1-vhost-${number}-if1}
444 | | | ${dut1_vif2_idx}= | Get Interface SW Index | ${dut1}
445 | | | ... | ${dut1-vhost-${number}-if2}
446 | | | ${dut2_vif1_idx}= | Get Interface SW Index | ${dut2}
447 | | | ... | ${dut2-vhost-${number}-if1}
448 | | | ${dut2_vif2_idx}= | Get Interface SW Index | ${dut2}
449 | | | ... | ${dut2-vhost-${number}-if2}
450 | | | ${dut1_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut1}
451 | | | ... | ${dut1_vif1_idx}
452 | | | ${dut1_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut1}
453 | | | ... | ${dut1_vif2_idx}
454 | | | ${dut2_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut2}
455 | | | ... | ${dut2_vif1_idx}
456 | | | ${dut2_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut2}
457 | | | ... | ${dut2_vif2_idx}
458 | | | Set Test Variable | ${dut1-vhost-${number}-if1_mac}
459 | | | ... | ${dut1_vif1_mac}
460 | | | Set Test Variable | ${dut1-vhost-${number}-if2_mac}
461 | | | ... | ${dut1_vif2_mac}
462 | | | Set Test Variable | ${dut2-vhost-${number}-if1_mac}
463 | | | ... | ${dut2_vif1_mac}
464 | | | Set Test Variable | ${dut2-vhost-${number}-if2_mac}
465 | | | ... | ${dut2_vif2_mac}
466 | | | ${qemu_id}= | Set Variable If | ${number} < 10 | 0${number}
467 | | | ... | ${number}
468 | | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if1}
469 | | | ... | ${ip_net_vif1}.2 | 52:54:00:00:${qemu_id}:01
470 | | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if2}
471 | | | ... | ${ip_net_vif2}.2 | 52:54:00:00:${qemu_id}:02
472 | | | Add arp on dut | ${dut2} | ${dut2-vhost-${number}-if1}
473 | | | ... | ${ip_net_vif1}.2 | 52:54:00:00:${qemu_id}:01
474 | | | Add arp on dut | ${dut2} | ${dut2-vhost-${number}-if2}
475 | | | ... | ${ip_net_vif2}.2 | 52:54:00:00:${qemu_id}:02
476 | | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | ${ip_net_vif1}.2
477 | | | ... | ${dut1-vhost-${number}-if1} | vrf=${fib_table_1}
478 | | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | ${ip_net_vif2}.2
479 | | | ... | ${dut1-vhost-${number}-if2} | vrf=${fib_table_2}
480 | | | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | ${ip_net_vif1}.2
481 | | | ... | ${dut2-vhost-${number}-if1} | vrf=${fib_table_1}
482 | | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | ${ip_net_vif2}.2
483 | | | ... | ${dut2-vhost-${number}-if2} | vrf=${fib_table_2}
484
485 | Initialize IPv4 policer 2r3c-${t} in 3-node circular topology
486 | | [Documentation]
487 | | ... | Setup of 2r3c color-aware or color-blind policer with dst ip match
488 | | ... | on all DUT nodes in 3-node circular topology. Policer is applied on
489 | | ... | links TG - DUT1 and DUT2 - TG.
490 | | ...
491 | | ${dscp}= | DSCP AF22
492 | | Policer Set Name | policer1
493 | | Policer Set CIR | ${cir}
494 | | Policer Set EIR | ${eir}
495 | | Policer Set CB | ${cb}
496 | | Policer Set EB | ${eb}
497 | | Policer Set Rate Type pps
498 | | Policer Set Round Type Closest
499 | | Policer Set Type 2R3C 2698
500 | | Policer Set Conform Action Transmit
501 | | Policer Set Exceed Action Mark and Transmit | ${dscp}
502 | | Policer Set Violate Action Transmit
503 | | Policer Enable Color Aware
504 | | Run Keyword If | ${t} == 'ca' | Policer Enable Color Aware
505 | | Policer Classify Set Precolor Exceed
506 | | Policer Set Node | ${dut1}
507 | | Policer Classify Set Interface | ${dut1_if1}
508 | | Policer Classify Set Match IP | 20.20.20.2 | ${False}
509 | | Policer Set Configuration
510 | | Policer Set Node | ${dut2}
511 | | Policer Classify Set Interface | ${dut2_if2}
512 | | Policer Classify Set Match IP | 10.10.10.2 | ${False}
513 | | Policer Set Configuration
514
515 | Initialize IPv6 forwarding in 3-node circular topology
516 | | [Documentation]
517 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
518 | | ... | topology. Get the interface MAC addresses and setup neighbour on all
519 | | ... | VPP interfaces. Setup IPv6 addresses with /128 prefixes on all
520 | | ... | interfaces. Set routing on both DUT nodes with prefix /64 and
521 | | ... | next hop of neighbour DUT interface IPv6 address.
522 | | ...
523 | | ${prefix}= | Set Variable | 64
524 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
525 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
526 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
527 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
528 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:1::1 | ${prefix}
529 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:3::1 | ${prefix}
530 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:3::2 | ${prefix}
531 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | 2001:2::1 | ${prefix}
532 | | Suppress ICMPv6 router advertisement message | ${nodes}
533 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
534 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
535 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:3::2 | ${dut2_if1_mac}
536 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:3::1 | ${dut1_if2_mac}
537 | | Vpp Route Add | ${dut1} | 2001:2::0 | ${prefix} | 2001:3::2 | ${dut1_if2}
538 | | Vpp Route Add | ${dut2} | 2001:1::0 | ${prefix} | 2001:3::1 | ${dut2_if1}
539
540 | Initialize IPv6 forwarding with scaling in 3-node circular topology
541 | | [Documentation]
542 | | ... | Custom setup of IPv6 topology with scalability of ip routes on all
543 | | ... | DUT nodes in 3-node circular topology
544 | | ...
545 | | ... | *Arguments:*
546 | | ... | - ${count} - IP route count. Type: integer
547 | | ...
548 | | ... | *Return:*
549 | | ... | - No value returned
550 | | ...
551 | | ... | *Example:*
552 | | ...
553 | | ... | \| Initialize IPv6 forwarding with scaling in 3-node circular \
554 | | ... | topology \| 100000 \|
555 | | ...
556 | | [Arguments] | ${count}
557 | | ...
558 | | ${subn_prefix}= | Set Variable | 64
559 | | ${host_prefix}= | Set Variable | 128
560 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:3::1 | ${subn_prefix}
561 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:4::1 | ${subn_prefix}
562 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:4::2 | ${subn_prefix}
563 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | 2001:5::1 | ${subn_prefix}
564 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
565 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
566 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
567 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
568 | | Suppress ICMPv6 router advertisement message | ${nodes}
569 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:3::2 | ${tg1_if1_mac}
570 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:4::2 | ${dut2_if1_mac}
571 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:4::1 | ${dut1_if2_mac}
572 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:5::2 | ${tg1_if2_mac}
573 | | Vpp Route Add | ${dut1} | 2001:2::0 | ${host_prefix} | 2001:4::2
574 | | ... | interface=${dut1_if2} | count=${count}
575 | | Vpp Route Add | ${dut1} | 2001:1::0 | ${host_prefix} | 2001:3::2
576 | | ... | interface=${dut1_if1} | count=${count}
577 | | Vpp Route Add | ${dut2} | 2001:1::0 | ${host_prefix} | 2001:4::1
578 | | ... | interface=${dut2_if1} | count=${count}
579 | | Vpp Route Add | ${dut2} | 2001:2::0 | ${host_prefix} | 2001:5::2
580 | | ... | interface=${dut2_if2} | count=${count}
581
582 | Initialize IPv6 iAcl whitelist in 3-node circular topology
583 | | [Documentation]
584 | | ... | Creates classify L3 table on DUTs. IPv6 iAcl security whitelist
585 | | ... | ingress /64 filter entries applied on links TG - DUT1 and DUT2 - TG.
586 | | ...
587 | | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3
588 | | ... | ${dut1} | ip6 | dst
589 | | And Vpp Configures Classify Session L3
590 | | ... | ${dut1} | permit | ${table_idx} | ${skip_n} | ${match_n}
591 | | ... | ip6 | dst | 2001:2::2
592 | | And Vpp Enable Input Acl Interface
593 | | ... | ${dut1} | ${dut1_if1} | ip6 | ${table_idx}
594 | | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3
595 | | ... | ${dut2} | ip6 | dst
596 | | And Vpp Configures Classify Session L3
597 | | ... | ${dut2} | permit | ${table_idx} | ${skip_n} | ${match_n}
598 | | ... | ip6 | dst | 2001:1::2
599 | | And Vpp Enable Input Acl Interface
600 | | ... | ${dut2} | ${dut2_if2} | ip6 | ${table_idx}
601
602 | Initialize IPv6 forwarding over SRv6 with encapsulation with '${n}' x SID '${prepos}' decapsulation in 3-node circular topology
603 | | [Documentation]
604 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
605 | | ... | topology. Get the interface MAC addresses and setup neighbours on all
606 | | ... | VPP interfaces. Setup IPv6 addresses on all interfaces. Set segment
607 | | ... | routing for IPv6 for required number of SIDs and configure IPv6 routes
608 | | ... | on both DUT nodes.
609 | | ...
610 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
611 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
612 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
613 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
614 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_if1_ip6} | ${prefix}
615 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_if2_ip6} | ${prefix}
616 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_if1_ip6} | ${prefix}
617 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_if2_ip6} | ${prefix}
618 | | Suppress ICMPv6 router advertisement message | ${nodes}
619 | | :FOR | ${number} | IN RANGE | 2 | ${dst_addr_nr}+2
620 | | | ${hexa_nr}= | Convert To Hex | ${number}
621 | | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | ${tg_if1_ip6_subnet}${hexa_nr}
622 | | | ... | ${tg1_if1_mac}
623 | | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | ${tg_if2_ip6_subnet}${hexa_nr}
624 | | | ... | ${tg1_if2_mac}
625 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_if1_ip6} | ${dut2_if1_mac}
626 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_if2_ip6} | ${dut1_if2_mac}
627 | | ${sid1}= | Set Variable If
628 | | ... | "${n}" == "1" | ${dut2_sid1}
629 | | ... | "${n}" == "2" | ${dut2_sid1_1}
630 | | ${sid2}= | Set Variable If
631 | | ... | "${n}" == "1" | ${dut1_sid2}
632 | | ... | "${n}" == "2" | ${dut1_sid2_1}
633 | | Vpp Route Add | ${dut1} | ${sid1} | ${sid_prefix} | ${dut2_if1_ip6}
634 | | ... | ${dut1_if2}
635 | | Vpp Route Add | ${dut2} | ${sid2} | ${sid_prefix} | ${dut1_if2_ip6}
636 | | ... | ${dut2_if1}
637 | | Set SR Encaps Source Address on DUT | ${dut1} | ${dut1_sid1}
638 | | @{sid_list_dir0}= | Run Keyword If | "${n}" == "1"
639 | | ... | Create List | ${dut2_sid1}
640 | | ... | ELSE IF | "${n}" == "2"
641 | | ... | Create List | ${dut2_sid1_1} | ${dut2_sid1_2}
642 | | Configure SR Policy on DUT | ${dut1} | ${dut1_bsid} | encap
643 | | ... | @{sid_list_dir0}
644 | | Configure SR Steer on DUT | ${dut1} | L3 | ${dut1_bsid}
645 | | ... | ip_addr=${tg_if2_ip6_subnet} | prefix=${sid_prefix}
646 | | Run Keyword If | "${n}" == "1"
647 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.dx6
648 | | ... | interface=${dut2_if2} | next_hop=${tg_if2_ip6_subnet}2
649 | | Run Keyword If | "${n}" == "2"
650 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1_1} | end
651 | | Run Keyword If | "${n}" == "2" and "${prepos}" != "without"
652 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1_2} | end.dx6
653 | | ... | interface=${dut2_if2} | next_hop=${tg_if2_ip6_subnet}2
654 | | Run Keyword If | "${n}" == "2" and "${prepos}" == "without"
655 | | ... | Vpp Route Add | ${dut2} | ${dut2_sid1_2} | ${sid_prefix}
656 | | ... | ${tg_if2_ip6_subnet}2 | ${dut2_if2}
657 | | Set SR Encaps Source Address on DUT | ${dut2} | ${dut2_sid2}
658 | | @{sid_list_dir1}= | Run Keyword If | "${n}" == "1"
659 | | ... | Create List | ${dut1_sid2}
660 | | ... | ELSE IF | "${n}" == "2"
661 | | ... | Create List | ${dut1_sid2_1} | ${dut1_sid2_2}
662 | | Configure SR Policy on DUT | ${dut2} | ${dut2_bsid} | encap
663 | | ... | @{sid_list_dir1}
664 | | Configure SR Steer on DUT | ${dut2} | L3 | ${dut2_bsid}
665 | | ... | ip_addr=${tg_if1_ip6_subnet} | prefix=${sid_prefix}
666 | | Run Keyword If | "${n}" == "1"
667 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.dx6
668 | | ... | interface=${dut1_if1} | next_hop=${tg_if1_ip6_subnet}2
669 | | Run Keyword If | "${n}" == "2"
670 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2_1} | end
671 | | Run Keyword If | "${n}" == "2" and "${prepos}" != "without"
672 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2_2} | end.dx6
673 | | ... | interface=${dut1_if1} | next_hop=${tg_if1_ip6_subnet}2
674 | | Run Keyword If | "${n}" == "2" and "${prepos}" == "without"
675 | | ... | Vpp Route Add | ${dut1} | ${dut1_sid2_2} | ${sid_prefix}
676 | | ... | ${tg_if1_ip6_subnet}2 | ${dut1_if1}
677
678 | Initialize L2 xconnect in 3-node circular topology
679 | | [Documentation]
680 | | ... | Setup L2 xconnect topology by cross connecting two interfaces on
681 | | ... | each DUT. Interfaces are brought up.
682 | | ... |
683 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1_if2}
684 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
685 | | All Vpp Interfaces Ready Wait | ${nodes}
686
687 | Initialize L2 xconnect with VXLANoIPv4 in 3-node circular topology
688 | | [Documentation]
689 | | ... | Setup L2 xconnect topology with VXLANoIPv4 by cross connecting
690 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
691 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
692 | | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as
693 | | ... | interfaces.
694 | | ...
695 | | Set interfaces in path in 3-node circular topology up
696 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1 | 24
697 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2 | 24
698 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
699 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
700 | | Add arp on dut | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac}
701 | | Add arp on dut | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac}
702 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
703 | | ... | 172.16.0.1 | 172.16.0.2
704 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1s_vxlan}
705 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
706 | | ... | 172.16.0.2 | 172.16.0.1
707 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${dut2s_vxlan}
708
709 | Initialize L2 xconnect with Vhost-User in 3-node circular topology
710 | | [Documentation]
711 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Cross
712 | | ... | connect each Vhost interface with one physical interface.
713 | | ...
714 | | ... | *Arguments:*
715 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
716 | | ... | - sock2 - Socket path for second Vhost-User interface. Type: string
717 | | ...
718 | | ... | _NOTE:_ This KW uses following test case variables:
719 | | ... | - ${dut1} - DUT1 node.
720 | | ... | - ${dut2} - DUT2 node.
721 | | ... | - ${dut1_if1} - DUT1 interface towards TG.
722 | | ... | - ${dut1_if2} - DUT1 interface towards DUT2.
723 | | ... | - ${dut2_if1} - DUT2 interface towards DUT1.
724 | | ... | - ${dut2_if2} - DUT2 interface towards TG.
725 | | ...
726 | | ... | *Example:*
727 | | ...
728 | | ... | \| L2 xconnect with Vhost-User initialized in a 3-node \
729 | | ... | circular topology \| /tmp/sock1 \| /tmp/sock2 \|
730 | | ...
731 | | [Arguments] | ${sock1} | ${sock2}
732 | | ...
733 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
734 | | ... | ${sock1} | ${sock2} | dut1_vhost_if1 | dut1_vhost_if2
735 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1_vhost_if1}
736 | | Configure L2XC | ${dut1} | ${dut1_if2} | ${dut1_vhost_if2}
737 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
738 | | ... | ${sock1} | ${sock2} | dut2_vhost_if1 | dut2_vhost_if2
739 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_vhost_if1}
740 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${dut2_vhost_if2}
741
742 | Initialize L2 xconnect with Vhost-User for '${nr}' in 3-node circular topology
743 | | [Documentation]
744 | | ... | Create pairs of Vhost-User interfaces on all defined VPP nodes. Cross
745 | | ... | connect each Vhost interface with one physical interface or virtual
746 | | ... | interface to create a chain accross DUT node.
747 | | ...
748 | | ... | *Arguments:*
749 | | ... | _None_
750 | | ...
751 | | ... | *Note:*
752 | | ... | Socket paths for VM are defined in following format:
753 | | ... | - /tmp/sock-${VM_ID}-1
754 | | ... | - /tmp/sock-${VM_ID}-2
755 | | ...
756 | | ... | *Example:*
757 | | ...
758 | | ... | \| L2 xconnect with Vhost-User for '2' initialized in a 3-node \
759 | | ... | circular topology \|
760 | | ...
761 | | :FOR | ${number} | IN RANGE | 1 | ${nr}+1
762 | | | ${sock1}= | Set Variable | /tmp/sock-${number}-1
763 | | | ${sock2}= | Set Variable | /tmp/sock-${number}-2
764 | | | ${prev_index}= | Evaluate | ${number}-1
765 | | | Configure vhost interfaces for L2BD forwarding | ${dut1}
766 | | | ... | ${sock1} | ${sock2} | dut1-vhost-${number}-if1
767 | | | ... | dut1-vhost-${number}-if2
768 | | | ${dut1_xconnect_if1}= | Set Variable If | ${number}==1 | ${dut1_if1}
769 | | | ... | ${dut1-vhost-${prev_index}-if2}
770 | | | Configure L2XC | ${dut1} | ${dut1_xconnect_if1}
771 | | | ... | ${dut1-vhost-${number}-if1}
772 | | | Configure vhost interfaces for L2BD forwarding | ${dut2}
773 | | | ... | ${sock1} | ${sock2} | dut2-vhost-${number}-if1
774 | | | ... | dut2-vhost-${number}-if2
775 | | | ${dut2_xconnect_if1}= | Set Variable If | ${number}==1 | ${dut2_if1}
776 | | | ... | ${dut2-vhost-${prev_index}-if2}
777 | | | Configure L2XC | ${dut2} | ${dut2_xconnect_if1}
778 | | | ... | ${dut2-vhost-${number}-if1}
779 | | | Run Keyword If | ${number}==${nr} | Configure L2XC
780 | | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | ${dut1_if2}
781 | | | Run Keyword If | ${number}==${nr} | Configure L2XC
782 | | | ... | ${dut2} | ${dut2-vhost-${number}-if2} | ${dut2_if2}
783
784 | Initialize L2 xconnect with Vhost-User and VLAN in 3-node circular topology
785 | | [Documentation]
786 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Cross
787 | | ... | connect each Vhost interface with one physical interface.
788 | | ... | Setup VLAN between DUTs. All interfaces are brought up.
789 | | ...
790 | | ... | *Arguments:*
791 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
792 | | ... | - sock2 - Socket path for second Vhost-User interface. Type: string
793 | | ... | - subid - ID of the sub-interface to be created. Type: string
794 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
795 | | ...
796 | | ... | *Example:*
797 | | ...
798 | | ... | \| L2 xconnect with Vhost-User and VLAN initialized in a 3-node\
799 | | ... | circular topology \| /tmp/sock1 \| /tmp/sock2 \| 10 \| pop-1 \|
800 | | ...
801 | | [Arguments] | ${sock1} | ${sock2} | ${subid} | ${tag_rewrite}
802 | | ...
803 | | Set interfaces in path in 3-node circular topology up
804 | | Initialize VLAN dot1q sub-interfaces in 3-node circular topology
805 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
806 | | Configure L2 tag rewrite method on interfaces
807 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
808 | | ... | ${tag_rewrite}
809 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
810 | | ... | ${sock1} | ${sock2}
811 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1}
812 | | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2}
813 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
814 | | ... | ${sock1} | ${sock2}
815 | | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1}
816 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2}
817
818 | Initialize L2 bridge domain in 3-node circular topology
819 | | [Documentation]
820 | | ... | Setup L2 DB topology by adding two interfaces on each DUT into BD
821 | | ... | that is created automatically with index 1. Learning is enabled.
822 | | ... | Interfaces are brought up.
823 | | ...
824 | | ... | *Arguments:*
825 | | ... | - bd_id - Bridge domain ID. Type: integer
826 | | ...
827 | | ... | *Example:*
828 | | ...
829 | | ... | \| Initialize L2 bridge domain in 3-node circular topology \| 1 \|
830 | | ...
831 | | [Arguments] | ${bd_id}=${1}
832 | | ...
833 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id}
834 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id}
835 | | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${bd_id}
836 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id}
837 | | All Vpp Interfaces Ready Wait | ${nodes}
838
839 | Configure IPv4 ACLs
840 | | [Documentation]
841 | | ... | Configure ACL with required number of not-hitting permit ACEs plus two
842 | | ... | hitting ACEs for both traffic directions.
843 | | ...
844 | | ... | *Arguments:*
845 | | ... | - dut_node - DUT node. Type: dictionary
846 | | ... | - dut_if1 - DUT node interface1 name (Optional). Type: string
847 | | ... | - dut_if2 - DUT node interface2 name (Optional). Type: string
848 | | ...
849 | | ... | *Example:*
850 | | ...
851 | | ... | \| Configure IPv4 ACLs \| ${nodes['DUT1']} \| GigabitEthernet0/7/0 \
852 | | ... | \| GigabitEthernet0/8/0 \|
853 | | ...
854 | | ... | _NOTE:_ This KW uses following test case variables:
855 | | ... | - ${src_ip_start} - Source IP address start. Type: string
856 | | ... | - ${dst_ip_start} - Destination IP address start. Type: string
857 | | ... | - ${ip_step} - IP address step. Type: string
858 | | ... | - ${sport_start} - Source port number start. Type: string
859 | | ... | - ${dport_start} - Destination port number start. Type: string
860 | | ... | - ${port_step} - Port number step. Type: string
861 | | ... | - ${no_hit_aces_number} - Number of not-hitting ACEs to be configured.
862 | | ... | Type: integer
863 | | ... | - ${acl_apply_type} - To what path apply the ACL - input or output.
864 | | ... | Type: string
865 | | ... | - ${acl_action} - Action for the rule - deny, permit, permit+reflect.
866 | | ... | Type: string
867 | | ... | - ${trex_stream1_subnet} - IP subnet used by T-Rex in direction 0->1.
868 | | ... | Type: string
869 | | ... | - ${trex_stream2_subnet} - IP subnet used by T-Rex in direction 1->0.
870 | | ... | Type: string
871 | | ...
872 | | [Arguments] | ${dut} | ${dut_if1}=${None} | ${dut_if2}=${None}
873 | | ${src_ip_int} = | Evaluate
874 | | ... | int(ipaddress.ip_address(unicode($src_ip_start))) - $ip_step
875 | | ... | modules=ipaddress
876 | | ${dst_ip_int} = | Evaluate
877 | | ... | int(ipaddress.ip_address(unicode($dst_ip_start))) - $ip_step
878 | | ... | modules=ipaddress
879 | | ${ip_limit} = | Set Variable | 255.255.255.255
880 | | ${ip_limit_int} = | Evaluate
881 | | ... | int(ipaddress.ip_address(unicode($ip_limit))) | modules=ipaddress
882 | | ${sport}= | Evaluate | $sport_start - $port_step
883 | | ${dport}= | Evaluate | $dport_start - $port_step
884 | | ${port_limit}= | Set Variable | ${65535}
885 | | ${acl}= | Set Variable | ipv4 permit
886 | | :FOR | ${nr} | IN RANGE | 0 | ${no_hit_aces_number}
887 | |      | ${src_ip_int} = | Evaluate | $src_ip_int + $ip_step
888 | |      | ${dst_ip_int} = | Evaluate | $dst_ip_int + $ip_step
889 | |      | ${sport}= | Evaluate | $sport + $port_step
890 | |      | ${dport}= | Evaluate | $dport + $port_step
891 | |      | ${ipv4_limit_reached}= | Set Variable If
892 | |      | ... | $src_ip_int > $ip_limit_int or $src_ip_int > $ip_limit_int
893 | |      | ... | ${True}
894 | |      | ${udp_limit_reached}= | Set Variable If
895 | |      | ... | $sport > $port_limit or $dport > $port_limit | ${True}
896 | |      | Run Keyword If | $ipv4_limit_reached is True | Log
897 | |      | ... | Can't do more iterations - IPv4 address limit has been reached.
898 | |      | ... | WARN
899 | |      | Run Keyword If | $udp_limit_reached is True | Log
900 | |      | ... | Can't do more iterations - UDP port limit has been reached.
901 | |      | ... | WARN
902 | |      | ${src_ip} = | Run Keyword If | $ipv4_limit_reached is True
903 | |      | ... | Set Variable | ${ip_limit}
904 | |      | ... | ELSE | Evaluate | str(ipaddress.ip_address($src_ip_int))
905 | |      | ... | modules=ipaddress
906 | |      | ${dst_ip} = | Run Keyword If | $ipv4_limit_reached is True
907 | |      | ... | Set Variable | ${ip_limit}
908 | |      | ... | ELSE | Evaluate | str(ipaddress.ip_address($dst_ip_int))
909 | |      | ... | modules=ipaddress
910 | |      | ${sport}= | Set Variable If | ${sport} > $port_limit | $port_limit
911 | |      | ... | ${sport}
912 | |      | ${dport}= | Set Variable If | ${dport} > $port_limit | $port_limit
913 | |      | ... | ${dport}
914 | |      | ${acl}= | Catenate | ${acl} | src ${src_ip}/32 dst ${dst_ip}/32
915 | |      | ... | sport ${sport} | dport ${dport},
916 | |      | Exit For Loop If
917 | |      | ... | $ipv4_limit_reached is True or $udp_limit_reached is True
918 | | ${acl}= | Catenate | ${acl}
919 | | ...     | ipv4 ${acl_action} src ${trex_stream1_subnet},
920 | | ...     | ipv4 ${acl_action} src ${trex_stream2_subnet}
921 | | Add Replace Acl Multi Entries | ${dut} | rules=${acl}
922 | | @{acl_list}= | Create List | ${0}
923 | | Run Keyword If | 'input' in $acl_apply_type and $dut_if1 is not None
924 | | ... | Set Acl List For Interface | ${dut} | ${dut_if1} | input | ${acl_list}
925 | | Run Keyword If | 'input' in $acl_apply_type and $dut_if2 is not None
926 | | ... | Set Acl List For Interface | ${dut} | ${dut_if2} | input | ${acl_list}
927 | | Run Keyword If | 'output' in $acl_apply_type and $dut_if1 is not None
928 | | ... | Set Acl List For Interface | ${dut} | ${dut_if1} | output
929 | | ... | ${acl_list}
930 | | Run Keyword If | 'output' in $acl_apply_type and $dut_if2 is not None
931 | | ... | Set Acl List For Interface | ${dut} | ${dut_if2} | output
932 | | ... | ${acl_list}
933
934 | Initialize L2 bridge domain with IPv4 ACLs on DUT1 in 3-node circular topology
935 | | [Documentation]
936 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
937 | | ... | domain that is created automatically with index 1. Learning is
938 | | ... | enabled. Interfaces are brought up. Apply required ACL rules to DUT1
939 | | ... | interfaces.
940 | | ...
941 | | ... | *Arguments:*
942 | | ... | _None_
943 | | ...
944 | | ... | *Example:*
945 | | ...
946 | | ... | \| Initialize L2 bridge domain with IPv4 ACLs on DUT1 in 3-node \
947 | | ... | circular topology \|
948 | | ...
949 | | ... | _NOTE:_ This KW uses following test case variables:
950 | | ... | - ${dut1} - DUT1 node.
951 | | ... | - ${dut2} - DUT2 node.
952 | | ... | - ${dut1_if1} - DUT1 interface towards TG.
953 | | ... | - ${dut1_if2} - DUT1 interface towards DUT2.
954 | | ... | - ${dut2_if1} - DUT2 interface towards DUT1.
955 | | ... | - ${dut2_if2} - DUT2 interface towards TG.
956 | | ...
957 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1_if2}
958 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
959 | | All Vpp Interfaces Ready Wait | ${nodes}
960 | | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
961
962 | Initialize IPv4 routing for '${ip_nr}' addresses with IPv4 ACLs on DUT1 in 3-node circular topology
963 | | [Documentation]
964 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
965 | | ... | topology. Get the interface MAC addresses and setup ARP on all VPP
966 | | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG links and
967 | | ... | /30 prefix on DUT1-DUT2 link. Set routing on both DUT nodes with
968 | | ... | prefix /24 and next hops of neighbour DUT interface IPv4 address.
969 | | ... | Apply required ACL rules to DUT1 interfaces.
970 | | ...
971 | | ... | *Arguments:*
972 | | ... | - ip_nr - Number of IPs to be used. Type: integer or string
973 | | ...
974 | | ... | *Example:*
975 | | ...
976 | | ... | \| Initialize IPv4 routing for '10' addresses with IPv4 ACLs on DUT1 \
977 | | ... | in 3-node circular topology \|
978 | | ...
979 | | ... | _NOTE:_ This KW uses following test case variables:
980 | | ... | - ${dut1} - DUT1 node.
981 | | ... | - ${dut2} - DUT2 node.
982 | | ... | - ${dut1_if1} - DUT1 interface towards TG.
983 | | ... | - ${dut1_if2} - DUT1 interface towards DUT2.
984 | | ... | - ${dut2_if1} - DUT2 interface towards DUT1.
985 | | ... | - ${dut2_if2} - DUT2 interface towards TG.
986 | | ...
987 | | Set Interface State | ${dut1} | ${dut1_if1} | up
988 | | Set Interface State | ${dut1} | ${dut1_if2} | up
989 | | Set Interface State | ${dut2} | ${dut2_if1} | up
990 | | Set Interface State | ${dut2} | ${dut2_if2} | up
991 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
992 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
993 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
994 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
995 | | :FOR | ${number} | IN RANGE | 2 | ${ip_nr}+2
996 | | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.${number}
997 | | | ... | ${tg1_if1_mac}
998 | | | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.${number}
999 | | | ... | ${tg1_if2_mac}
1000 | | Add arp on dut | ${dut1} | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
1001 | | Add arp on dut | ${dut2} | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
1002 | | Configure IP addresses on interfaces
1003 | | ... | ${dut1} | ${dut1_if1} | 10.10.10.1 | 24
1004 | | ... | ${dut1} | ${dut1_if2} | 1.1.1.1 | 30
1005 | | ... | ${dut2} | ${dut2_if1} | 1.1.1.2 | 30
1006 | | ... | ${dut2} | ${dut2_if2} | 20.20.20.1 | 24
1007 | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 1.1.1.2 | ${dut1_if2}
1008 | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | 1.1.1.1 | ${dut2_if1}
1009 | | All Vpp Interfaces Ready Wait | ${nodes}
1010 | | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
1011
1012 | Configure MACIP ACLs
1013 | | [Documentation]
1014 | | ... | Configure MACIP ACL with required number of not-hitting permit ACEs
1015 | | ... | plus two hitting ACEs for both traffic directions.
1016 | | ...
1017 | | ... | *Arguments:*
1018 | | ... | - dut_node - DUT node. Type: dictionary
1019 | | ... | - dut_if1 - DUT node interface1 name (Optional). Type: string
1020 | | ... | - dut_if2 - DUT node interface2 name (Optional). Type: string
1021 | | ...
1022 | | ... | *Example:*
1023 | | ...
1024 | | ... | \| Configure MACIP ACLs \| ${nodes['DUT1']} \| GigabitEthernet0/7/0 \
1025 | | ... | \| GigabitEthernet0/8/0 \|
1026 | | ...
1027 | | ... | _NOTE:_ This KW uses following test case variables:
1028 | | ... | - ${src_ip_start} - Source IP address start. Type: string
1029 | | ... | - ${ip_step} - IP address step. Type: string
1030 | | ... | - ${src_mac_start} - Source MAC address start in format with colons.
1031 | | ... | Type: string
1032 | | ... | - ${src_mac_step} - Source MAC address step. Type: string
1033 | | ... | - ${src_mac_mask} - Source MAC address mask. 00:00:00:00:00:00 is a
1034 | | ... | wildcard mask. Type: string
1035 | | ... | - ${no_hit_aces_number} - Number of not-hitting ACEs to be configured.
1036 | | ... | Type: integer
1037 | | ... | - ${acl_action} - Action for the rule - deny, permit, permit+reflect.
1038 | | ... | Type: string
1039 | | ... | - ${tg_stream1_subnet} - IP subnet used by TG in direction 0->1.
1040 | | ... | Type: string
1041 | | ... | - ${tg_stream2_subnet} - IP subnet used by TG in direction 1->0.
1042 | | ... | Type: string
1043 | | ... | - ${tg_stream1_mac} - Source MAC address of traffic stream 1.
1044 | | ... | Type: string
1045 | | ... | - ${tg_stream2_mac} - Source MAC address of traffic stream 2.
1046 | | ... | Type: string
1047 | | ... | - ${tg_mac_mask} - MAC address mask for traffic streams.
1048 | | ... | 00:00:00:00:00:00 is a wildcard mask. Type: string
1049 | | ...
1050 | | [Arguments] | ${dut} | ${dut_if1}=${None} | ${dut_if2}=${None}
1051 | | ...
1052 | | ${src_ip_int} = | IP To Int | ${src_ip_start}
1053 | | ${src_ip_int} = | Evaluate | ${src_ip_int} - ${ip_step}
1054 | | ...
1055 | | ${ip_limit} = | Set Variable | 255.255.255.255
1056 | | ${ip_limit_int} = | IP To Int | ${ip_limit}
1057 | | ...
1058 | | ${src_mac_int} = | Mac To Int | ${src_mac_start}
1059 | | ${src_mac_int} = | Evaluate | ${src_mac_int} - ${src_mac_step}
1060 | | ...
1061 | | ${mac_limit} = | Set Variable | ff:ff:ff:ff:ff:ff
1062 | | ${mac_limit_int} = | Mac To Int | ${mac_limit}
1063 | | ...
1064 | | ${acl}= | Set Variable | ipv4 permit
1065 | | :FOR | ${nr} | IN RANGE | 0 | ${no_hit_aces_number}
1066 | | | ${src_ip_int} = | Evaluate | ${src_ip_int} + ${ip_step}
1067 | | | ${src_mac_int} = | Evaluate | ${src_mac_int} + ${src_mac_step}
1068 | | | ${ipv4_limit_reached}= | Set Variable If
1069 | | | ... | ${src_ip_int} > ${ip_limit_int} | ${TRUE}
1070 | | | ${mac_limit_reached}= | Set Variable If
1071 | | | ... | ${src_mac_int} > ${mac_limit_int} | ${TRUE}
1072 | | | Run Keyword If | '${ipv4_limit_reached}' == '${TRUE}' | Log
1073 | | | ... | Can't do more iterations - IPv4 address limit has been reached.
1074 | | | ... | WARN
1075 | | | Run Keyword If | '${mac_limit_reached}' == '${TRUE}' | Log
1076 | | | ... | Can't do more iterations - MAC address limit has been reached.
1077 | | | ... | WARN
1078 | | | ${src_ip} = | Run Keyword If | '${ipv4_limit_reached}' == '${TRUE}'
1079 | | | ... | Set Variable | ${ip_limit}
1080 | | | ... | ELSE | Int To IP | ${src_ip_int}
1081 | | | ${src_mac}= | Run Keyword If | '${mac_limit_reached}' == '${TRUE}'
1082 | | | ... | Set Variable | ${mac_limit}
1083 | | | ... | ELSE | Int To Mac | ${src_mac_int}
1084 | | | ${acl}= | Catenate | ${acl} | ip ${src_ip}/32
1085 | | | ... | mac ${src_mac} | mask ${src_mac_mask},
1086 | | | Exit For Loop If | '${ipv4_limit_reached}' == '${TRUE}' or '${mac_limit_reached}' == '${TRUE}'
1087 | | ${acl0}= | Catenate | ${acl}
1088 | | ... | ipv4 ${acl_action} ip ${tg_stream1_subnet} mac ${tg_stream1_mac}
1089 | | ... | mask ${tg_mac_mask}
1090 | | ${acl1}= | Catenate | ${acl}
1091 | | ... | ipv4 ${acl_action} ip ${tg_stream2_subnet} mac ${tg_stream2_mac}
1092 | | ... | mask ${tg_mac_mask}
1093 | | Add Macip Acl Multi Entries | ${dut} | rules=${acl0}
1094 | | Add Macip Acl Multi Entries | ${dut} | rules=${acl1}
1095 | | ${acl_idx}= | Set Variable | 0
1096 | | Run Keyword Unless | '${dut_if1}' == '${NONE}'
1097 | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if1} | add | ${acl_idx}
1098 | | ${acl_idx}= | Set Variable | 1
1099 | | Run Keyword Unless | '${dut_if2}' == '${NONE}'
1100 | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if2} | add | ${acl_idx}
1101
1102 | Initialize L2 bridge domain with MACIP ACLs on DUT1 in 3-node circular topology
1103 | | [Documentation]
1104 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
1105 | | ... | domain that is created automatically with index 1. Learning is
1106 | | ... | enabled. Interfaces are brought up. Apply required MACIP ACL rules to
1107 | | ... | DUT1 interfaces.
1108 | | ...
1109 | | ... | *Arguments:*
1110 | | ... | _None_
1111 | | ...
1112 | | ... | *Example:*
1113 | | ...
1114 | | ... | \| Initialize L2 bridge domain with MACIP ACLs on DUT1 in 3-node \
1115 | | ... | circular topology \|
1116 | | ...
1117 | | ... | _NOTE 1:_ This KW uses following test case variables:
1118 | | ... | - ${tg} - TG node.
1119 | | ... | - ${dut1} - DUT1 node.
1120 | | ... | - ${dut2} - DUT2 node.
1121 | | ... | - ${tg_if1} - TG interface towards DUT1.
1122 | | ... | - ${tg_if2} - TG interface towards DUT2.
1123 | | ... | - ${dut1_if1} - DUT1 interface towards TG.
1124 | | ... | - ${dut1_if2} - DUT1 interface towards DUT2.
1125 | | ... | - ${dut2_if1} - DUT2 interface towards DUT1.
1126 | | ... | - ${dut2_if2} - DUT2 interface towards TG.
1127 | | ...
1128 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1_if2}
1129 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
1130 | | All Vpp Interfaces Ready Wait | ${nodes}
1131 | | Configure MACIP ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
1132
1133 | Initialize L2 bridge domains with Vhost-User in 3-node circular topology
1134 | | [Documentation]
1135 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
1136 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1137 | | ... | with physical inteface.
1138 | | ...
1139 | | ... | *Arguments:*
1140 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1141 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1142 | | ... | - sock1 - Sock path for the first Vhost-User interface. Type: string
1143 | | ... | - sock2 - Sock path for the second Vhost-User interface. Type: string
1144 | | ...
1145 | | ... | _NOTE:_ This KW uses following test case variables:
1146 | | ... | - ${dut1} - DUT1 node.
1147 | | ... | - ${dut2} - DUT2 node.
1148 | | ... | - ${dut1_if1} - DUT1 interface towards TG.
1149 | | ... | - ${dut1_if2} - DUT1 interface towards DUT2.
1150 | | ... | - ${dut2_if1} - DUT2 interface towards DUT1.
1151 | | ... | - ${dut2_if2} - DUT2 interface towards TG.
1152 | | ...
1153 | | ... | *Example:*
1154 | | ...
1155 | | ... | \| L2 bridge domains with Vhost-User initialized in a 3-node \
1156 | | ... | circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \|
1157 | | ...
1158 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2}
1159 | | ...
1160 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1161 | | ... | ${sock1} | ${sock2} | dut1_vhost_if1 | dut1_vhost_if2
1162 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1163 | | Add interface to bridge domain | ${dut1} | ${dut1_vhost_if1} | ${bd_id1}
1164 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id2}
1165 | | Add interface to bridge domain | ${dut1} | ${dut1_vhost_if2} | ${bd_id2}
1166 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1167 | | ... | ${sock1} | ${sock2} | dut2_vhost_if1 | dut2_vhost_if2
1168 | | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${bd_id1}
1169 | | Add interface to bridge domain | ${dut2} | ${dut2_vhost_if1} | ${bd_id1}
1170 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1171 | | Add interface to bridge domain | ${dut2} | ${dut2_vhost_if2} | ${bd_id2}
1172
1173 | Initialize L2 bridge domains with Vhost-User for '${nr}' VMs in 3-node circular topology
1174 | | [Documentation]
1175 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on all
1176 | | ... | defined VPP nodes. Add each Vhost-User interface into L2 bridge
1177 | | ... | domains with learning enabled with physical inteface or Vhost-User
1178 | | ... | interface of another VM.
1179 | | ...
1180 | | ... | *Arguments:*
1181 | | ... | _None_
1182 | | ...
1183 | | ... | *Note:*
1184 | | ... | Socket paths for VM are defined in following format:
1185 | | ... | - /tmp/sock-${VM_ID}-1
1186 | | ... | - /tmp/sock-${VM_ID}-2
1187 | | ...
1188 | | ... | *Example:*
1189 | | ...
1190 | | ... | \| L2 bridge domains with Vhost-User for '2' VMs initialized in \
1191 | | ... | a 3-node circular topology \|
1192 | | ...
1193 | | ${bd_id2}= | Evaluate | ${nr}+1
1194 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${1}
1195 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id2}
1196 | | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${1}
1197 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1198 | | :FOR | ${number} | IN RANGE | 1 | ${nr}+1
1199 | | | ${sock1}= | Set Variable | /tmp/sock-${number}-1
1200 | | | ${sock2}= | Set Variable | /tmp/sock-${number}-2
1201 | | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1202 | | | ... | ${sock1} | ${sock2} | dut1-vhost-${number}-if1
1203 | | | ... | dut1-vhost-${number}-if2
1204 | | | ${bd_id2}= | Evaluate | ${number}+1
1205 | | | Add interface to bridge domain | ${dut1}
1206 | | | ... | ${dut1-vhost-${number}-if1} | ${number}
1207 | | | Add interface to bridge domain | ${dut1}
1208 | | | ... | ${dut1-vhost-${number}-if2} | ${bd_id2}
1209 | | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1210 | | | ... | ${sock1} | ${sock2} | dut2-vhost-${number}-if1
1211 | | | ... | dut2-vhost-${number}-if2
1212 | | | Add interface to bridge domain | ${dut2}
1213 | | | ... | ${dut2-vhost-${number}-if1} | ${number}
1214 | | | Add interface to bridge domain | ${dut2}
1215 | | | ... | ${dut2-vhost-${number}-if2} | ${bd_id2}
1216
1217 | Initialize L2 bridge domain with VXLANoIPv4 in 3-node circular topology
1218 | | [Documentation]
1219 | | ... | Setup L2 bridge domain topology with VXLANoIPv4 by connecting
1220 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
1221 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
1222 | | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as
1223 | | ... | interfaces.
1224 | | ...
1225 | | Set interfaces in path in 3-node circular topology up
1226 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1
1227 | | ... | 24
1228 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2
1229 | | ... | 24
1230 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1231 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1232 | | Add arp on dut | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac}
1233 | | Add arp on dut | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac}
1234 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
1235 | | ... | 172.16.0.1 | 172.16.0.2
1236 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
1237 | | ... | 172.16.0.2 | 172.16.0.1
1238 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1s_vxlan}
1239 | | Configure L2BD forwarding | ${dut2} | ${dut2_if2} | ${dut2s_vxlan}
1240 | | All Vpp Interfaces Ready Wait | ${nodes}
1241
1242 | Initialize L2 bridge domains with Vhost-User and VXLANoIPv4 in 3-node circular topology
1243 | | [Documentation]
1244 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
1245 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1246 | | ... | with physical inteface.
1247 | | ... | Setup VXLANoIPv4 between DUTs by connecting physical and vxlan
1248 | | ... | interfaces on each DUT. All interfaces are brought up.
1249 | | ... | IPv4 addresses with prefix /24 are configured on interfaces between
1250 | | ... | DUTs. VXLAN sub-interfaces has same IPv4 address as interfaces.
1251 | | ...
1252 | | ... | *Arguments:*
1253 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1254 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1255 | | ... | - sock1 - Sock path for first Vhost-User interface. Type: string
1256 | | ... | - sock2 - Sock path for second Vhost-User interface. Type: string
1257 | | ...
1258 | | ... | *Example:*
1259 | | ...
1260 | | ... | \| L2 bridge domains with Vhost-User and VXLANoIPv4 initialized in a\
1261 | | ... | 3-node circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \|
1262 | | ...
1263 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2}
1264 | | ...
1265 | | Set interfaces in path in 3-node circular topology up
1266 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1
1267 | | ... | 24
1268 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2
1269 | | ... | 24
1270 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
1271 | | ... | 172.16.0.1 | 172.16.0.2
1272 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
1273 | | ... | 172.16.0.2 | 172.16.0.1
1274 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1275 | | ... | ${sock1} | ${sock2}
1276 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1277 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1278 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1279 | | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${bd_id2}
1280 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1281 | | ... | ${sock1} | ${sock2}
1282 | | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${bd_id1}
1283 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
1284 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
1285 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1286
1287 | Initialize L2 bridge domains with Vhost-User in 2-node circular topology
1288 | | [Documentation]
1289 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
1290 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1291 | | ... | with physical inteface.
1292 | | ...
1293 | | ... | *Arguments:*
1294 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1295 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1296 | | ... | - sock1 - Sock path for first Vhost-User interface. Type: string
1297 | | ... | - sock2 - Sock path for second Vhost-User interface. Type: string
1298 | | ...
1299 | | ... | *Example:*
1300 | | ...
1301 | | ... | \| L2 bridge domains with Vhost-User initialized in a 2-node \
1302 | | ... | circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \|
1303 | | ...
1304 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2}
1305 | | ...
1306 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1307 | | ... | ${sock1} | ${sock2}
1308 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1309 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1310 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id2}
1311 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1312
1313 | Initialize L2 bridge domains with VLAN dot1q sub-interfaces in a 3-node circular topology
1314 | | [Documentation]
1315 | | ... | Setup L2 bridge domain topology with learning enabled with VLAN
1316 | | ... | between DUTs by connecting physical and vlan interfaces on each DUT.
1317 | | ... | All interfaces are brought up.
1318 | | ...
1319 | | ... | *Arguments:*
1320 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1321 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1322 | | ... | - subid - ID of the sub-interface to be created. Type: string
1323 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1324 | | ...
1325 | | ... | _NOTE:_ This KW uses following test case variables:
1326 | | ... | - ${dut1} - DUT1 node.
1327 | | ... | - ${dut2} - DUT2 node.
1328 | | ... | - ${dut1_if2} - DUT1 interface towards DUT2.
1329 | | ... | - ${dut2_if1} - DUT2 interface towards DUT1.
1330 | | ...
1331 | | ... | *Example:*
1332 | | ...
1333 | | ... | \| Initialize L2 bridge domains with VLAN dot1q sub-interfaces
1334 | | ... | in a 3-node circular topology \| 1 \| 2 \| 10 \| pop-1 \|
1335 | | ...
1336 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
1337 | | ...
1338 | | Set interfaces in path in 3-node circular topology up
1339 | | Initialize VLAN dot1q sub-interfaces in 3-node circular topology
1340 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
1341 | | Configure L2 tag rewrite method on interfaces
1342 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1343 | | ... | ${tag_rewrite}
1344 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1345 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id1}
1346 | | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id2}
1347 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1348 | | All Vpp Interfaces Ready Wait | ${nodes}
1349
1350 | Initialize L2 bridge domains with Vhost-User and VLAN in a 3-node circular topology
1351 | | [Documentation]
1352 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
1353 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1354 | | ... | with physical inteface.
1355 | | ... | Setup VLAN between DUTs. All interfaces are brought up.
1356 | | ...
1357 | | ... | *Arguments:*
1358 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1359 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1360 | | ... | - sock1 - Sock path for first Vhost-User interface. Type: string
1361 | | ... | - sock2 - Sock path for second Vhost-User interface. Type: string
1362 | | ... | - subid - ID of the sub-interface to be created. Type: string
1363 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1364 | | ...
1365 | | ... | *Example:*
1366 | | ...
1367 | | ... | \| L2 bridge domains with Vhost-User and VLAN initialized in a 3-node\
1368 | | ... | circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \| 10\
1369 | | ... | pop-1 \|
1370 | | ...
1371 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2} | ${subid}
1372 | | ... | ${tag_rewrite}
1373 | | ...
1374 | | Set interfaces in path in 3-node circular topology up
1375 | | Initialize VLAN dot1q sub-interfaces in 3-node circular topology
1376 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
1377 | | Configure L2 tag rewrite method on interfaces
1378 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1379 | | ... | ${tag_rewrite}
1380 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1381 | | ... | ${sock1} | ${sock2}
1382 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1383 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1384 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1385 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
1386 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1387 | | ... | ${sock1} | ${sock2}
1388 | | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id1}
1389 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
1390 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
1391 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1392
1393 | Add PCI devices to DUTs in 3-node single link topology
1394 | | [Documentation]
1395 | | ... | Add PCI devices to VPP configuration file.
1396 | | ...
1397 | | ${dut1_if1_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if1}
1398 | | ${dut1_if2_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if2}
1399 | | ${dut2_if1_pci}= | Get Interface PCI Addr | ${dut2} | ${dut2_if1}
1400 | | ${dut2_if2_pci}= | Get Interface PCI Addr | ${dut2} | ${dut2_if2}
1401 | | Run keyword | DUT1.Add DPDK Dev | ${dut1_if1_pci} | ${dut1_if2_pci}
1402 | | Run keyword | DUT2.Add DPDK Dev | ${dut2_if1_pci} | ${dut2_if2_pci}
1403
1404 | Add PCI devices to DUTs in 2-node single link topology
1405 | | [Documentation]
1406 | | ... | Add PCI devices to VPP configuration file.
1407 | | ...
1408 | | ${dut1_if1_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if1}
1409 | | ${dut1_if2_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if2}
1410 | | Run keyword | DUT1.Add DPDK Dev | ${dut1_if1_pci} | ${dut1_if2_pci}
1411
1412 | Configure guest VM with dpdk-testpmd connected via vhost-user
1413 | | [Documentation]
1414 | | ... | Start QEMU guest with two vhost-user interfaces and interconnecting
1415 | | ... | DPDK testpmd. Qemu Guest uses by default 5 cores and 2048M. Testpmd
1416 | | ... | uses 5 cores (1 main core and 4 cores dedicated to io) mem-channel=4,
1417 | | ... | txq/rxq=256, burst=64, disable-hw-vlan, disable-rss,
1418 | | ... | driver usr/lib/librte_pmd_virtio.so and fwd mode is io.
1419 | | ...
1420 | | ... | *Arguments:*
1421 | | ... | - dut_node - DUT node to start guest VM on. Type: dictionary
1422 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
1423 | | ... | - sock2 - Socket path for second Vhost-User interface. Type: string
1424 | | ... | - vm_name - QemuUtil instance name. Type: string
1425 | | ... | - skip - Number of cpus which will be skipped. Type: integer
1426 | | ... | - count - Number of cpus which will be allocated for qemu.
1427 | | ... | Type: integer
1428 | | ... | - qemu_id - Qemu Id when starting more then one guest VM on DUT node.
1429 | | ... | Type: integer
1430 | | ...
1431 | | ... | *Example:*
1432 | | ...
1433 | | ... | \| Configure guest VM with dpdk-testpmd connected via vhost-user \
1434 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \| ${6} \
1435 | | ... | \| ${5} \|
1436 | | ... | \| Configure guest VM with dpdk-testpmd connected via vhost-user \
1437 | | ... | \| ${nodes['DUT1']} \| /tmp/sock-2-1 \| /tmp/sock-2-2 \| DUT1_VM2 \
1438 | | ... | \| qemu_id=${2} \|
1439 | | ...
1440 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} | ${skip}=${6}
1441 | | ... | ${count}=${5} | ${qemu_id}=${1}
1442 | | ...
1443 | | Import Library | resources.libraries.python.QemuUtils | qemu_id=${qemu_id}
1444 | | ... | WITH NAME | ${vm_name}
1445 | | ${serial_port}= | Evaluate | ${qemu_id} + ${4555}
1446 | | Run keyword | ${vm_name}.Qemu Set Serial Port | ${serial_port}
1447 | | ${ssh_fwd_port}= | Evaluate | ${qemu_id} + ${10021}
1448 | | Run keyword | ${vm_name}.Qemu Set Ssh Fwd Port | ${ssh_fwd_port}
1449 | | ${dut_numa}= | Get interfaces numa node | ${dut_node}
1450 | | ... | ${dut1_if1} | ${dut1_if2}
1451 | | ${skip_cnt}= | Evaluate | ${skip} + (${qemu_id} - 1) * ${count}
1452 | | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa}
1453 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${count} | smt_used=${False}
1454 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
1455 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
1456 | | ${apply_patch}= | Set Variable If | "${perf_qemu_qsz}" == "256" | ${False}
1457 | | ... | ${True}
1458 | | Run Keyword Unless | ${qemu_built} | ${vm_name}.Build QEMU | ${dut_node}
1459 | | ... | force_install=${True} | apply_patch=${apply_patch}
1460 | | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin}
1461 | | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
1462 | | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1
1463 | | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
1464 | | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image}
1465 | | ${vm}= | Run keyword | ${vm_name}.Qemu Start
1466 | | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus}
1467 | | Run keyword If | ${use_tuned_cfs} | ${vm_name}.Qemu Set Scheduler Policy
1468 | | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f | eal_mem_channels=4
1469 | | ... | pmd_fwd_mode=io | pmd_disable_hw_vlan=${True}
1470 | | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz}
1471 | | Return From Keyword | ${vm}
1472
1473 | Configure '${nr}' guest VMs with dpdk-testpmd connected via vhost-user in 3-node circular topology
1474 | | [Documentation]
1475 | | ... | Start QEMU guests with two vhost-user interfaces and interconnecting
1476 | | ... | DPDK testpmd for defined number of VMs on all defined VPP nodes.
1477 | | ...
1478 | | ... | *Arguments:*
1479 | | ... | _None_
1480 | | ...
1481 | | ... | _NOTE:_ This KW expects following test case variables to be set:
1482 | | ... | - ${system_cpus} - Number of CPUs allocated for OS itself.
1483 | | ... | - ${vpp_cpus} - Number of CPUs allocated for VPP.
1484 | | ... | - ${vm_cpus} - Number of CPUs to be allocated per QEMU instance.
1485 | | ...
1486 | | ... | *Example:*
1487 | | ...
1488 | | ... | \| Configure '2' guest VMs with dpdk-testpmd connected via vhost-user \
1489 | | ... | in 3-node circular topology \|
1490 | | ...
1491 | | :FOR | ${number} | IN RANGE | 1 | ${nr}+1
1492 | | | ${sock1}= | Set Variable | /tmp/sock-${number}-1
1493 | | | ${sock2}= | Set Variable | /tmp/sock-${number}-2
1494 | | | ${skip_cpus}= | Evaluate | ${vpp_cpus}+${system_cpus}
1495 | | | ${vm1}= | Configure guest VM with dpdk-testpmd connected via vhost-user
1496 | | | ... | ${dut1} | ${sock1} | ${sock2} | DUT1_VM${number}
1497 | | | ... | skip=${skip_cpus} | count=${vm_cpus} | qemu_id=${number}
1498 | | | Set To Dictionary | ${dut1_vm_refs} | DUT1_VM${number} | ${vm1}
1499 | | | ${vm2}= | Configure guest VM with dpdk-testpmd connected via vhost-user
1500 | | | ... | ${dut2} | ${sock1} | ${sock2} | DUT2_VM${number}
1501 | | | ... | skip=${skip_cpus} | count=${vm_cpus} | qemu_id=${number}
1502 | | | Set To Dictionary | ${dut2_vm_refs} | DUT2_VM${number} | ${vm2}
1503 | | | Run Keyword Unless | ${qemu_built} | Set Suite Variable | ${qemu_built}
1504 | | | ... | ${True}
1505
1506 | Configure guest VM with dpdk-testpmd using SMT connected via vhost-user
1507 | | [Documentation]
1508 | | ... | Start QEMU guest with two vhost-user interfaces and interconnecting
1509 | | ... | DPDK testpmd. Qemu Guest uses by default 5 cores and 2048M. Testpmd
1510 | | ... | uses 5 cores (1 main core and 4 cores dedicated to io) mem-channel=4,
1511 | | ... | txq/rxq=256, burst=64, disable-hw-vlan, disable-rss,
1512 | | ... | driver usr/lib/librte_pmd_virtio.so and fwd mode is io.
1513 | | ...
1514 | | ... | *Arguments:*
1515 | | ... | - dut_node - DUT node to start guest VM on. Type: dictionary
1516 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
1517 | | ... | - sock2 - Socket path for second Vhost-User interface. Type: string
1518 | | ... | - vm_name - QemuUtil instance name. Type: string
1519 | | ... | - skip - number of cpus which will be skipped. Type: int
1520 | | ... | - count - number of cpus which will be allocated for qemu. Type: int
1521 | | ...
1522 | | ... | *Example:*
1523 | | ...
1524 | | ... | \| Configure guest VM with dpdk-testpmd using SMT connected via \
1525 | | ... | vhost-user \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \
1526 | | ... | \| ${6} \| ${5} \|
1527 | | ...
1528 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} | ${skip}=${6}
1529 | | ... | ${count}=${5}
1530 | | ...
1531 | | Import Library | resources.libraries.python.QemuUtils
1532 | | ... | WITH NAME | ${vm_name}
1533 | | ${dut_numa}= | Get interfaces numa node | ${dut_node}
1534 | | ... | ${dut1_if1} | ${dut1_if2}
1535 | | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa}
1536 | | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${True}
1537 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
1538 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
1539 | | ${apply_patch}= | Set Variable If | "${perf_qemu_qsz}" == "256" | ${False}
1540 | | ... | ${True}
1541 | | Run Keyword Unless | ${qemu_built} | ${vm_name}.Build QEMU | ${dut_node}
1542 | | ... | force_install=${True} | apply_patch=${apply_patch}
1543 | | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin}
1544 | | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
1545 | | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1
1546 | | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
1547 | | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image}
1548 | | ${vm}= | Run keyword | ${vm_name}.Qemu Start
1549 | | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus}
1550 | | Run keyword If | ${use_tuned_cfs} | ${vm_name}.Qemu Set Scheduler Policy
1551 | | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f | eal_mem_channels=4
1552 | | ... | pmd_fwd_mode=io | pmd_disable_hw_vlan=${True}
1553 | | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz}
1554 | | Return From Keyword | ${vm}
1555
1556 | Configure guest VM with dpdk-testpmd-mac connected via vhost-user
1557 | | [Documentation]
1558 | | ... | Start QEMU guest with two vhost-user interfaces and interconnecting
1559 | | ... | DPDK testpmd. Qemu Guest uses by default 5 cores and 2048M. Testpmd
1560 | | ... | uses 5 cores (1 main core and 4 cores dedicated to io) mem-channel=4,
1561 | | ... | txq/rxq=256, burst=64, disable-hw-vlan, disable-rss,
1562 | | ... | driver usr/lib/librte_pmd_virtio.so and fwd mode is mac rewrite.
1563 | | ...
1564 | | ... | *Arguments:*
1565 | | ... | - dut_node - DUT node to start guest VM on. Type: dictionary
1566 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
1567 | | ... | - sock2 - Socket path for second Vhost-User interface. Type: string
1568 | | ... | - vm_name - QemuUtil instance name. Type: string
1569 | | ... | - eth0_mac - MAC address of first Vhost interface. Type: string
1570 | | ... | - eth1_mac - MAC address of second Vhost interface. Type: string
1571 | | ... | - skip - number of cpus which will be skipped. Type: integer
1572 | | ... | - count - number of cpus which will be allocated for qemu.
1573 | | ... | Type: integer
1574 | | ... | - qemu_id - Qemu Id when starting more then one guest VM on DUT node.
1575 | | ... | Type: integer
1576 | | ...
1577 | | ... | *Example:*
1578 | | ...
1579 | | ... | \| Configure guest VM with dpdk-testpmd-mac connected via vhost-user \
1580 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \
1581 | | ... | \| 00:00:00:00:00:01 \| 00:00:00:00:00:02 \| ${6} \| ${5} \|
1582 | | ... | \| Configure guest VM with dpdk-testpmd-mac connected via vhost-user \
1583 | | ... | \| ${nodes['DUT1']} \| /tmp/sock-2-1 \| /tmp/sock-2-2 \| DUT1_VM2 \
1584 | | ... | \| 00:00:00:00:02:01 \| 00:00:00:00:02:02 \| ${6} \| ${5} \
1585 | | ... | \| qemu_id=${2} \|
1586 | | ...
1587 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name}
1588 | | ... | ${eth0_mac} | ${eth1_mac} | ${skip}=${6} | ${count}=${5}
1589 | | ... | ${qemu_id}=${1}
1590 | | ...
1591 | | Import Library | resources.libraries.python.QemuUtils | qemu_id=${qemu_id}
1592 | | ... | WITH NAME | ${vm_name}
1593 | | ${serial_port}= | Evaluate | ${qemu_id} + ${4555}
1594 | | Run keyword | ${vm_name}.Qemu Set Serial Port | ${serial_port}
1595 | | ${ssh_fwd_port}= | Evaluate | ${qemu_id} + ${10021}
1596 | | Run keyword | ${vm_name}.Qemu Set Ssh Fwd Port | ${ssh_fwd_port}
1597 | | ${dut_numa}= | Get interfaces numa node | ${dut_node}
1598 | | ... | ${dut1_if1} | ${dut1_if2}
1599 | | ${skip_cnt}= | Evaluate | ${skip} + (${qemu_id} - 1) * ${count}
1600 | | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa}
1601 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${count} | smt_used=${False}
1602 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
1603 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
1604 | | ${apply_patch}= | Set Variable If | "${perf_qemu_qsz}" == "256" | ${False}
1605 | | ... | ${True}
1606 | | Run Keyword Unless | ${qemu_built} | ${vm_name}.Build QEMU | ${dut_node}
1607 | | ... | force_install=${True} | apply_patch=${apply_patch}
1608 | | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin}
1609 | | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
1610 | | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1
1611 | | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
1612 | | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image}
1613 | | ${vm}= | Run keyword | ${vm_name}.Qemu Start
1614 | | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus}
1615 | | Run keyword If | ${use_tuned_cfs} | ${vm_name}.Qemu Set Scheduler Policy
1616 | | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f
1617 | | ... | eal_mem_channels=4 | pmd_fwd_mode=mac | pmd_eth_peer_0=0,${eth0_mac}
1618 | | ... | pmd_eth_peer_1=1,${eth1_mac} | pmd_disable_hw_vlan=${True}
1619 | | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz}
1620 | | Return From Keyword | ${vm}
1621
1622 | Configure '${nr}' guest VMs with dpdk-testpmd-mac connected via vhost-user in 3-node circular topology
1623 | | [Documentation]
1624 | | ... | Start QEMU guests with two vhost-user interfaces and interconnecting
1625 | | ... | DPDK testpmd with fwd mode set to mac rewrite for defined number of
1626 | | ... | VMs on all defined VPP nodes.
1627 | | ...
1628 | | ... | *Arguments:*
1629 | | ... | _None_
1630 | | ...
1631 | | ... | _NOTE:_ This KW expects following test case variables to be set:
1632 | | ... | - ${system_cpus} - Number of CPUs allocated for OS itself.
1633 | | ... | - ${vpp_cpus} - Number of CPUs allocated for VPP.
1634 | | ... | - ${vm_cpus} - Number of CPUs to be allocated per QEMU instance.
1635 | | ...
1636 | | ... | *Example:*
1637 | | ...
1638 | | ... | \| Configure '2' guest VMs with dpdk-testpmd-mac connected via vhost-user \
1639 | | ... | in 3-node circular topology \|
1640 | | ...
1641 | | :FOR | ${number} | IN RANGE | 1 | ${nr}+1
1642 | | | ${sock1}= | Set Variable | /tmp/sock-${number}-1
1643 | | | ${sock2}= | Set Variable | /tmp/sock-${number}-2
1644 | | | ${skip_cpus}= | Evaluate | ${vpp_cpus}+${system_cpus}
1645 | | | ${vm1}=
1646 | | | ... | Configure guest VM with dpdk-testpmd-mac connected via vhost-user
1647 | | | ... | ${dut1} | ${sock1} | ${sock2} | DUT1_VM${number}
1648 | | | ... | ${dut1-vhost-${number}-if1_mac}
1649 | | | ... | ${dut1-vhost-${number}-if2_mac} | skip=${skip_cpus}
1650 | | | ... | count=${vm_cpus} | qemu_id=${number}
1651 | | | Set To Dictionary | ${dut1_vm_refs} | DUT1_VM${number} | ${vm1}
1652 | | | ${vm2}=
1653 | | | ... | Configure guest VM with dpdk-testpmd-mac connected via vhost-user
1654 | | | ... | ${dut2} | ${sock1} | ${sock2} | DUT2_VM${number}
1655 | | | ... | ${dut2-vhost-${number}-if1_mac}
1656 | | | ... | ${dut2-vhost-${number}-if2_mac} | skip=${skip_cpus}
1657 | | | ... | count=${vm_cpus} | qemu_id=${number}
1658 | | | Set To Dictionary | ${dut2_vm_refs} | DUT2_VM${number} | ${vm2}
1659 | | | Run Keyword Unless | ${qemu_built} | Set Suite Variable | ${qemu_built}
1660 | | | ... | ${True}
1661
1662 | Configure guest VM with dpdk-testpmd-mac using SMT connected via vhost-user
1663 | | [Documentation]
1664 | | ... | Start QEMU guest with two vhost-user interfaces and interconnecting
1665 | | ... | DPDK testpmd. Qemu Guest uses by default 5 cores and 2048M. Testpmd
1666 | | ... | uses 5 cores (1 main core and 4 cores dedicated to io) mem-channel=4,
1667 | | ... | txq/rxq=256, burst=64, disable-hw-vlan, disable-rss,
1668 | | ... | driver usr/lib/librte_pmd_virtio.so and fwd mode is mac rewrite.
1669 | | ...
1670 | | ... | *Arguments:*
1671 | | ... | - dut_node - DUT node to start guest VM on. Type: dictionary
1672 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
1673 | | ... | - sock2 - Socket path for second Vhost-User interface. Type: string
1674 | | ... | - vm_name - QemuUtil instance name. Type: string
1675 | | ... | - eth0_mac - MAC address of first Vhost interface. Type: string
1676 | | ... | - eth1_mac - MAC address of second Vhost interface. Type: string
1677 | | ... | - skip - number of cpus which will be skipped. Type: int
1678 | | ... | - count - number of cpus which will be allocated for qemu. Type: int
1679 | | ...
1680 | | ... | *Example:*
1681 | | ...
1682 | | ... | \| Configure guest VM with dpdk-testpmd-mac using SMT connected via \
1683 | | ... | vhost-user \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM\
1684 | | ... | \| 00:00:00:00:00:01 \| 00:00:00:00:00:02 \| ${6} \| ${5} \|
1685 | | ...
1686 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name}
1687 | | ... | ${eth0_mac} | ${eth1_mac} | ${skip}=${6} | ${count}=${5}
1688 | | ...
1689 | | Import Library | resources.libraries.python.QemuUtils
1690 | | ... | WITH NAME | ${vm_name}
1691 | | ${dut_numa}= | Get interfaces numa node | ${dut_node}
1692 | | ... | ${dut1_if1} | ${dut1_if2}
1693 | | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa}
1694 | | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${True}
1695 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
1696 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
1697 | | ${apply_patch}= | Set Variable If | "${perf_qemu_qsz}" == "256" | ${False}
1698 | | ... | ${True}
1699 | | Run Keyword Unless | ${qemu_built} | ${vm_name}.Build QEMU | ${dut_node}
1700 | | ... | force_install=${True} | apply_patch=${apply_patch}
1701 | | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin}
1702 | | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
1703 | | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1
1704 | | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
1705 | | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image}
1706 | | ${vm}= | Run keyword | ${vm_name}.Qemu Start
1707 | | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus}
1708 | | Run keyword If | ${use_tuned_cfs} | ${vm_name}.Qemu Set Scheduler Policy
1709 | | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f
1710 | | ... | eal_mem_channels=4 | pmd_fwd_mode=mac | pmd_eth_peer_0=0,${eth0_mac}
1711 | | ... | pmd_eth_peer_1=1,${eth1_mac} | pmd_disable_hw_vlan=${True}
1712 | | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz}
1713 | | Return From Keyword | ${vm}
1714
1715 | Configure guest VM with linux bridge connected via vhost-user
1716 | | [Documentation]
1717 | | ... | Start QEMU guest with two vhost-user interfaces and interconnecting
1718 | | ... | linux bridge. Qemu Guest uses 2048M.
1719 | | ...
1720 | | ... | *Arguments:*
1721 | | ... | - dut_node - DUT node to start guest VM on. Type: dictionary
1722 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
1723 | | ... | - sock2 - Socket path for second Vhost-User interface. Type: string
1724 | | ... | - vm_name - QemuUtil instance name. Type: string
1725 | | ... | - skip - number of cpus which will be skipped. Type: int
1726 | | ... | - count - number of cpus which will be allocated for qemu. Type: int
1727 | | ...
1728 | | ... | *Example:*
1729 | | ...
1730 | | ... | \| Configure guest VM with linux bridge connected via vhost-user \
1731 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \| ${6} \
1732 | | ... | \| ${5} \|
1733 | | ...
1734 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} | ${skip}=${6}
1735 | | ... | ${count}=${5}
1736 | | ...
1737 | | Import Library | resources.libraries.python.QemuUtils
1738 | | ... | WITH NAME | ${vm_name}
1739 | | ${dut_numa}= | Get interfaces numa node | ${dut_node}
1740 | | ... | ${dut1_if1} | ${dut1_if2}
1741 | | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa}
1742 | | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${False}
1743 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
1744 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
1745 | | ${apply_patch}= | Set Variable If | "${perf_qemu_qsz}" == "256" | ${False}
1746 | | ... | ${True}
1747 | | Run Keyword Unless | ${qemu_built} | ${vm_name}.Build QEMU | ${dut_node}
1748 | | ... | force_install=${True} | apply_patch=${apply_patch}
1749 | | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin}
1750 | | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
1751 | | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1
1752 | | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
1753 | | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image}
1754 | | ${vm}= | Run keyword | ${vm_name}.Qemu Start
1755 | | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus}
1756 | | ${br}= | Set Variable | br0
1757 | | ${vhost1}= | Get Vhost User If Name By Sock | ${vm} | ${sock1}
1758 | | ${vhost2}= | Get Vhost User If Name By Sock | ${vm} | ${sock2}
1759 | | Linux Add Bridge | ${vm} | ${br} | ${vhost1} | ${vhost2}
1760 | | Set Interface State | ${vm} | ${vhost1} | up | if_type=name
1761 | | Set Interface State | ${vm} | ${vhost2} | up | if_type=name
1762 | | Set Interface State | ${vm} | ${br} | up | if_type=name
1763 | | Return From Keyword | ${vm}
1764
1765 | Configure guest VM with linux bridge using SMT connected via vhost-user
1766 | | [Documentation]
1767 | | ... | Start QEMU guest with two vhost-user interfaces and interconnecting
1768 | | ... | linux bridge. Qemu Guest uses 2048M.
1769 | | ...
1770 | | ... | *Arguments:*
1771 | | ... | - dut_node - DUT node to start guest VM on. Type: dictionary
1772 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
1773 | | ... | - sock2 - Socket path for second Vhost-User interface. Type: string
1774 | | ... | - vm_name - QemuUtil instance name. Type: string
1775 | | ... | - skip - number of cpus which will be skipped. Type: int
1776 | | ... | - count - number of cpus which will be allocated for qemu. Type: int
1777 | | ...
1778 | | ... | *Example:*
1779 | | ...
1780 | | ... | \| Guest VM with Linux Bridge using SMT connected via vhost-user is \
1781 | | ... | setup \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \
1782 | | ... | \| ${6}\| ${5} \|
1783 | | ...
1784 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} | ${skip}=${6}
1785 | | ... | ${count}=${5}
1786 | | ...
1787 | | Import Library | resources.libraries.python.QemuUtils
1788 | | ... | WITH NAME | ${vm_name}
1789 | | ${dut_numa}= | Get interfaces numa node | ${dut_node}
1790 | | ... | ${dut1_if1} | ${dut1_if2}
1791 | | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa}
1792 | | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${True}
1793 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
1794 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
1795 | | ${apply_patch}= | Set Variable If | "${perf_qemu_qsz}" == "256" | ${False}
1796 | | ... | ${True}
1797 | | Run Keyword Unless | ${qemu_built} | ${vm_name}.Build QEMU | ${dut_node}
1798 | | ... | force_install=${True} | apply_patch=${apply_patch}
1799 | | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin}
1800 | | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
1801 | | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1
1802 | | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
1803 | | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image}
1804 | | ${vm}= | Run keyword | ${vm_name}.Qemu Start
1805 | | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus}
1806 | | ${br}= | Set Variable | br0
1807 | | ${vhost1}= | Get Vhost User If Name By Sock | ${vm} | ${sock1}
1808 | | ${vhost2}= | Get Vhost User If Name By Sock | ${vm} | ${sock2}
1809 | | Linux Add Bridge | ${vm} | ${br} | ${vhost1} | ${vhost2}
1810 | | Set Interface State | ${vm} | ${vhost1} | up | if_type=name
1811 | | Set Interface State | ${vm} | ${vhost2} | up | if_type=name
1812 | | Set Interface State | ${vm} | ${br} | up | if_type=name
1813 | | Return From Keyword | ${vm}
1814
1815 | Initialize LISP IPv4 forwarding in 3-node circular topology
1816 | | [Documentation] | Custom setup of IPv4 addresses on all DUT nodes and TG \
1817 | | ... | Don`t set route.
1818 | | ...
1819 | | ... | *Arguments:*
1820 | | ... | -${dut1_dut2_address} - Ip address from DUT1 to DUT2. Type: string
1821 | | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string
1822 | | ... | -${dut2_dut1_address} - Ip address from DUT2 to DUT1. Type: string
1823 | | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string
1824 | | ... | -${duts_prefix} - ip prefix. Type: int
1825 | | ...
1826 | | ... | *Return:*
1827 | | ... | - No value returned
1828 | | ...
1829 | | ... | *Example:*
1830 | | ... | \| Initialize LISP IPv4 forwarding in 3-node circular topology \
1831 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
1832 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
1833 | | ...
1834 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
1835 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${duts_prefix}
1836 | | ...
1837 | | Set Interface State | ${dut1} | ${dut1_if1} | up
1838 | | Set Interface State | ${dut1} | ${dut1_if2} | up
1839 | | Set Interface State | ${dut2} | ${dut2_if1} | up
1840 | | Set Interface State | ${dut2} | ${dut2_if2} | up
1841 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1842 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1843 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1844 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1845 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
1846 | | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_dut1_address}
1847 | | ... | ${dut2_if1_mac}
1848 | | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_dut2_address}
1849 | | ... | ${dut1_if2_mac}
1850 | | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
1851 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
1852 | | ... | ${dut1_tg_address} | ${duts_prefix}
1853 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
1854 | | ... | ${dut1_dut2_address} | ${duts_prefix}
1855 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
1856 | | ... | ${dut2_dut1_address} | ${duts_prefix}
1857 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2}
1858 | | ... | ${dut2_tg_address} | ${duts_prefix}
1859 | | All Vpp Interfaces Ready Wait | ${nodes}
1860
1861 | Initialize LISP GPE IPv4 over IPsec in 3-node circular topology
1862 | | [Documentation] | Setup Lisp GPE IPv4 forwarding over IPsec.
1863 | | ...
1864 | | ... | *Arguments:*
1865 | | ... | -${encr_alg} - Encryption algorithm. Type: string
1866 | | ... | -${auth_alg} - Authentication algorithm. Type: string
1867 | | ...
1868 | | ... | *Return:*
1869 | | ... | - No value returned
1870 | | ...
1871 | | ... | *Example:*
1872 | | ... | \| Initialize LISP GPE IPv4 over IPsec in 3-node circular topology\
1873 | | ... | \| ${encr_alg} \| ${auth_alg}
1874 | | ...
1875 | | [Arguments] | ${encr_alg} | ${auth_alg}
1876 | | ...
1877 | | Generate keys for IPSec | ${encr_alg} | ${auth_alg}
1878 | | Initialize LISP IPv4 forwarding in 3-node circular topology
1879 | | ... | ${dut1_to_dut2_ip4} | ${dut1_to_tg_ip4} | ${dut2_to_dut1_ip4}
1880 | | ... | ${dut2_to_tg_ip4} | ${prefix4}
1881 | | Configure LISP GPE topology in 3-node circular topology
1882 | | ... | ${dut1} | ${dut1_if2} | ${NONE}
1883 | | ... | ${dut2} | ${dut2_if1} | ${NONE}
1884 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
1885 | | ... | ${dut1_ip4_static_adjacency} | ${dut2_ip4_static_adjacency}
1886 | | Configure manual keyed connection for IPSec
1887 | | ... | ${dut1} | ${dut1_if2} | ${encr_alg} | ${encr_key}
1888 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
1889 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
1890 | | Configure manual keyed connection for IPSec
1891 | | ... | ${dut2} | ${dut2_if1} | ${encr_alg} | ${encr_key}
1892 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
1893 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
1894
1895 | Initialize LISP IPv6 forwarding in 3-node circular topology
1896 | | [Documentation] | Custom setup of IPv6 topology on all DUT nodes \
1897 | | ... | Don`t set route.
1898 | | ...
1899 | | ... | *Arguments:*
1900 | | ... | -${dut1_dut2_address} - Ip address from DUT1 to DUT2. Type: string
1901 | | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string
1902 | | ... | -${dut2_dut1_address} - Ip address from DUT2 to DUT1. Type: string
1903 | | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string
1904 | | ... | -${duts_prefix} - ip prefix. Type: int
1905 | | ...
1906 | | ... | *Return:*
1907 | | ... | - No value returned
1908 | | ...
1909 | | ... | *Example:*
1910 | | ... | \| Initialize LISP IPv6 forwarding in 3-node circular topology \
1911 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
1912 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
1913 | | ...
1914 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
1915 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${prefix}
1916 | | ...
1917 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1918 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1919 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1920 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1921 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_tg_address}
1922 | | ... | ${prefix}
1923 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_dut2_address}
1924 | | ... | ${prefix}
1925 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_dut1_address}
1926 | | ... | ${prefix}
1927 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_tg_address}
1928 | | ... | ${prefix}
1929 | | Suppress ICMPv6 router advertisement message | ${nodes}
1930 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
1931 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
1932 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_dut1_address}
1933 | | ... | ${dut2_if1_mac}
1934 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_dut2_address}
1935 | | ... | ${dut1_if2_mac}
1936
1937 | Initialize LISP IPv4 over IPv6 forwarding in 3-node circular topology
1938 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
1939 | | ... | Don`t set route.
1940 | | ...
1941 | | ... | *Arguments:*
1942 | | ... | - ${dut1_dut2_ip6_address} - IPv6 address from DUT1 to DUT2.
1943 | | ... | Type: string
1944 | | ... | - ${dut1_tg_ip4_address} - IPv4 address from DUT1 to tg. Type: string
1945 | | ... | - ${dut2_dut1_ip6_address} - IPv6 address from DUT2 to DUT1.
1946 | | ... | Type: string
1947 | | ... | - ${dut1_tg_ip4_address} - IPv4 address from DUT1 to tg. Type: string
1948 | | ... | - ${prefix4} - IPv4 prefix. Type: int
1949 | | ... | - ${prefix6} - IPv6 prefix. Type: int
1950 | | ...
1951 | | ... | *Return:*
1952 | | ... | - No value returned
1953 | | ...
1954 | | ... | *Example:*
1955 | | ... | \| Lisp IPv4 over IPv6 forwarding initialized in a 3-node circular \
1956 | | ... | topology \| ${dut1_dut2_ip6_address} \| ${dut1_tg_ip4_address} \
1957 | | ... | \| ${dut2_dut1_ip6_address} \| ${dut2_tg_ip4_address} \
1958 | | ... | \| ${prefix4} \| ${prefix6} \|
1959 | | ...
1960 | | [Arguments] | ${dut1_dut2_ip6_address} | ${dut1_tg_ip4_address}
1961 | | ... | ${dut2_dut1_ip6_address} | ${dut2_tg_ip4_address}
1962 | | ... | ${prefix4} | ${prefix6}
1963 | | ...
1964 | | Set Interface State | ${dut1} | ${dut1_if1} | up
1965 | | Set Interface State | ${dut1} | ${dut1_if2} | up
1966 | | Set Interface State | ${dut2} | ${dut2_if1} | up
1967 | | Set Interface State | ${dut2} | ${dut2_if2} | up
1968 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1969 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1970 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1971 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1972 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1}
1973 | | ... | ${dut1_tg_ip4_address} | ${prefix4}
1974 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_dut2_ip6_address}
1975 | | ... | ${prefix6}
1976 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_dut1_ip6_address}
1977 | | ... | ${prefix6}
1978 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2}
1979 | | ... | ${dut2_tg_ip4_address} | ${prefix4}
1980 | | Suppress ICMPv6 router advertisement message | ${nodes}
1981 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
1982 | | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
1983 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip6_address}
1984 | | ... | ${dut2_if1_mac}
1985 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip6_address}
1986 | | ... | ${dut1_if2_mac}
1987
1988 | Initialize LISP IPv6 over IPv4 forwarding in 3-node circular topology
1989 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
1990 | | ... | Don`t set route.
1991 | | ...
1992 | | ... | *Arguments:*
1993 | | ... | - ${dut1_dut2_ip4_address} - IPv4 address from DUT1 to DUT2.
1994 | | ... | Type: string
1995 | | ... | - ${dut1_tg_ip6_address} - IPv6 address from DUT1 to tg. Type: string
1996 | | ... | - ${dut2_dut1_ip4_address} - IPv4 address from DUT2 to DUT1.
1997 | | ... | Type: string
1998 | | ... | - ${dut1_tg_ip6_address} - IPv6 address from DUT1 to tg. Type: string
1999 | | ... | - ${prefix4} - IPv4 prefix. Type: int
2000 | | ... | - ${prefix6} - IPv6 prefix. Type: int
2001 | | ...
2002 | | ... | *Return:*
2003 | | ... | - No value returned
2004 | | ...
2005 | | ... | *Example:*
2006 | | ... | \| Lisp IPv6 over IPv4 forwarding initialized in a 3-node circular \
2007 | | ... | topology \| ${dut1_dut2_ip4_address} \| ${dut1_tg_ip6_address} \
2008 | | ... | \| ${dut2_dut1_ip4_address} \| ${dut2_tg_ip6_address} \
2009 | | ... | \| ${prefix6} \| ${prefix4} \|
2010 | | ...
2011 | | [Arguments] | ${dut1_dut2_ip4_address} | ${dut1_tg_ip6_address}
2012 | | ... | ${dut2_dut1_ip4_address} | ${dut2_tg_ip6_address}
2013 | | ... | ${prefix6} | ${prefix4}
2014 | | ...
2015 | | Set Interface State | ${dut1} | ${dut1_if1} | up
2016 | | Set Interface State | ${dut1} | ${dut1_if2} | up
2017 | | Set Interface State | ${dut2} | ${dut2_if1} | up
2018 | | Set Interface State | ${dut2} | ${dut2_if2} | up
2019 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2020 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2021 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2022 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2023 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_tg_ip6_address}
2024 | | ... | ${prefix6}
2025 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2}
2026 | | ... | ${dut1_dut2_ip4_address} | ${prefix4}
2027 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1}
2028 | | ... | ${dut2_dut1_ip4_address} | ${prefix4}
2029 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_tg_ip6_address}
2030 | | ... | ${prefix6}
2031 | | Suppress ICMPv6 router advertisement message | ${nodes}
2032 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
2033 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
2034 | | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip4_address}
2035 | | ... | ${dut2_if1_mac}
2036 | | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip4_address}
2037 | | ... | ${dut1_if2_mac}
2038
2039 | Initialize NAT44 in 3-node circular topology
2040 | | [Documentation] | Initialization of 3-node topology with NAT44 between DUTs:
2041 | | ... | - set interfaces up
2042 | | ... | - set IP addresses
2043 | | ... | - set ARP
2044 | | ... | - create routes
2045 | | ... | - set NAT44 - only on DUT1
2046 | | ...
2047 | | Set Interface State | ${dut1} | ${dut1_if1} | up
2048 | | Set Interface State | ${dut1} | ${dut1_if2} | up
2049 | | Set Interface State | ${dut2} | ${dut2_if1} | up
2050 | | Set Interface State | ${dut2} | ${dut2_if2} | up
2051 | | All Vpp Interfaces Ready Wait | ${nodes}
2052 | | ...
2053 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 10.0.0.1 | 20
2054 | | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 11.0.0.1 | 20
2055 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 11.0.0.2 | 20
2056 | | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 12.0.0.1 | 20
2057 | | ...
2058 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
2059 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
2060 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
2061 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
2062 | | ...
2063 | | Add arp on dut | ${dut1} | ${dut1_if1} | 10.0.0.2 | ${tg_if1_mac}
2064 | | Add arp on dut | ${dut1} | ${dut1_if2} | 11.0.0.2 | ${dut2_if1_mac}
2065 | | Add arp on dut | ${dut2} | ${dut2_if1} | 11.0.0.1 | ${dut1_if2_mac}
2066 | | Add arp on dut | ${dut2} | ${dut2_if2} | 12.0.0.2 | ${tg_if2_mac}
2067 | | ...
2068 | | Vpp Route Add | ${dut1} | 12.0.0.2 | 32 | 11.0.0.2 | ${dut1_if2}
2069 | | Vpp Route Add | ${dut1} | 20.0.0.0 | 18 | 10.0.0.2 | ${dut1_if1}
2070 | | Vpp Route Add | ${dut2} | 12.0.0.0 | 24 | 12.0.0.2 | ${dut2_if2}
2071 | | Vpp Route Add | ${dut2} | 200.0.0.0 | 30 | 11.0.0.1 | ${dut2_if1}
2072 | | ...
2073 | | Configure inside and outside interfaces
2074 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if2}
2075 | | Configure deterministic mode for NAT44
2076 | | ... | ${dut1} | 20.0.0.0 | 18 | 200.0.0.0 | 30
2077
2078 | Initialize L2 xconnect for '${nr}' memif pairs in 3-node circular topology
2079 | | [Documentation]
2080 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Cross
2081 | | ... | connect each Memif interface with one physical interface or virtual
2082 | | ... | interface to create a chain accross DUT node.
2083 | | ...
2084 | | ... | *Arguments:*
2085 | | ... | _None_
2086 | | ...
2087 | | ... | *Note:*
2088 | | ... | Socket paths for Memif are defined in following format:
2089 | | ... | - /tmp/memif-${number}-1
2090 | | ... | - /tmp/memif-${number}-2
2091 | | ...
2092 | | ... | *Example:*
2093 | | ...
2094 | | ... | \| Initialize L2 xconnect for 1 Memif in 3-node circular topology \|
2095 | | ...
2096 | | Set Interface State | ${dut1} | ${dut1_if1} | up
2097 | | Set Interface State | ${dut1} | ${dut1_if2} | up
2098 | | Set Interface State | ${dut2} | ${dut2_if1} | up
2099 | | Set Interface State | ${dut2} | ${dut2_if2} | up
2100 | | :FOR | ${number} | IN RANGE | 1 | ${nr}+1
2101 | |      | ${sock1}= | Set Variable | /tmp/memif-DUT1_VNF${number}-1
2102 | |      | ${sock2}= | Set Variable | /tmp/memif-DUT1_VNF${number}-2
2103 | |      | ${prev_index}= | Evaluate | ${number}-1
2104 | |      | Set up memif interfaces on DUT node | ${dut1}
2105 | |      | ... | ${sock1} | ${sock2} | ${number} | dut1-memif-${number}-if1
2106 | |      | ... | dut1-memif-${number}-if2
2107 | |      | ${dut1_xconnect_if1}= | Set Variable If | ${number}==1 | ${dut1_if1}
2108 | |      | ... | ${dut1-memif-${prev_index}-if2}
2109 | |      | Configure L2XC | ${dut1} | ${dut1_xconnect_if1}
2110 | |      | ... | ${dut1-memif-${number}-if1}
2111 | |      | ${sock1}= | Set Variable | /tmp/memif-DUT2_VNF${number}-1
2112 | |      | ${sock2}= | Set Variable | /tmp/memif-DUT2_VNF${number}-2
2113 | |      | Set up memif interfaces on DUT node | ${dut2}
2114 | |      | ... | ${sock1} | ${sock2} | ${number} | dut2-memif-${number}-if1
2115 | |      | ... | dut2-memif-${number}-if2
2116 | |      | ${dut2_xconnect_if1}= | Set Variable If | ${number}==1 | ${dut2_if1}
2117 | |      | ... | ${dut2-memif-${prev_index}-if2}
2118 | |      | Configure L2XC | ${dut2} | ${dut2_xconnect_if1}
2119 | |      | ... | ${dut2-memif-${number}-if1}
2120 | |      | Run Keyword If | ${number}==${nr} | Configure L2XC
2121 | |      | ... | ${dut1} | ${dut1-memif-${number}-if2} | ${dut1_if2}
2122 | |      | Run Keyword If | ${number}==${nr} | Configure L2XC
2123 | |      | ... | ${dut2} | ${dut2-memif-${number}-if2} | ${dut2_if2}
2124
2125 | Initialize L2 Bridge Domain for '${nr}' memif pairs in 3-node circular topology
2126 | | [Documentation]
2127 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
2128 | | ... | Memif interface to separate L2 bridge domain with one physical or
2129 | | ... | virtual interface to create a chain accross DUT node.
2130 | | ...
2131 | | ... | *Arguments:*
2132 | | ... | _None_
2133 | | ...
2134 | | ... | *Note:*
2135 | | ... | Socket paths for Memif are defined in following format:
2136 | | ... | - /tmp/memif-${number}-1
2137 | | ... | - /tmp/memif-${number}-2
2138 | | ...
2139 | | ... | *Example:*
2140 | | ...
2141 | | ... | \| Initialize L2 Bridge Domain for '1' memif pairs in 3-node circular\
2142 | | ... | topology \|
2143 | | ...
2144 | | ${bd_id2}= | Evaluate | ${nr}+1
2145 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${1}
2146 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id2}
2147 | | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${1}
2148 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
2149 | | :FOR | ${number} | IN RANGE | 1 | ${nr}+1
2150 | | | ${sock1}= | Set Variable | /tmp/memif-DUT1_VNF${number}-1
2151 | | | ${sock2}= | Set Variable | /tmp/memif-DUT1_VNF${number}-2
2152 | | | Set up memif interfaces on DUT node | ${dut1}
2153 | | | ... | ${sock1} | ${sock2} | ${number} | dut1-memif-${number}-if1
2154 | | | ... | dut1-memif-${number}-if2
2155 | | | ${bd_id2}= | Evaluate | ${number}+1
2156 | | | Add interface to bridge domain | ${dut1}
2157 | | | ... | ${dut1-memif-${number}-if1} | ${number}
2158 | | | Add interface to bridge domain | ${dut1}
2159 | | | ... | ${dut1-memif-${number}-if2} | ${bd_id2}
2160 | | | ${sock1}= | Set Variable | /tmp/memif-DUT2_VNF${number}-1
2161 | | | ${sock2}= | Set Variable | /tmp/memif-DUT2_VNF${number}-2
2162 | | | Set up memif interfaces on DUT node | ${dut2}
2163 | | | ... | ${sock1} | ${sock2} | ${number} | dut2-memif-${number}-if1
2164 | | | ... | dut2-memif-${number}-if2
2165 | | | Add interface to bridge domain | ${dut2}
2166 | | | ... | ${dut2-memif-${number}-if1} | ${number}
2167 | | | Add interface to bridge domain | ${dut2}
2168 | | | ... | ${dut2-memif-${number}-if2} | ${bd_id2}