FIX: run build qemu only for the 1st VM on DUT
[csit.git] / resources / libraries / robot / performance / performance_utils.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 | resources.libraries.python.topology.Topology
17 | Library | resources.libraries.python.NodePath
18 | Library | resources.libraries.python.DpdkUtil
19 | Library | resources.libraries.python.InterfaceUtil
20 | Library | resources.libraries.python.VhostUser
21 | Library | resources.libraries.python.TrafficGenerator
22 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
23 | Resource | resources/libraries/robot/shared/default.robot
24 | Resource | resources/libraries/robot/shared/interfaces.robot
25 | Resource | resources/libraries/robot/shared/counters.robot
26 | Resource | resources/libraries/robot/shared/lxc.robot
27 | Resource | resources/libraries/robot/shared/memif.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 - utilities to find and verify NDR
35 | ... | and PDR.
36
37 *** Keywords ***
38 | Calculate pps
39 | | [Documentation]
40 | | ... | Calculate pps for given rate and L2 frame size,
41 | | ... | additional 20B are added to L2 frame size as padding.
42 | | ...
43 | | ... | *Arguments*
44 | | ... | - bps - Rate in bps. Type: integer
45 | | ... | - framesize - L2 frame size in Bytes. Type: integer
46 | | ...
47 | | ... | *Return*
48 | | ... | - Calculated pps. Type: integer
49 | | ...
50 | | ... | *Example:*
51 | | ...
52 | | ... | \| Calculate pps \| 10000000000 \| 64 \|
53 | | ...
54 | | [Arguments] | ${bps} | ${framesize}
55 | | ...
56 | | ${framesize}= | Get Frame Size | ${framesize}
57 | | ${ret}= | Evaluate | (${bps}/((${framesize}+20)*8)).__trunc__()
58 | | Return From Keyword | ${ret}
59
60 | Get Frame Size
61 | | [Documentation]
62 | | ... | Framesize can be either integer in case of a single packet
63 | | ... | in stream, or set of packets in case of IMIX type or simmilar.
64 | | ... | This keyword returns average framesize.
65 | | ...
66 | | ... | *Arguments:*
67 | | ... | - framesize - Framesize. Type: integer or string
68 | | ...
69 | | ... | *Example:*
70 | | ...
71 | | ... | \| Get Frame Size \| IMIX_v4_1 \|
72 | | ...
73 | | [Arguments] | ${framesize}
74 | | ...
75 | | Run Keyword If | '${framesize}' == 'IMIX_v4_1'
76 | | ... | Return From Keyword | 353.83333
77 | | Return From Keyword | ${framesize}
78
79 | Is DPDK performance test
80 | | [Documentation]
81 | | ... | Return TRUE if variable DPDK_TEST exist, otherwise FALSE.
82 | | ${ret} | ${tmp}= | Run Keyword And Ignore Error
83 | | ... | Variable Should Exist | ${DPDK_TEST}
84 | | Return From Keyword If | "${ret}" == "PASS" | ${TRUE}
85 | | Return From Keyword | ${FALSE}
86
87 | Find NDR using linear search and pps
88 | | [Documentation]
89 | | ... | Find throughput by using RFC2544 linear search with non drop rate.
90 | | ...
91 | | ... | *Arguments:*
92 | | ... | - framesize - L2 Frame Size [B]. Type: integer
93 | | ... | - start_rate - Initial start rate [pps]. Type: float
94 | | ... | - step_rate - Step of linear search [pps]. Type: float
95 | | ... | - topology_type - Topology type. Type: string
96 | | ... | - min_rate - Lower limit of search [pps]. Type: float
97 | | ... | - max_rate - Upper limit of search [pps]. Type: float
98 | | ...
99 | | ... | *Return:*
100 | | ... | - No value returned
101 | | ...
102 | | ... | *Example:*
103 | | ...
104 | | ... | \| Find NDR using linear search and pps \| 64 \| 5000000 \
105 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \|
106 | | ...
107 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
108 | | ... | ${topology_type} | ${min_rate} | ${max_rate}
109 | | ...
110 | | ${duration}= | Set Variable | ${perf_trial_duration}
111 | | Set Duration | ${duration}
112 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
113 | | Set Search Linear Step | ${step_rate}
114 | | Set Search Frame Size | ${framesize}
115 | | Set Search Rate Type pps
116 | | Linear Search | ${start_rate} | ${topology_type}
117 | | ${rate_per_stream} | ${lat}= | Verify Search Result
118 | | ${tmp}= | Create List | 100%NDR | ${lat}
119 | | ${latency}= | Create List | ${tmp}
120 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
121 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
122 | | ... | ${framesize} | ${topology_type}
123 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
124 | | Append To List | ${latency} | ${tmp}
125 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
126 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
127 | | ... | ${framesize} | ${topology_type}
128 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
129 | | Append To List | ${latency} | ${tmp}
130 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
131 | | ... | ${latency}
132 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
133 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
134
135 | Find PDR using linear search and pps
136 | | [Documentation]
137 | | ... | Find throughput by using RFC2544 linear search with partial drop rate
138 | | ... | with PDR threshold and type specified by parameter.
139 | | ...
140 | | ... | *Arguments:*
141 | | ... | - framesize - L2 Frame Size [B]. Type: integer
142 | | ... | - start_rate - Initial start rate [pps]. Type: float
143 | | ... | - step_rate - Step of linear search [pps]. Type: float
144 | | ... | - topology_type - Topology type. Type: string
145 | | ... | - min_rate - Lower limit of search [pps]. Type: float
146 | | ... | - max_rate - Upper limit of search [pps]. Type: float
147 | | ... | - loss_acceptance - Accepted loss during search. Type: float
148 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
149 | | ...
150 | | ... | *Example:*
151 | | ...
152 | | ... | \| Find PDR using linear search and pps \| 64 \| 5000000 \
153 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 0.5 \| percentage \|
154 | | ...
155 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
156 | | ... | ${topology_type} | ${min_rate} | ${max_rate}
157 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
158 | | ...
159 | | ${duration}= | Set Variable | ${perf_trial_duration}
160 | | Set Duration | ${duration}
161 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
162 | | Set Search Linear Step | ${step_rate}
163 | | Set Search Frame Size | ${framesize}
164 | | Set Search Rate Type pps
165 | | Set Loss Acceptance | ${loss_acceptance}
166 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
167 | | ... | Set Loss Acceptance Type Percentage
168 | | Linear Search | ${start_rate} | ${topology_type}
169 | | ${rate_per_stream} | ${lat}= | Verify Search Result
170 | | ${tmp}= | Create List | 100%PDR | ${lat}
171 | | ${latency}= | Create List | ${tmp}
172 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
173 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
174 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
175 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
176 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
177
178 | Find NDR using binary search and pps
179 | | [Documentation]
180 | | ... | Find throughput by using RFC2544 binary search with non drop rate.
181 | | ...
182 | | ... | *Arguments:*
183 | | ... | - framesize - L2 Frame Size [B]. Type: integer
184 | | ... | - binary_min - Lower boundary of search [pps]. Type: float
185 | | ... | - binary_max - Upper boundary of search [pps]. Type: float
186 | | ... | - topology_type - Topology type. Type: string
187 | | ... | - min_rate - Lower limit of search [pps]. Type: float
188 | | ... | - max_rate - Upper limit of search [pps]. Type: float
189 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
190 | | ...
191 | | ... | *Example:*
192 | | ...
193 | | ... | \| Find NDR using binary search and pps \| 64 \| 6000000 \
194 | | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \|
195 | | ...
196 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
197 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
198 | | ...
199 | | ${duration}= | Set Variable | ${perf_trial_duration}
200 | | Set Duration | ${duration}
201 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
202 | | Set Search Frame Size | ${framesize}
203 | | Set Search Rate Type pps
204 | | Set Binary Convergence Threshold | ${threshold}
205 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
206 | | ${rate_per_stream} | ${lat}= | Verify Search Result
207 | | ${tmp}= | Create List | 100%NDR | ${lat}
208 | | ${latency}= | Create List | ${tmp}
209 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
210 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
211 | | ... | ${framesize} | ${topology_type}
212 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
213 | | Append To List | ${latency} | ${tmp}
214 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
215 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
216 | | ... | ${framesize} | ${topology_type}
217 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
218 | | Append To List | ${latency} | ${tmp}
219 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
220 | | ... | ${latency}
221 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
222 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
223
224 | Find PDR using binary search and pps
225 | | [Documentation]
226 | | ... | Find throughput by using RFC2544 binary search with partial drop rate
227 | | ... | with PDR threshold and type specified by parameter.
228 | | ...
229 | | ... | *Arguments:*
230 | | ... | - framesize - L2 Frame Size [B]. Type: integer
231 | | ... | - binary_min - Lower boundary of search [pps]. Type: float
232 | | ... | - binary_max - Upper boundary of search [pps]. Type: float
233 | | ... | - topology_type - Topology type. Type: string
234 | | ... | - min_rate - Lower limit of search [pps]. Type: float
235 | | ... | - max_rate - Upper limit of search [pps]. Type: float
236 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
237 | | ... | - loss_acceptance - Accepted loss during search. Type: float
238 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
239 | | ...
240 | | ... | *Example:*
241 | | ...
242 | | ... | \| Find PDR using binary search and pps \| 64 \| 6000000 \
243 | | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \| 0.5 \
244 | | ... | \| percentage \|
245 | | ...
246 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
247 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
248 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
249 | | ...
250 | | ${duration}= | Set Variable | ${perf_trial_duration}
251 | | Set Duration | ${duration}
252 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
253 | | Set Search Frame Size | ${framesize}
254 | | Set Search Rate Type pps
255 | | Set Loss Acceptance | ${loss_acceptance}
256 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
257 | | ... | Set Loss Acceptance Type Percentage
258 | | Set Binary Convergence Threshold | ${threshold}
259 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
260 | | ${rate_per_stream} | ${lat}= | Verify Search Result
261 | | ${tmp}= | Create List | 100%PDR | ${lat}
262 | | ${latency}= | Create List | ${tmp}
263 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
264 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
265 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
266 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
267 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
268
269 | Find NDR using combined search and pps
270 | | [Documentation]
271 | | ... | Find throughput by using RFC2544 combined search (linear+binary) with
272 | | ... | non drop rate.
273 | | ...
274 | | ... | *Arguments:*
275 | | ... | - framesize - L2 Frame Size [B]. Type: integer
276 | | ... | - start_rate - Initial start rate [pps]. Type: float
277 | | ... | - step_rate - Step of linear search [pps]. Type: float
278 | | ... | - topology_type - Topology type. Type: string
279 | | ... | - min_rate - Lower limit of search [pps]. Type: float
280 | | ... | - max_rate - Upper limit of search [pps]. Type: float
281 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
282 | | ...
283 | | ... | *Example:*
284 | | ...
285 | | ... | \| Find NDR using combined search and pps \| 64 \| 5000000 \
286 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \|
287 | | ...
288 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
289 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
290 | | ...
291 | | ${duration}= | Set Variable | ${perf_trial_duration}
292 | | Set Duration | ${duration}
293 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
294 | | Set Search Linear Step | ${step_rate}
295 | | Set Search Frame Size | ${framesize}
296 | | Set Search Rate Type pps
297 | | Set Binary Convergence Threshold | ${threshold}
298 | | Combined Search | ${start_rate} | ${topology_type}
299 | | ${rate_per_stream} | ${lat}= | Verify Search Result
300 | | ${tmp}= | Create List | 100%NDR | ${lat}
301 | | ${latency}= | Create List | ${tmp}
302 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
303 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
304 | | ... | ${framesize} | ${topology_type}
305 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
306 | | Append To List | ${latency} | ${tmp}
307 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
308 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
309 | | ... | ${framesize} | ${topology_type}
310 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
311 | | Append To List | ${latency} | ${tmp}
312 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
313 | | ... | ${latency}
314 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
315 | | ... | ${framesize} | ${topology_type}
316 | | ... | fail_on_loss=${False}
317
318 | Find PDR using combined search and pps
319 | | [Documentation]
320 | | ... | Find throughput by using RFC2544 combined search (linear+binary) with
321 | | ... | partial drop rate with PDR threshold and type specified by parameter.
322 | | ...
323 | | ... | *Arguments:*
324 | | ... | - framesize - L2 Frame Size [B]. Type: integer
325 | | ... | - start_rate - Initial start rate [pps]. Type: float
326 | | ... | - step_rate - Step of linear search [pps]. Type: float
327 | | ... | - topology_type - Topology type. Type: string
328 | | ... | - min_rate - Lower limit of search [pps]. Type: float
329 | | ... | - max_rate - Upper limit of search [pps]. Type: float
330 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
331 | | ... | - loss_acceptance - Accepted loss during search. Type: float
332 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
333 | | ...
334 | | ... | *Example:*
335 | | ...
336 | | ... | \| Find PDR using combined search and pps \| 64 \| 5000000 \
337 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \| 0.5 \
338 | | ... | \| percentage \|
339 | | ...
340 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
341 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
342 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
343 | | ...
344 | | ${duration}= | Set Variable | ${perf_trial_duration}
345 | | Set Duration | ${duration}
346 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
347 | | Set Search Linear Step | ${step_rate}
348 | | Set Search Frame Size | ${framesize}
349 | | Set Search Rate Type pps
350 | | Set Loss Acceptance | ${loss_acceptance}
351 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
352 | | ... | Set Loss Acceptance Type Percentage
353 | | Set Binary Convergence Threshold | ${threshold}
354 | | Combined Search | ${start_rate} | ${topology_type}
355 | | ${rate_per_stream} | ${lat}= | Verify Search Result
356 | | ${tmp}= | Create List | 100%PDR | ${lat}
357 | | ${latency}= | Create List | ${tmp}
358 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
359 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
360 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
361 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
362 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
363
364 | Display result of NDR search
365 | | [Documentation]
366 | | ... | Display result of NDR search in packet per seconds (total and per
367 | | ... | stream) and Gbps total bandwidth with untagged packet.
368 | | ... | Througput is calculated as:
369 | | ... | Measured rate per stream * Total number of streams
370 | | ... | Bandwidth is calculated as:
371 | | ... | (Througput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
372 | | ...
373 | | ... | *Arguments:*
374 | | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string
375 | | ... | - framesize - L2 Frame Size [B]. Type: integer
376 | | ... | - nr_streams - Total number of streams. Type: integer
377 | | ... | - latency - Latency stats. Type: dictionary
378 | | ...
379 | | ... | *Example:*
380 | | ...
381 | | ... | \| Display result of NDR search \| 4400000 \| 64 \| 2 \
382 | | ... | \| [100%NDR, [10/10/10, 1/2/3]] \|
383 | | ...
384 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams} | ${latency}
385 | | ...
386 | | ${framesize}= | Get Frame Size | ${framesize}
387 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
388 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
389 | | Set Test Message | FINAL_RATE: ${rate_total} pps
390 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes
391 | | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged)
392 | | ... | append=yes
393 | | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes
394 | | :FOR | ${lat} | IN | @{latency}
395 | | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes
396
397 | Display result of PDR search
398 | | [Documentation]
399 | | ... | Display result of PDR search in packet per seconds (total and per
400 | | ... | stream) and Gbps total bandwidth with untagged packet.
401 | | ... | Througput is calculated as:
402 | | ... | Measured rate per stream * Total number of streams
403 | | ... | Bandwidth is calculated as:
404 | | ... | (Througput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
405 | | ...
406 | | ... | *Arguments:*
407 | | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string
408 | | ... | - framesize - L2 Frame Size [B]. Type: integer
409 | | ... | - nr_streams - Total number of streams. Type: integer
410 | | ... | - loss_acceptance - Accepted loss during search. Type: float
411 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
412 | | ... | - latency - Latency stats. Type: dictionary
413 | | ...
414 | | ... | *Example:*
415 | | ...
416 | | ... | \| Display result of PDR search \| 4400000 \| 64 \| 2 \| 0.5 \
417 | | ... | \| percentage \| [100%NDR, [10/10/10, 1/2/3]] \|
418 | | ...
419 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams}
420 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
421 | | ...
422 | | ${framesize}= | Get Frame Size | ${framesize}
423 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
424 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
425 | | Set Test Message | FINAL_RATE: ${rate_total} pps
426 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes
427 | | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged)
428 | | ... | append=yes
429 | | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes
430 | | :FOR | ${lat} | IN | @{latency}
431 | | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes
432 | | Set Test Message
433 | | ... | ${\n}LOSS_ACCEPTANCE: ${loss_acceptance} ${loss_acceptance_type}
434 | | ... | append=yes
435
436 | Measure latency pps
437 | | [Documentation]
438 | | ... | Send traffic at specified rate. Measure min/avg/max latency
439 | | ...
440 | | ... | *Arguments:*
441 | | ... | - duration - Duration of traffic run [s]. Type: integer
442 | | ... | - rate - Rate for sending packets. Type: integer
443 | | ... | - framesize - L2 Frame Size [B]. Type: integer
444 | | ... | - topology_type - Topology type. Type: string
445 | | ...
446 | | ... | *Example:*
447 | | ...
448 | | ... | \| Measure latency \| 10 \| 4.0 \| 64 \| 3-node-IPv4 \|
449 | | ...
450 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
451 | | ...
452 | | Return From Keyword If | ${rate} <= 10000 | ${-1}
453 | | ${ret}= | Is DPDK performance test
454 | | Run Keyword If | ${ret}==${FALSE} | Clear all counters on all DUTs
455 | | Send traffic on tg | ${duration} | ${rate}pps | ${framesize}
456 | | ... | ${topology_type} | warmup_time=0
457 | | Run Keyword If | ${ret}==${FALSE} | Show statistics on all DUTs
458 | | Run keyword and return | Get latency
459
460 | Traffic should pass with no loss
461 | | [Documentation]
462 | | ... | Send traffic at specified rate. No packet loss is accepted at loss
463 | | ... | evaluation.
464 | | ...
465 | | ... | *Arguments:*
466 | | ... | - duration - Duration of traffic run [s]. Type: integer
467 | | ... | - rate - Rate for sending packets. Type: string
468 | | ... | - framesize - L2 Frame Size [B]. Type: integer
469 | | ... | - topology_type - Topology type. Type: string
470 | | ... | - fail_on_loss - If True, the keyword fails if loss occurred.
471 | | ... | Type: boolean
472 | | ...
473 | | ... | *Example:*
474 | | ...
475 | | ... | \| Traffic should pass with no loss \| 10 \| 4.0mpps \| 64 \
476 | | ... | \| 3-node-IPv4 \|
477 | | ...
478 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
479 | | ... | ${fail_on_loss}=${True}
480 | | ...
481 | | Clear and show runtime counters with running traffic | ${duration}
482 | | ... | ${rate} | ${framesize} | ${topology_type}
483 | | ${ret}= | Is DPDK performance test
484 | | Run Keyword If | ${ret}==${FALSE} | Clear all counters on all DUTs
485 | | Send traffic on tg | ${duration} | ${rate} | ${framesize}
486 | | ... | ${topology_type} | warmup_time=0
487 | | Run Keyword If | ${ret}==${FALSE} | Show statistics on all DUTs
488 | | Run Keyword If | ${fail_on_loss} | No traffic loss occurred
489
490 | Traffic should pass with partial loss
491 | | [Documentation]
492 | | ... | Send traffic at specified rate. Partial packet loss is accepted
493 | | ... | within loss acceptance value specified as argument.
494 | | ...
495 | | ... | *Arguments:*
496 | | ... | - duration - Duration of traffic run [s]. Type: integer
497 | | ... | - rate - Rate for sending packets. Type: string
498 | | ... | - framesize - L2 Frame Size [B]. Type: integer
499 | | ... | - topology_type - Topology type. Type: string
500 | | ... | - loss_acceptance - Accepted loss during search. Type: float
501 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
502 | | ...
503 | | ... | *Example:*
504 | | ...
505 | | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \
506 | | ... | \| 3-node-IPv4 \| 0.5 \| percentage \|
507 | | ...
508 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
509 | | ... | ${loss_acceptance} | ${loss_acceptance_type}
510 | | ... | ${fail_on_loss}=${True}
511 | | ...
512 | | Clear and show runtime counters with running traffic | ${duration}
513 | | ... | ${rate} | ${framesize} | ${topology_type}
514 | | ${ret}= | Is DPDK performance test
515 | | Run Keyword If | ${ret}==${FALSE} | Clear all counters on all DUTs
516 | | Send traffic on tg | ${duration} | ${rate} | ${framesize}
517 | | ... | ${topology_type} | warmup_time=0
518 | | Run Keyword If | ${ret}==${FALSE} | Show statistics on all DUTs
519 | | Run Keyword If | ${fail_on_loss} | Partial traffic loss accepted
520 | | ... | ${loss_acceptance} | ${loss_acceptance_type}
521
522 | Clear and show runtime counters with running traffic
523 | | [Documentation]
524 | | ... | Start traffic at specified rate then clear runtime counters on all
525 | | ... | DUTs. Wait for specified amount of time and capture runtime counters
526 | | ... | on all DUTs. Finally stop traffic
527 | | ...
528 | | ... | *Arguments:*
529 | | ... | - duration - Duration of traffic run [s]. Type: integer
530 | | ... | - rate - Rate for sending packets. Type: string
531 | | ... | - framesize - L2 Frame Size [B]. Type: integer
532 | | ... | - topology_type - Topology type. Type: string
533 | | ...
534 | | ... | *Example:*
535 | | ...
536 | | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \
537 | | ... | \| 3-node-IPv4 \| 0.5 \| percentage \|
538 | | ...
539 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
540 | | ...
541 | | Send traffic on tg | -1 | ${rate} | ${framesize} | ${topology_type}
542 | | ... | warmup_time=0 | async_call=${True} | latency=${False}
543 | | ${ret}= | Is DPDK performance test
544 | | Run Keyword If | ${ret}==${FALSE} | Clear runtime counters on all DUTs
545 | | Sleep | ${duration}
546 | | Run Keyword If | ${ret}==${FALSE} | Show runtime counters on all DUTs
547 | | Stop traffic on tg