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