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