4e12ded56d8471778ed0fbf37a089376cb970542
[csit.git] / resources / libraries / robot / performance.robot
1 # Copyright (c) 2016 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 | resources.libraries.python.topology.Topology
16 | Library | resources.libraries.python.NodePath
17 | Library | resources.libraries.python.DpdkUtil
18 | Library | resources.libraries.python.InterfaceUtil
19 | Library | resources.libraries.python.VhostUser
20 | Library | resources.libraries.python.TrafficGenerator
21 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
22 | Resource | resources/libraries/robot/default.robot
23 | Resource | resources/libraries/robot/interfaces.robot
24 | Resource | resources/libraries/robot/counters.robot
25 | Resource | resources/libraries/robot/bridge_domain.robot
26 | Resource | resources/libraries/robot/l2_xconnect.robot
27 | Resource | resources/libraries/robot/ipv4.robot
28 | Resource | resources/libraries/robot/ipv6.robot
29 | Resource | resources/libraries/robot/qemu.robot
30 | Documentation | Performance suite keywords
31
32 *** Keywords ***
33 | Setup performance rate Variables
34 | | [Documentation]
35 | | ... | Setup performance linerates as Suite Variables. Variables are used
36 | | ... | as search boundaries in RFC2544 throughput search.
37 | | ...
38 | | ... | _NOTE:_ This KW sets following suite variables:
39 | | ... | - 10Ge_linerate_pps_64B - Maximum number of packet per second
40 | | ... |                           for 10GE with 64B L2 Frame.
41 | | ... | - 10Ge_linerate_pps_68B - Maximum number of packet per second
42 | | ... |                           for 10GE with 68B L2 Frame.
43 | | ... | - 10Ge_linerate_pps_72B - Maximum number of packet per second
44 | | ... |                           for 10GE with 72B L2 Frame.
45 | | ... | - 10Ge_linerate_pps_78B - Maximum number of packet per second
46 | | ... |                           for 10GE with 78B L2 Frame.
47 | | ... | - 10Ge_linerate_pps_1518B - Maximum number of packet per second
48 | | ... |                             for 10GE with 1518B L2 Frame.
49 | | ... | - 10Ge_linerate_pps_1522B - Maximum number of packet per second
50 | | ... |                             for 10GE with 1522B L2 Frame.
51 | | ... | - 10Ge_linerate_pps_1526B - Maximum number of packet per second
52 | | ... |                             for 10GE with 1526B L2 Frame.
53 | | ... | - 10Ge_linerate_pps_9000B - Maximum number of packet per second
54 | | ... |                             for 10GE with 9000B L2 Frame.
55 | | ... | - 10Ge_linerate_pps_9004B - Maximum number of packet per second
56 | | ... |                             for 10GE with 9004B L2 Frame.
57 | | ... | - 10Ge_linerate_pps_9008B - Maximum number of packet per second
58 | | ... |                             for 10GE with 9008B L2 Frame.
59 | | ... | - 10Ge_linerate_pps_IMIX_v4_1 - Maximum number of packet per second
60 | | ... |                                 for 10GE with IMIX_v4_1 profile.
61 | | ... | - 40Ge_linerate_pps_64B - Maximum number of packet per second
62 | | ... |                           for 40GE with 64B L2 Frame.
63 | | ... | - 40Ge_linerate_pps_68B - Maximum number of packet per second
64 | | ... |                           for 40GE with 68B L2 Frame.
65 | | ... | - 40Ge_linerate_pps_72B - Maximum number of packet per second
66 | | ... |                           for 40GE with 72B L2 Frame.
67 | | ... | - 40Ge_linerate_pps_78B - Maximum number of packet per second
68 | | ... |                           for 40GE with 78B L2 Frame.
69 | | ... | - 40Ge_linerate_pps_1518B - Maximum number of packet per second
70 | | ... |                             for 40GE with 1518B L2 Frame.
71 | | ... | - 40Ge_linerate_pps_1522B - Maximum number of packet per second
72 | | ... |                             for 40GE with 1522B L2 Frame.
73 | | ... | - 40Ge_linerate_pps_1526B - Maximum number of packet per second
74 | | ... |                             for 40GE with 1526B L2 Frame.
75 | | ... | - 40Ge_linerate_pps_9000B - Maximum number of packet per second
76 | | ... |                             for 40GE with 9000B L2 Frame.
77 | | ... | - 40Ge_linerate_pps_9004B - Maximum number of packet per second
78 | | ... |                             for 40GE with 9004B L2 Frame.
79 | | ... | - 40Ge_linerate_pps_9008B - Maximum number of packet per second
80 | | ... |                             for 40GE with 9008B L2 Frame.
81 | | ... | - 40Ge_linerate_pps_IMIX_v4_1 - Maximum number of packet per second
82 | | ... |                                 for 40GE with IMIX_v4_1 profile.
83 | | ...
84 | | Set Suite Variable | ${10Ge_linerate_pps_64B} | 14880952
85 | | Set Suite Variable | ${10Ge_linerate_pps_68B} | 14204545
86 | | Set Suite Variable | ${10Ge_linerate_pps_72B} | 13586956
87 | | Set Suite Variable | ${10Ge_linerate_pps_78B} | 12755102
88 | | Set Suite Variable | ${10Ge_linerate_pps_1518B} | 812743
89 | | Set Suite Variable | ${10Ge_linerate_pps_1522B} | 810635
90 | | Set Suite Variable | ${10Ge_linerate_pps_9000B} | 138580
91 | | Set Suite Variable | ${10Ge_linerate_pps_9004B} | 138519
92 | | Set Suite Variable | ${10Ge_linerate_pps_9008B} | 138458
93 | | Set Suite Variable | ${10Ge_linerate_pps_IMIX_v4_1} | 3343736
94 | | Set Suite Variable | ${40Ge_linerate_pps_64B} | 59523809
95 | | Set Suite Variable | ${40Ge_linerate_pps_68B} | 56818181
96 | | Set Suite Variable | ${40Ge_linerate_pps_72B} | 54347826
97 | | Set Suite Variable | ${40Ge_linerate_pps_78B} | 51020408
98 | | Set Suite Variable | ${40Ge_linerate_pps_1518B} | 3250975
99 | | Set Suite Variable | ${40Ge_linerate_pps_1522B} | 3242542
100 | | Set Suite Variable | ${40Ge_linerate_pps_9000B} | 554323
101 | | Set Suite Variable | ${40Ge_linerate_pps_9004B} | 554078
102 | | Set Suite Variable | ${40Ge_linerate_pps_9008B} | 553832
103 | | Set Suite Variable | ${40Ge_linerate_pps_IMIX_v4_1} | 13374944
104
105 | Calculate pps
106 | | [Documentation]
107 | | ... | Calculate pps for given rate and L2 frame size,
108 | | ... | additional 20B are added to L2 frame size as padding.
109 | | ...
110 | | ... | *Arguments*
111 | | ... | - bps - Rate in bps. Type: integer
112 | | ... | - framesize - L2 frame size in Bytes. Type: integer
113 | | ...
114 | | ... | *Return*
115 | | ... | - Calculated pps. Type: integer
116 | | ...
117 | | ... | *Example:*
118 | | ...
119 | | ... | \| Calculate pps \| 10000000000 | 64
120 | | [Arguments] | ${bps} | ${framesize}
121 | | ${ret}= | Evaluate | (${bps}/((${framesize}+20)*8)).__trunc__()
122 | | Return From Keyword | ${ret}
123
124 | Get Frame Size
125 | | [Documentation]
126 | | ... | Framesize can be either integer in case of a single packet
127 | | ... | in stream, or set of packets in case of IMIX type or simmilar.
128 | | ... | This keyword returns average framesize.
129 | | ...
130 | | ... | *Arguments:*
131 | | ... | - framesize - Framesize. Type: integer or string
132 | | ...
133 | | ... | *Example:*
134 | | ...
135 | | ... | \| Get Frame Size \| IMIX_v4_1
136 | | [Arguments] | ${framesize}
137 | | Run Keyword If | '${framesize}' == 'IMIX_v4_1'
138 | | ...            | Return From Keyword | 353.83333
139 | | Return From Keyword | ${framesize}
140
141 | Setup performance global Variables
142 | | [Documentation]
143 | | ... | Setup suite Variables. Variables are used across performance testing.
144 | | ...
145 | | ... | _NOTE:_ This KW sets following suite variables:
146 | | ... | - glob_loss_acceptance - Loss acceptance treshold
147 | | ... | - glob_loss_acceptance_type - Loss acceptance treshold type
148 | | ... | - glob_vm_image - Guest VM disk image
149 | | ...
150 | | Set Suite Variable | ${glob_loss_acceptance} | 0.5
151 | | Set Suite Variable | ${glob_loss_acceptance_type} | percentage
152 | | Set Suite Variable | ${glob_vm_image} | /var/lib/vm/csit-nested-1.3.img
153
154 | 2-node circular Topology Variables Setup
155 | | [Documentation]
156 | | ... | Compute path for testing on two given nodes in circular
157 | | ... | topology and set corresponding suite variables.
158 | | ...
159 | | ... | _NOTE:_ This KW sets following suite variables:
160 | | ... | - tg - TG node
161 | | ... | - tg_if1 - 1st TG interface towards DUT.
162 | | ... | - tg_if2 - 2nd TG interface towards DUT.
163 | | ... | - dut1 - DUT1 node
164 | | ... | - dut1_if1 - 1st DUT interface towards TG.
165 | | ... | - dut1_if2 - 2nd DUT interface towards TG.
166 | | ...
167 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
168 | | Compute Path
169 | | ${tg_if1} | ${tg}= | Next Interface
170 | | ${dut1_if1} | ${dut1}= | Next Interface
171 | | ${dut1_if2} | ${dut1}= | Next Interface
172 | | ${tg_if2} | ${tg}= | Next Interface
173 | | Set Suite Variable | ${tg}
174 | | Set Suite Variable | ${tg_if1}
175 | | Set Suite Variable | ${tg_if2}
176 | | Set Suite Variable | ${dut1}
177 | | Set Suite Variable | ${dut1_if1}
178 | | Set Suite Variable | ${dut1_if2}
179
180 | 3-node circular Topology Variables Setup
181 | | [Documentation]
182 | | ... | Compute path for testing on three given nodes in circular
183 | | ... | topology and set corresponding suite variables.
184 | | ...
185 | | ... | _NOTE:_ This KW sets following suite variables:
186 | | ... | - tg - TG node
187 | | ... | - tg_if1 - TG interface towards DUT1.
188 | | ... | - tg_if2 - TG interface towards DUT2.
189 | | ... | - dut1 - DUT1 node
190 | | ... | - dut1_if1 - DUT1 interface towards TG.
191 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
192 | | ... | - dut2 - DUT2 node
193 | | ... | - dut2_if1 - DUT2 interface towards TG.
194 | | ... | - dut2_if2 - DUT2 interface towards DUT1.
195 | | ...
196 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']}
197 | | ...          | ${nodes['TG']}
198 | | Compute Path
199 | | ${tg_if1} | ${tg}= | Next Interface
200 | | ${dut1_if1} | ${dut1}= | Next Interface
201 | | ${dut1_if2} | ${dut1}= | Next Interface
202 | | ${dut2_if1} | ${dut2}= | Next Interface
203 | | ${dut2_if2} | ${dut2}= | Next Interface
204 | | ${tg_if2} | ${tg}= | Next Interface
205 | | Set Suite Variable | ${tg}
206 | | Set Suite Variable | ${tg_if1}
207 | | Set Suite Variable | ${tg_if2}
208 | | Set Suite Variable | ${dut1}
209 | | Set Suite Variable | ${dut1_if1}
210 | | Set Suite Variable | ${dut1_if2}
211 | | Set Suite Variable | ${dut2}
212 | | Set Suite Variable | ${dut2_if1}
213 | | Set Suite Variable | ${dut2_if2}
214
215 | 2-node circular Topology Variables Setup with DUT interface model
216 | | [Documentation]
217 | | ... | Compute path for testing on two given nodes in circular topology
218 | | ... | based on interface model provided as an argument and set
219 | | ... | corresponding suite variables.
220 | | ...
221 | | ... | *Arguments:*
222 | | ... | - iface_model - Interface model. Type: string
223 | | ...
224 | | ... | _NOTE:_ This KW sets following suite variables:
225 | | ... | - tg - TG node
226 | | ... | - tg_if1 - 1st TG interface towards DUT.
227 | | ... | - tg_if2 - 2nd TG interface towards DUT.
228 | | ... | - dut1 - DUT1 node
229 | | ... | - dut1_if1 - 1st DUT interface towards TG.
230 | | ... | - dut1_if2 - 2nd DUT interface towards TG.
231 | | ...
232 | | ... | *Example:*
233 | | ...
234 | | ... | \| 2-node circular Topology Variables Setup with DUT interface model \
235 | | ... | \| Intel-X520-DA2 \|
236 | | [Arguments] | ${iface_model}
237 | | ${iface_model_list}= | Create list | ${iface_model}
238 | | Append Node | ${nodes['TG']}
239 | | Append Node | ${nodes['DUT1']} | filter_list=${iface_model_list}
240 | | Append Node | ${nodes['TG']}
241 | | Compute Path
242 | | ${tg_if1} | ${tg}= | Next Interface
243 | | ${dut1_if1} | ${dut1}= | Next Interface
244 | | ${dut1_if2} | ${dut1}= | Next Interface
245 | | ${tg_if2} | ${tg}= | Next Interface
246 | | Set Suite Variable | ${tg}
247 | | Set Suite Variable | ${tg_if1}
248 | | Set Suite Variable | ${tg_if2}
249 | | Set Suite Variable | ${dut1}
250 | | Set Suite Variable | ${dut1_if1}
251 | | Set Suite Variable | ${dut1_if2}
252
253 | 3-node circular Topology Variables Setup with DUT interface model
254 | | [Documentation]
255 | | ... | Compute path for testing on three given nodes in circular topology
256 | | ... | based on interface model provided as an argument and set
257 | | ... | corresponding suite variables.
258 | | ...
259 | | ... | *Arguments:*
260 | | ... | - iface_model - Interface model. Type: string
261 | | ...
262 | | ... | _NOTE:_ This KW sets following suite variables:
263 | | ... | - tg - TG node
264 | | ... | - tg_if1 - TG interface towards DUT1.
265 | | ... | - tg_if2 - TG interface towards DUT2.
266 | | ... | - dut1 - DUT1 node
267 | | ... | - dut1_if1 - DUT1 interface towards TG.
268 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
269 | | ... | - dut2 - DUT2 node
270 | | ... | - dut2_if1 - DUT2 interface towards TG.
271 | | ... | - dut2_if2 - DUT2 interface towards DUT1.
272 | | ...
273 | | ... | *Example:*
274 | | ...
275 | | ... | \| 3-node circular Topology Variables Setup with DUT interface model \
276 | | ... | \| Intel-X520-DA2 \|
277 | | [Arguments] | ${iface_model}
278 | | ${iface_model_list}= | Create list | ${iface_model}
279 | | Append Node | ${nodes['TG']}
280 | | Append Node | ${nodes['DUT1']} | filter_list=${iface_model_list}
281 | | Append Node | ${nodes['DUT2']} | filter_list=${iface_model_list}
282 | | Append Node | ${nodes['TG']}
283 | | Compute Path
284 | | ${tg_if1} | ${tg}= | Next Interface
285 | | ${dut1_if1} | ${dut1}= | Next Interface
286 | | ${dut1_if2} | ${dut1}= | Next Interface
287 | | ${dut2_if1} | ${dut2}= | Next Interface
288 | | ${dut2_if2} | ${dut2}= | Next Interface
289 | | ${tg_if2} | ${tg}= | Next Interface
290 | | Set Suite Variable | ${tg}
291 | | Set Suite Variable | ${tg_if1}
292 | | Set Suite Variable | ${tg_if2}
293 | | Set Suite Variable | ${dut1}
294 | | Set Suite Variable | ${dut1_if1}
295 | | Set Suite Variable | ${dut1_if2}
296 | | Set Suite Variable | ${dut2}
297 | | Set Suite Variable | ${dut2_if1}
298 | | Set Suite Variable | ${dut2_if2}
299
300 | VPP interfaces in path are up in a 2-node circular topology
301 | | [Documentation]
302 | | ... | *Set UP state on VPP interfaces in path on nodes in 2-node circular
303 | | ... | topology.*
304 | | ...
305 | | Set Interface State | ${dut1} | ${dut1_if1} | up
306 | | Set Interface State | ${dut1} | ${dut1_if2} | up
307 | | Vpp Node Interfaces Ready Wait | ${dut1}
308
309 | VPP interfaces in path are up in a 3-node circular topology
310 | | [Documentation]
311 | | ... | *Set UP state on VPP interfaces in path on nodes in 3-node circular
312 | | ... | topology.*
313 | | ...
314 | | Set Interface State | ${dut1} | ${dut1_if1} | up
315 | | Set Interface State | ${dut1} | ${dut1_if2} | up
316 | | Set Interface State | ${dut2} | ${dut2_if1} | up
317 | | Set Interface State | ${dut2} | ${dut2_if2} | up
318 | | Vpp Node Interfaces Ready Wait | ${dut1}
319 | | Vpp Node Interfaces Ready Wait | ${dut2}
320
321 | IPv4 forwarding initialized in a 3-node circular topology
322 | | [Documentation]
323 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
324 | | ... | topology. Get the interface MAC addresses and setup ARP on all VPP
325 | | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG links and
326 | | ... | /30 prefix on DUT1-DUT2 link. Set routing on both DUT nodes with
327 | | ... | prefix /24 and next hop of neighbour DUT interface IPv4 address.
328 | | ...
329 | | Set Interface State | ${dut1} | ${dut1_if1} | up
330 | | Set Interface State | ${dut1} | ${dut1_if2} | up
331 | | Set Interface State | ${dut2} | ${dut2_if1} | up
332 | | Set Interface State | ${dut2} | ${dut2_if2} | up
333 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
334 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
335 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
336 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
337 | | dut1_v4.set_arp | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
338 | | dut1_v4.set_arp | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
339 | | dut2_v4.set_arp | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
340 | | dut2_v4.set_arp | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
341 | | dut1_v4.set_ip | ${dut1_if1} | 10.10.10.1 | 24
342 | | dut1_v4.set_ip | ${dut1_if2} | 1.1.1.1 | 30
343 | | dut2_v4.set_ip | ${dut2_if1} | 1.1.1.2 | 30
344 | | dut2_v4.set_ip | ${dut2_if2} | 20.20.20.1 | 24
345 | | dut1_v4.set_route | 20.20.20.0 | 24 | 1.1.1.2 | ${dut1_if2}
346 | | dut2_v4.set_route | 10.10.10.0 | 24 | 1.1.1.1 | ${dut2_if1}
347 | | All Vpp Interfaces Ready Wait | ${nodes}
348
349 | Scale IPv4 forwarding initialized in a 3-node circular topology
350 | | [Documentation]
351 | | ... | Custom setup of IPv4 topology with scalability of ip routes on all
352 | | ... | DUT nodes in 3-node circular topology
353 | | ...
354 | | ... | *Arguments:*
355 | | ... | - ${count} - IP route count. Type: integer
356 | | ...
357 | | ... | *Return:*
358 | | ... | - No value returned
359 | | ...
360 | | ... | *Example:*
361 | | ...
362 | | ... | \| Scale IPv4 forwarding initialized in a 3-node circular topology \
363 | | ... | \| 100000 \|
364 | | [Arguments] | ${count}
365 | | Set Interface State | ${dut1} | ${dut1_if1} | up
366 | | Set Interface State | ${dut1} | ${dut1_if2} | up
367 | | Set Interface State | ${dut2} | ${dut2_if1} | up
368 | | Set Interface State | ${dut2} | ${dut2_if2} | up
369 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
370 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
371 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
372 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
373 | | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac}
374 | | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac}
375 | | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac}
376 | | Add arp on dut | ${dut2} | ${dut2_if2} | 3.3.3.1 | ${tg1_if2_mac}
377 | | IP addresses are set on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30
378 | | IP addresses are set on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30
379 | | IP addresses are set on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2 | 30
380 | | IP addresses are set on interfaces | ${dut2} | ${dut2_if2} | 3.3.3.2 | 30
381 | | Vpp Route Add | ${dut1} | 10.0.0.0 | 32 | 1.1.1.1 | ${dut1_if1}
382 | | ...           | count=${count}
383 | | Vpp Route Add | ${dut1} | 20.0.0.0 | 32 | 2.2.2.2 | ${dut1_if2}
384 | | ...           | count=${count}
385 | | Vpp Route Add | ${dut2} | 10.0.0.0 | 32 | 2.2.2.1 | ${dut2_if1}
386 | | ...           | count=${count}
387 | | Vpp Route Add | ${dut2} | 20.0.0.0 | 32 | 3.3.3.1 | ${dut2_if2}
388 | | ...           | count=${count}
389 | | All Vpp Interfaces Ready Wait | ${nodes}
390
391 | IPv6 forwarding initialized in a 3-node circular topology
392 | | [Documentation]
393 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
394 | | ... | topology. Get the interface MAC addresses and setup neighbour on all
395 | | ... | VPP interfaces. Setup IPv6 addresses with /128 prefixes on all
396 | | ... | interfaces. Set routing on both DUT nodes with prefix /64 and
397 | | ... | next hop of neighbour DUT interface IPv6 address.
398 | | ...
399 | | ${prefix}= | Set Variable | 64
400 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
401 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
402 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
403 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
404 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:1::1 | ${prefix}
405 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:3::1 | ${prefix}
406 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:3::2 | ${prefix}
407 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | 2001:2::1 | ${prefix}
408 | | Vpp nodes ra suppress link layer | ${nodes}
409 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
410 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
411 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:3::2 | ${dut2_if1_mac}
412 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:3::1 | ${dut1_if2_mac}
413 | | Vpp Route Add | ${dut1} | 2001:2::0 | ${prefix} | 2001:3::2 | ${dut1_if2}
414 | | Vpp Route Add | ${dut2} | 2001:1::0 | ${prefix} | 2001:3::1 | ${dut2_if1}
415
416 | Scale IPv6 forwarding initialized in a 3-node circular topology
417 | | [Documentation]
418 | | ... | Custom setup of IPv6 topology with scalability of ip routes on all
419 | | ... | DUT nodes in 3-node circular topology
420 | | ...
421 | | ... | *Arguments:*
422 | | ... | - ${count} - IP route count. Type: integer
423 | | ...
424 | | ... | *Return:*
425 | | ... | - No value returned
426 | | ...
427 | | ... | *Example:*
428 | | ...
429 | | ... | \| Scale IPv6 forwarding initialized in a 3-node circular topology \
430 | | ... | \| 100000 \|
431 | | [Arguments] | ${count}
432 | | ${subn_prefix}= | Set Variable | 64
433 | | ${host_prefix}= | Set Variable | 128
434 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:3::1 | ${subn_prefix}
435 | | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:4::1 | ${subn_prefix}
436 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:4::2 | ${subn_prefix}
437 | | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | 2001:5::1 | ${subn_prefix}
438 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
439 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
440 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
441 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
442 | | Vpp nodes ra suppress link layer | ${nodes}
443 | | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:3::2 | ${tg1_if1_mac}
444 | | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:4::2 | ${dut2_if1_mac}
445 | | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:4::1 | ${dut1_if2_mac}
446 | | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:5::2 | ${tg1_if2_mac}
447 | | Vpp Route Add | ${dut1} | 2001:2::0 | ${host_prefix} | 2001:4::2
448 | | ...           | interface=${dut1_if2} | count=${count}
449 | | Vpp Route Add | ${dut1} | 2001:1::0 | ${host_prefix} | 2001:3::2
450 | | ...           | interface=${dut1_if1} | count=${count}
451 | | Vpp Route Add | ${dut2} | 2001:1::0 | ${host_prefix} | 2001:4::1
452 | | ...           | interface=${dut2_if2} | count=${count}
453 | | Vpp Route Add | ${dut2} | 2001:2::0 | ${host_prefix} | 2001:5::2
454 | | ...           | interface=${dut2_if1} | count=${count}
455
456 | IPv6 iAcl whitelist initialized in a 3-node circular topology
457 | | [Documentation]
458 | | ... | Creates classify L3 table on DUTs. IPv6 iAcl security whitelist
459 | | ... | ingress /64 filter entries applied on links TG - DUT1 and DUT2 - TG.
460 | | ...
461 | | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3
462 | | ... | ${dut1} | ip6 | dst
463 | | And Vpp Configures Classify Session L3
464 | | ... | ${dut1} | permit | ${table_idx} | ${skip_n} | ${match_n}
465 | | ... | ip6 | dst | 2001:2::2
466 | | And Vpp Enable Input Acl Interface
467 | | ... | ${dut1} | ${dut1_if1} | ip6 | ${table_idx}
468 | | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3
469 | | ... | ${dut2} | ip6 | dst
470 | | And Vpp Configures Classify Session L3
471 | | ... | ${dut2} | permit | ${table_idx} | ${skip_n} | ${match_n}
472 | | ... | ip6 | dst | 2001:1::2
473 | | And Vpp Enable Input Acl Interface
474 | | ... | ${dut2} | ${dut2_if2} | ip6 | ${table_idx}
475
476 | L2 xconnect initialized in a 3-node circular topology
477 | | [Documentation]
478 | | ... | Setup L2 xconnect topology by cross connecting two interfaces on
479 | | ... | each DUT. Interfaces are brought up.
480 | | ... |
481 | | L2 setup xconnect on DUT | ${dut1} | ${dut1_if1} | ${dut1_if2}
482 | | L2 setup xconnect on DUT | ${dut2} | ${dut2_if1} | ${dut2_if2}
483 | | All Vpp Interfaces Ready Wait | ${nodes}
484
485 | L2 bridge domain initialized in a 3-node circular topology
486 | | [Documentation]
487 | | ... | Setup L2 DB topology by adding two interfaces on each DUT into BD
488 | | ... | that is created automatically with index 1. Learning is enabled.
489 | | ... | Interfaces are brought up.
490 | | ... |
491 | | Vpp l2bd forwarding setup | ${dut1} | ${dut1_if1} | ${dut1_if2}
492 | | Vpp l2bd forwarding setup | ${dut2} | ${dut2_if1} | ${dut2_if2}
493 | | All Vpp Interfaces Ready Wait | ${nodes}
494
495 2-node Performance Suite Setup with DUT's NIC model
496 | | [Documentation]
497 | | ... | Suite preparation phase that setup default startup configuration of
498 | | ... | VPP on all DUTs. Updates interfaces on all nodes and setup global
499 | | ... | variables used in test cases based on interface model provided as an
500 | | ... | argument. Initializes traffic generator.
501 | | ...
502 | | ... | *Arguments:*
503 | | ... | - topology_type - Topology type. Type: string
504 | | ... | - nic_model - Interface model. Type: string
505 | | ...
506 | | ... | *Example:*
507 | | ...
508 | | ... | \| 2-node Performance Suite Setup \| L2 \| Intel-X520-DA2 \|
509 | | [Arguments] | ${topology_type} | ${nic_model}
510 | | Setup default startup configuration of VPP on all DUTs
511 | | Show vpp version on all DUTs
512 | | Setup performance rate Variables
513 | | Setup performance global Variables
514 | | 2-node circular Topology Variables Setup with DUT interface model
515 | | ... | ${nic_model}
516 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
517 | | ...                          | ${dut1} | ${dut1_if1}
518 | | ...                          | ${dut1} | ${dut1_if2}
519 | | ...                          | ${topology_type}
520
521 3-node Performance Suite Setup with DUT's NIC model
522 | | [Documentation]
523 | | ... | Suite preparation phase that setup default startup configuration of
524 | | ... | VPP on all DUTs. Updates interfaces on all nodes and setup global
525 | | ... | variables used in test cases based on interface model provided as an
526 | | ... | argument. Initializes traffic generator.
527 | | ...
528 | | ... | *Arguments:*
529 | | ... | - topology_type - Topology type. Type: string
530 | | ... | - nic_model - Interface model. Type: string
531 | | ...
532 | | ... | *Example:*
533 | | ...
534 | | ... | \| 3-node Performance Suite Setup \| L2 \| Intel-X520-DA2 \|
535 | | [Arguments] | ${topology_type} | ${nic_model}
536 | | Setup default startup configuration of VPP on all DUTs
537 | | Show vpp version on all DUTs
538 | | Setup performance rate Variables
539 | | Setup performance global Variables
540 | | 3-node circular Topology Variables Setup with DUT interface model
541 | | ... | ${nic_model}
542 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
543 | | ...                          | ${dut1} | ${dut1_if1}
544 | | ...                          | ${dut2} | ${dut2_if2}
545 | | ...                          | ${topology_type}
546
547 | 3-node Performance Suite Teardown
548 | | [Documentation]
549 | | ... | Suite teardown phase with traffic generator teardown.
550 | | ...
551 | | Teardown traffic generator | ${tg}
552
553 | Find NDR using linear search and pps
554 | | [Documentation]
555 | | ... | Find throughput by using RFC2544 linear search with non drop rate.
556 | | ...
557 | | ... | *Arguments:*
558 | | ... | - framesize - L2 Frame Size [B]. Type: integer
559 | | ... | - start_rate - Initial start rate [pps]. Type: float
560 | | ... | - step_rate - Step of linear search [pps]. Type: float
561 | | ... | - topology_type - Topology type. Type: string
562 | | ... | - min_rate - Lower limit of search [pps]. Type: float
563 | | ... | - max_rate - Upper limit of search [pps]. Type: float
564 | | ...
565 | | ... | *Return:*
566 | | ... | - No value returned
567 | | ...
568 | | ... | *Example:*
569 | | ...
570 | | ... | \| Find NDR using linear search and pps \| 64 \| 5000000 \| \
571 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952
572 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
573 | | ...         | ${topology_type} | ${min_rate} | ${max_rate}
574 | | ${duration}= | Set Variable | 10
575 | | Set Duration | ${duration}
576 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
577 | | Set Search Linear Step | ${step_rate}
578 | | Set Search Frame Size | ${framesize}
579 | | Set Search Rate Type pps
580 | | Linear Search | ${start_rate} | ${topology_type}
581 | | ${rate_per_stream} | ${latency}= | Verify Search Result
582 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
583 | | ...                          | ${latency}
584 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
585 | | ...                              | ${framesize} | ${topology_type}
586 | | ...                              | fail_on_loss=${False}
587
588 | Find PDR using linear search and pps
589 | | [Documentation]
590 | | ... | Find throughput by using RFC2544 linear search with partial drop rate
591 | | ... | with PDR threshold and type specified by parameter.
592 | | ...
593 | | ... | *Arguments:*
594 | | ... | - framesize - L2 Frame Size [B]. Type: integer
595 | | ... | - start_rate - Initial start rate [pps]. Type: float
596 | | ... | - step_rate - Step of linear search [pps]. Type: float
597 | | ... | - topology_type - Topology type. Type: string
598 | | ... | - min_rate - Lower limit of search [pps]. Type: float
599 | | ... | - max_rate - Upper limit of search [pps]. Type: float
600 | | ... | - loss_acceptance - Accepted loss during search. Type: float
601 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
602 | | ...
603 | | ... | *Example:*
604 | | ...
605 | | ... | \| Find PDR using linear search and pps \| 64 \| 5000000 \
606 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 0.5 \| percentage
607 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
608 | | ...         | ${topology_type} | ${min_rate} | ${max_rate}
609 | | ...         | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
610 | | ${duration}= | Set Variable | 10
611 | | Set Duration | ${duration}
612 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
613 | | Set Search Linear Step | ${step_rate}
614 | | Set Search Frame Size | ${framesize}
615 | | Set Search Rate Type pps
616 | | Set Loss Acceptance | ${loss_acceptance}
617 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
618 | | ...            | Set Loss Acceptance Type Percentage
619 | | Linear Search | ${start_rate} | ${topology_type}
620 | | ${rate_per_stream} | ${latency}= | Verify Search Result
621 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
622 | | ...                          | ${loss_acceptance} | ${loss_acceptance_type}
623 | | ...                          | ${latency}
624 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
625 | | ...                                   | ${framesize} | ${topology_type}
626 | | ...                                   | ${loss_acceptance}
627 | | ...                                   | ${loss_acceptance_type}
628 | | ...                                   | fail_on_loss=${False}
629
630 | Find NDR using binary search and pps
631 | | [Documentation]
632 | | ... | Find throughput by using RFC2544 binary search with non drop rate.
633 | | ...
634 | | ... | *Arguments:*
635 | | ... | - framesize - L2 Frame Size [B]. Type: integer
636 | | ... | - binary_min - Lower boundary of search [pps]. Type: float
637 | | ... | - binary_max - Upper boundary of search [pps]. Type: float
638 | | ... | - topology_type - Topology type. Type: string
639 | | ... | - min_rate - Lower limit of search [pps]. Type: float
640 | | ... | - max_rate - Upper limit of search [pps]. Type: float
641 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
642 | | ...
643 | | ... | *Example:*
644 | | ...
645 | | ... | \| Find NDR using binary search and pps \| 64 \| 6000000 \
646 | | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000
647 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
648 | | ...         | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
649 | | ${duration}= | Set Variable | 10
650 | | Set Duration | ${duration}
651 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
652 | | Set Search Frame Size | ${framesize}
653 | | Set Search Rate Type pps
654 | | Set Binary Convergence Threshold | ${threshold}
655 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
656 | | ${rate_per_stream} | ${latency}= | Verify Search Result
657 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
658 | | ...                          | ${latency}
659 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
660 | | ...                              | ${framesize} | ${topology_type}
661 | | ...                              | fail_on_loss=${False}
662
663 | Find PDR using binary search and pps
664 | | [Documentation]
665 | | ... | Find throughput by using RFC2544 binary search with partial drop rate
666 | | ... | with PDR threshold and type specified by parameter.
667 | | ...
668 | | ... | *Arguments:*
669 | | ... | - framesize - L2 Frame Size [B]. Type: integer
670 | | ... | - binary_min - Lower boundary of search [pps]. Type: float
671 | | ... | - binary_max - Upper boundary of search [pps]. Type: float
672 | | ... | - topology_type - Topology type. Type: string
673 | | ... | - min_rate - Lower limit of search [pps]. Type: float
674 | | ... | - max_rate - Upper limit of search [pps]. Type: float
675 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
676 | | ... | - loss_acceptance - Accepted loss during search. Type: float
677 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
678 | | ...
679 | | ... | *Example:*
680 | | ...
681 | | ... | \| Find PDR using binary search and pps \| 64 \| 6000000 \
682 | | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \| 0.5 \
683 | | ... | \| percentage
684 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
685 | | ...         | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
686 | | ...         | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
687 | | ${duration}= | Set Variable | 10
688 | | Set Duration | ${duration}
689 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
690 | | Set Search Frame Size | ${framesize}
691 | | Set Search Rate Type pps
692 | | Set Loss Acceptance | ${loss_acceptance}
693 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
694 | | ...            | Set Loss Acceptance Type Percentage
695 | | Set Binary Convergence Threshold | ${threshold}
696 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
697 | | ${rate_per_stream} | ${latency}= | Verify Search Result
698 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
699 | | ...                          | ${loss_acceptance} | ${loss_acceptance_type}
700 | | ...                          | ${latency}
701 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
702 | | ...                                   | ${framesize} | ${topology_type}
703 | | ...                                   | ${loss_acceptance}
704 | | ...                                   | ${loss_acceptance_type}
705 | | ...                                   | fail_on_loss=${False}
706
707 | Find NDR using combined search and pps
708 | | [Documentation]
709 | | ... | Find throughput by using RFC2544 combined search (linear+binary) with
710 | | ... | non drop rate.
711 | | ...
712 | | ... | *Arguments:*
713 | | ... | - framesize - L2 Frame Size [B]. Type: integer
714 | | ... | - start_rate - Initial start rate [pps]. Type: float
715 | | ... | - step_rate - Step of linear search [pps]. Type: float
716 | | ... | - topology_type - Topology type. Type: string
717 | | ... | - min_rate - Lower limit of search [pps]. Type: float
718 | | ... | - max_rate - Upper limit of search [pps]. Type: float
719 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
720 | | ...
721 | | ... | *Example:*
722 | | ...
723 | | ... | \| Find NDR using combined search and pps \| 64 \| 5000000 \
724 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000
725 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
726 | | ...         | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
727 | | ${duration}= | Set Variable | 10
728 | | Set Duration | ${duration}
729 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
730 | | Set Search Linear Step | ${step_rate}
731 | | Set Search Frame Size | ${framesize}
732 | | Set Search Rate Type pps
733 | | Set Binary Convergence Threshold | ${threshold}
734 | | Combined Search | ${start_rate} | ${topology_type}
735 | | ${rate_per_stream} | ${latency}= | Verify Search Result
736 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
737 | | ...                          | ${latency}
738 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
739 | | ...                              | ${framesize} | ${topology_type}
740 | | ...                              | fail_on_loss=${False}
741
742 | Find PDR using combined search and pps
743 | | [Documentation]
744 | | ... | Find throughput by using RFC2544 combined search (linear+binary) with
745 | | ... | partial drop rate with PDR threshold and type specified by parameter.
746 | | ...
747 | | ... | *Arguments:*
748 | | ... | - framesize - L2 Frame Size [B]. Type: integer
749 | | ... | - start_rate - Initial start rate [pps]. Type: float
750 | | ... | - step_rate - Step of linear search [pps]. Type: float
751 | | ... | - topology_type - Topology type. Type: string
752 | | ... | - min_rate - Lower limit of search [pps]. Type: float
753 | | ... | - max_rate - Upper limit of search [pps]. Type: float
754 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
755 | | ... | - loss_acceptance - Accepted loss during search. Type: float
756 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
757 | | ...
758 | | ... | *Example:*
759 | | ...
760 | | ... | \| Find PDR using combined search and pps \| 64 \| 5000000 \
761 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \| 0.5 \
762 | | ... | \| percentage
763 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
764 | | ...         | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
765 | | ...         | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
766 | | ${duration}= | Set Variable | 10
767 | | Set Duration | ${duration}
768 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
769 | | Set Search Linear Step | ${step_rate}
770 | | Set Search Frame Size | ${framesize}
771 | | Set Search Rate Type pps
772 | | Set Loss Acceptance | ${loss_acceptance}
773 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
774 | | ...            | Set Loss Acceptance Type Percentage
775 | | Set Binary Convergence Threshold | ${threshold}
776 | | Combined Search | ${start_rate} | ${topology_type}
777 | | ${rate_per_stream} | ${latency}= | Verify Search Result
778 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
779 | | ...                          | ${loss_acceptance} | ${loss_acceptance_type}
780 | | ...                          | ${latency}
781 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
782 | | ...                                   | ${framesize} | ${topology_type}
783 | | ...                                   | ${loss_acceptance}
784 | | ...                                   | ${loss_acceptance_type}
785 | | ...                                   | fail_on_loss=${False}
786
787 | Display result of NDR search
788 | | [Documentation]
789 | | ... | Display result of NDR search in packet per seconds (total and per
790 | | ... | stream) and Gbps total bandwidth with untagged packet.
791 | | ... | Througput is calculated as:
792 | | ... | Measured rate per stream * Total number of streams
793 | | ... | Bandwidth is calculated as:
794 | | ... | (Througput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
795 | | ...
796 | | ... | *Arguments:*
797 | | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string
798 | | ... | - framesize - L2 Frame Size [B]. Type: integer
799 | | ... | - nr_streams - Total number of streams. Type: integer
800 | | ... | - latency - Latency stats. Type: dictionary
801 | | ...
802 | | ... | *Example:*
803 | | ...
804 | | ... | \| Display result of NDR search \| 4400000 \| 64 \| 2 \
805 | | ... | \| (0, 10/10/10) \|
806 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams}
807 | | ...         | ${latency}
808 | | ${framesize}= | Get Frame Size | ${framesize}
809 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
810 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
811 | | Set Test Message | FINAL_RATE: ${rate_total} pps
812 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps)
813 | | ...              | append=yes
814 | | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged)
815 | | ...              | append=yes
816 | | :FOR | ${idx} | ${lat} | IN ENUMERATE | @{latency}
817 | | | Set Test Message | ${\n}LATENCY_STREAM_${idx}: ${lat} usec (min/avg/max)
818 | | ...                | append=yes
819
820 | Display result of PDR search
821 | | [Documentation]
822 | | ... | Display result of PDR search in packet per seconds (total and per
823 | | ... | stream) and Gbps total bandwidth with untagged packet.
824 | | ... | Througput is calculated as:
825 | | ... | Measured rate per stream * Total number of streams
826 | | ... | Bandwidth is calculated as:
827 | | ... | (Througput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
828 | | ...
829 | | ... | *Arguments:*
830 | | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string
831 | | ... | - framesize - L2 Frame Size [B]. Type: integer
832 | | ... | - nr_streams - Total number of streams. Type: integer
833 | | ... | - loss_acceptance - Accepted loss during search. Type: float
834 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
835 | | ... | - latency - Latency stats. Type: dictionary
836 | | ...
837 | | ... | *Example:*
838 | | ...
839 | | ... | \| Display result of PDR search \| 4400000 \| 64 \| 2 \| 0.5 \
840 | | ... | \| percentage \| (0, 10/10/10) \|
841 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams}
842 | | ...         | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
843 | | ${framesize}= | Get Frame Size | ${framesize}
844 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
845 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
846 | | Set Test Message | FINAL_RATE: ${rate_total} pps
847 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps)
848 | | ...              | append=yes
849 | | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged)
850 | | ...              | append=yes
851 | | :FOR | ${idx} | ${lat} | IN ENUMERATE | @{latency}
852 | | | Set Test Message | ${\n}LATENCY_STREAM_${idx}: ${lat} usec (min/avg/max)
853 | | ...                | append=yes
854 | | Set Test Message | ${\n}LOSS_ACCEPTANCE: ${loss_acceptance} ${loss_acceptance_type}
855 | | ...              | append=yes
856
857 | Traffic should pass with no loss
858 | | [Documentation]
859 | | ... | Send traffic at specified rate. No packet loss is accepted at loss
860 | | ... | evaluation.
861 | | ...
862 | | ... | *Arguments:*
863 | | ... | - duration - Duration of traffic run [s]. Type: integer
864 | | ... | - rate - Rate for sending packets. Type: string
865 | | ... | - framesize - L2 Frame Size [B]. Type: integer
866 | | ... | - topology_type - Topology type. Type: string
867 | | ...
868 | | ... | *Example:*
869 | | ...
870 | | ... | \| Traffic should pass with no loss \| 10 \| 4.0mpps \| 64 \
871 | | ... | \| 3-node-IPv4
872 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
873 | | ...         | ${fail_on_loss}=${True}
874 | | Clear and show runtime counters with running traffic | ${duration}
875 | | ...  | ${rate} | ${framesize} | ${topology_type}
876 | | Clear all counters on all DUTs
877 | | Send traffic on tg | ${duration} | ${rate} | ${framesize}
878 | | ...                | ${topology_type} | warmup_time=0
879 | | Show statistics on all DUTs
880 | | Run Keyword If | ${fail_on_loss} | No traffic loss occurred
881
882 | Traffic should pass with partial loss
883 | | [Documentation]
884 | | ... | Send traffic at specified rate. Partial packet loss is accepted
885 | | ... | within loss acceptance value specified as argument.
886 | | ...
887 | | ... | *Arguments:*
888 | | ... | - duration - Duration of traffic run [s]. Type: integer
889 | | ... | - rate - Rate for sending packets. Type: string
890 | | ... | - framesize - L2 Frame Size [B]. Type: integer
891 | | ... | - topology_type - Topology type. Type: string
892 | | ... | - loss_acceptance - Accepted loss during search. Type: float
893 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
894 | | ...
895 | | ... | *Example:*
896 | | ...
897 | | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \
898 | | ... | \| 3-node-IPv4 \| 0.5 \| percentage
899 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
900 | | ...         | ${loss_acceptance} | ${loss_acceptance_type}
901 | | ...         | ${fail_on_loss}=${True}
902 | | Clear and show runtime counters with running traffic | ${duration}
903 | | ...  | ${rate} | ${framesize} | ${topology_type}
904 | | Clear all counters on all DUTs
905 | | Send traffic on tg | ${duration} | ${rate} | ${framesize}
906 | | ...                | ${topology_type} | warmup_time=0
907 | | Show statistics on all DUTs
908 | | Run Keyword If | ${fail_on_loss} | Partial traffic loss accepted
909 | | ...            | ${loss_acceptance} | ${loss_acceptance_type}
910
911 | Clear and show runtime counters with running traffic
912 | | [Documentation]
913 | | ... | Start traffic at specified rate then clear runtime counters on all
914 | | ... | DUTs. Wait for specified amount of time and capture runtime counters
915 | | ... | on all DUTs. Finally stop traffic
916 | | ...
917 | | ... | *Arguments:*
918 | | ... | - duration - Duration of traffic run [s]. Type: integer
919 | | ... | - rate - Rate for sending packets. Type: string
920 | | ... | - framesize - L2 Frame Size [B]. Type: integer
921 | | ... | - topology_type - Topology type. Type: string
922 | | ...
923 | | ... | *Example:*
924 | | ...
925 | | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \
926 | | ... | \| 3-node-IPv4 \| 0.5 \| percentage
927 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
928 | | Send traffic on tg | -1 | ${rate} | ${framesize}
929 | | ...                | ${topology_type} | warmup_time=0 | async_call=${True}
930 | | ...                | latency=${False}
931 | | Clear runtime counters on all DUTs
932 | | Sleep | ${duration}
933 | | Show runtime counters on all DUTs
934 | | Stop traffic on tg
935
936 | Add PCI devices to DUTs from 3-node single link topology
937 | | ${dut1_if1_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if1}
938 | | ${dut1_if2_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if2}
939 | | ${dut2_if1_pci}= | Get Interface PCI Addr | ${dut2} | ${dut2_if1}
940 | | ${dut2_if2_pci}= | Get Interface PCI Addr | ${dut2} | ${dut2_if2}
941 | | Add PCI device | ${dut1} | ${dut1_if1_pci} | ${dut1_if2_pci}
942 | | Add PCI device | ${dut2} | ${dut2_if1_pci} | ${dut2_if2_pci}
943
944 | Guest VM with dpdk-testpmd connected via vhost-user is setup
945 | | [Documentation]
946 | | ... | Start QEMU guest with two vhost-user interfaces and interconnecting
947 | | ... | DPDK testpmd. Qemu Guest is using 3 cores pinned to physical cores 5,
948 | | ... | 6, 7 and 2048M. Testpmd is using 3 cores (1 main core and 2 cores
949 | | ... | dedicated to io) socket-mem=1024, mem-channel=4, txq/rxq=2048,
950 | | ... | burst=64, disable-hw-vlan, total-num-mbufs, driver
951 | | ... | usr/lib/librte_pmd_virtio.so.
952 | | ...
953 | | ... | *Arguments:*
954 | | ... | - dut_node - DUT node to start guest VM on. Type: dictionary
955 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
956 | | ... | - sock2 - Socket path for second Vhost-User interface. Type: string
957 | | ... | - vm_name - QemuUtil instance name. Type: string
958 | | ...
959 | | ... | *Example:*
960 | | ...
961 | | ... | \| Guest VM with dpdk-testpmd connected via vhost-user is setup \
962 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \|
963 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name}
964 | | Import Library | resources.libraries.python.QemuUtils
965 | | ...            | WITH NAME | ${vm_name}
966 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
967 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
968 | | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
969 | | Run keyword | ${vm_name}.Qemu Set Smp | 3 | 3 | 1 | 1
970 | | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
971 | | Run keyword | ${vm_name}.Qemu Set Huge Allocate
972 | | Run keyword | ${vm_name}.Qemu Set Disk Image | ${glob_vm_image}
973 | | ${vm}= | Run keyword | ${vm_name}.Qemu Start
974 | | Run keyword | ${vm_name}.Qemu Set Affinity | 5 | 6 | 7
975 | | Dpdk Testpmd Start | ${vm} | eal_coremask=0x7
976 | | ...                | eal_mem_channels=4
977 | | ...                | eal_socket_mem=1024
978 | | ...                | pmd_fwd_mode=io
979 | | ...                | pmd_disable_hw_vlan=${True}
980 | | Return From Keyword | ${vm}
981
982 | Guest VM with Linux Bridge connected via vhost-user is setup
983 | | [Documentation]
984 | | ... | Start QEMU guest with two vhost-user interfaces and interconnecting
985 | | ... | linux bridge. Qemu Guest is using 3 cores pinned to physical cores 5,
986 | | ... | 6, 7 and 2048M.
987 | | ...
988 | | ... | *Arguments:*
989 | | ... | - dut_node - DUT node to start guest VM on. Type: dictionary
990 | | ... | - sock1 - Socket path for first Vhost-User interface. Type: string
991 | | ... | - sock2 - Socket path for second Vhost-User interface. Type: string
992 | | ... | - vm_name - QemuUtil instance name. Type: string
993 | | ...
994 | | ... | *Example:*
995 | | ...
996 | | ... | \| Guest VM with Linux Bridge connected via vhost-user is setup \
997 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \|
998 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name}
999 | | Import Library | resources.libraries.python.QemuUtils
1000 | | ...            | WITH NAME | ${vm_name}
1001 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
1002 | | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
1003 | | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
1004 | | Run keyword | ${vm_name}.Qemu Set Smp | 3 | 3 | 1 | 1
1005 | | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
1006 | | Run keyword | ${vm_name}.Qemu Set Huge Allocate
1007 | | Run keyword | ${vm_name}.Qemu Set Disk Image | ${glob_vm_image}
1008 | | ${vm}= | Run keyword | ${vm_name}.Qemu Start
1009 | | Run keyword | ${vm_name}.Qemu Set Affinity | 5 | 6 | 7
1010 | | ${br}= | Set Variable | br0
1011 | | ${vhost1}= | Get Vhost User If Name By Sock | ${vm} | ${sock1}
1012 | | ${vhost2}= | Get Vhost User If Name By Sock | ${vm} | ${sock2}
1013 | | Linux Add Bridge | ${vm} | ${br} | ${vhost1} | ${vhost2}
1014 | | Set Interface State | ${vm} | ${vhost1} | up | if_type=name
1015 | | Set Interface State | ${vm} | ${vhost2} | up | if_type=name
1016 | | Set Interface State | ${vm} | ${br} | up | if_type=name
1017 | | Return From Keyword | ${vm}
1018
1019 | Guest VM with dpdk-testpmd Teardown
1020 | | [Documentation]
1021 | | ... | Stop all qemu processes with dpdk-testpmd running on ${dut_node}.
1022 | | ... | Argument is dictionary of all qemu nodes running with its names.
1023 | | ... | Dpdk-testpmd is stopped gracefully with printing stats.
1024 | | ... |
1025 | | ... | *Arguments:*
1026 | | ... | - dut_node - Node where to clean qemu. Type: dictionary
1027 | | ... | - dut_vm_refs - VM references on node. Type: dictionary
1028 | | ...
1029 | | ... | *Example:*
1030 | | ...
1031 | | ... | \| Guest VM with dpdk-testpmd Teardown \| ${node['DUT1']} \
1032 | | ... | \| ${dut_vm_refs} \|
1033 | | ...
1034 | | [Arguments] | ${dut_node} | ${dut_vm_refs}
1035 | | :FOR | ${vm_name} | IN | @{dut_vm_refs}
1036 | | | ${vm}= | Get From Dictionary | ${dut_vm_refs} | ${vm_name}
1037 | | | Dpdk Testpmd Stop | ${vm}
1038 | | | Run Keyword | ${vm_name}.Qemu Set Node | ${dut_node}
1039 | | | Run Keyword | ${vm_name}.Qemu Kill
1040 | | | Run Keyword | ${vm_name}.Qemu Clear Socks
1041
1042 | Guest VM Teardown
1043 | | [Documentation]
1044 | | ... | Stop all qemu processes running on ${dut_node}.
1045 | | ... | Argument is dictionary of all qemu nodes running with its names.
1046 | | ... |
1047 | | ... | *Arguments:*
1048 | | ... | - dut_node - Node where to clean qemu. Type: dictionary
1049 | | ... | - dut_vm_refs - VM references on node. Type: dictionary
1050 | | ...
1051 | | ... | *Example:*
1052 | | ...
1053 | | ... | \| Guest VM Teardown \| ${node['DUT1']} \
1054 | | ... | \| ${dut_vm_refs} \|
1055 | | ...
1056 | | [Arguments] | ${dut_node} | ${dut_vm_refs}
1057 | | :FOR | ${vm_name} | IN | @{dut_vm_refs}
1058 | | | ${vm}= | Get From Dictionary | ${dut_vm_refs} | ${vm_name}
1059 | | | Run Keyword | ${vm_name}.Qemu Set Node | ${dut_node}
1060 | | | Run Keyword | ${vm_name}.Qemu Kill
1061 | | | Run Keyword | ${vm_name}.Qemu Clear Socks
1062