fa3174983e1c0517af6eaee270cca7e56abe0a2a
[csit.git] / resources / libraries / robot / performance / performance_utils.robot
1 # Copyright (c) 2018 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Library | Collections
16 | Library | 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.KubernetesUtils
21 | Library | resources.libraries.python.VhostUser
22 | Library | resources.libraries.python.TrafficGenerator
23 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
24 | Library | resources.libraries.python.Trace
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/shared/container.robot
29 | Resource | resources/libraries/robot/shared/memif.robot
30 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
31 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
32 | Resource | resources/libraries/robot/ip/ip4.robot
33 | Resource | resources/libraries/robot/ip/ip6.robot
34 | Resource | resources/libraries/robot/vm/qemu.robot
35 | Resource | resources/libraries/robot/l2/tagging.robot
36 | Documentation | Performance suite keywords - utilities to find and verify NDR
37 | ... | and PDR.
38
39 *** Keywords ***
40 | Calculate pps
41 | | [Documentation]
42 | | ... | Calculate pps for given rate and L2 frame size,
43 | | ... | additional 20B are added to L2 frame size as padding.
44 | | ...
45 | | ... | *Arguments*
46 | | ... | - bps - Rate in bps. Type: integer
47 | | ... | - framesize - L2 frame size in Bytes. Type: integer
48 | | ...
49 | | ... | *Return*
50 | | ... | - Calculated pps. Type: integer
51 | | ...
52 | | ... | *Example:*
53 | | ...
54 | | ... | \| Calculate pps \| 10000000000 \| 64 \|
55 | | ...
56 | | [Arguments] | ${bps} | ${framesize}
57 | | ...
58 | | ${framesize}= | Get Frame Size | ${framesize}
59 | | ${ret}= | Evaluate | (${bps}/((${framesize}+20)*8)).__trunc__()
60 | | Return From Keyword | ${ret}
61
62 | Get Frame Size
63 | | [Documentation]
64 | | ... | Framesize can be either integer in case of a single packet
65 | | ... | in stream, or set of packets in case of IMIX type or simmilar.
66 | | ... | This keyword returns average framesize.
67 | | ...
68 | | ... | *Arguments:*
69 | | ... | - framesize - Framesize. Type: integer or string
70 | | ...
71 | | ... | *Example:*
72 | | ...
73 | | ... | \| Get Frame Size \| IMIX_v4_1 \|
74 | | ...
75 | | [Arguments] | ${framesize}
76 | | ...
77 | | Run Keyword If | '${framesize}' == 'IMIX_v4_1'
78 | | ... | Return From Keyword | 353.83333
79 | | Return From Keyword | ${framesize}
80
81 | Is DPDK performance test
82 | | [Documentation]
83 | | ... | Return TRUE if variable DPDK_TEST exist, otherwise FALSE.
84 | | ${ret} | ${tmp}= | Run Keyword And Ignore Error
85 | | ... | Variable Should Exist | ${DPDK_TEST}
86 | | Return From Keyword If | "${ret}" == "PASS" | ${True}
87 | | Return From Keyword | ${False}
88
89 | Find NDR using linear search and pps
90 | | [Documentation]
91 | | ... | Find throughput by using RFC2544 linear search with non drop rate.
92 | | ...
93 | | ... | *Arguments:*
94 | | ... | - framesize - L2 Frame Size [B]. Type: integer
95 | | ... | - start_rate - Initial start rate [pps]. Type: float
96 | | ... | - step_rate - Step of linear search [pps]. Type: float
97 | | ... | - topology_type - Topology type. Type: string
98 | | ... | - min_rate - Lower limit of search [pps]. Type: float
99 | | ... | - max_rate - Upper limit of search [pps]. Type: float
100 | | ...
101 | | ... | *Return:*
102 | | ... | - No value returned
103 | | ...
104 | | ... | *Example:*
105 | | ...
106 | | ... | \| Find NDR using linear search and pps \| 64 \| 5000000 \
107 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \|
108 | | ...
109 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
110 | | ... | ${topology_type} | ${min_rate} | ${max_rate}
111 | | ...
112 | | ${duration}= | Set Variable | ${perf_trial_duration}
113 | | Set Duration | ${duration}
114 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
115 | | Set Search Linear Step | ${step_rate}
116 | | Set Search Frame Size | ${framesize}
117 | | Set Search Rate Type pps
118 | | Linear Search | ${start_rate} | ${topology_type}
119 | | ${rate_per_stream} | ${lat}= | Verify Search Result
120 | | ${tmp}= | Create List | 100%NDR | ${lat}
121 | | ${latency}= | Create List | ${tmp}
122 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
123 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
124 | | ... | ${framesize} | ${topology_type}
125 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
126 | | Append To List | ${latency} | ${tmp}
127 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
128 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
129 | | ... | ${framesize} | ${topology_type}
130 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
131 | | Append To List | ${latency} | ${tmp}
132 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
133 | | ... | ${latency}
134 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
135 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
136
137 | Find PDR using linear search and pps
138 | | [Documentation]
139 | | ... | Find throughput by using RFC2544 linear search with partial drop rate
140 | | ... | with PDR threshold and type specified by parameter.
141 | | ...
142 | | ... | *Arguments:*
143 | | ... | - framesize - L2 Frame Size [B]. Type: integer
144 | | ... | - start_rate - Initial start rate [pps]. Type: float
145 | | ... | - step_rate - Step of linear search [pps]. Type: float
146 | | ... | - topology_type - Topology type. Type: string
147 | | ... | - min_rate - Lower limit of search [pps]. Type: float
148 | | ... | - max_rate - Upper limit of search [pps]. Type: float
149 | | ... | - loss_acceptance - Accepted loss during search. Type: float
150 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
151 | | ...
152 | | ... | *Example:*
153 | | ...
154 | | ... | \| Find PDR using linear search and pps \| 64 \| 5000000 \
155 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 0.5 \| percentage \|
156 | | ...
157 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
158 | | ... | ${topology_type} | ${min_rate} | ${max_rate}
159 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
160 | | ...
161 | | ${duration}= | Set Variable | ${perf_trial_duration}
162 | | Set Duration | ${duration}
163 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
164 | | Set Search Linear Step | ${step_rate}
165 | | Set Search Frame Size | ${framesize}
166 | | Set Search Rate Type pps
167 | | Set Loss Acceptance | ${loss_acceptance}
168 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
169 | | ... | Set Loss Acceptance Type Percentage
170 | | Linear Search | ${start_rate} | ${topology_type}
171 | | ${rate_per_stream} | ${lat}= | Verify Search Result
172 | | ${tmp}= | Create List | 100%PDR | ${lat}
173 | | ${latency}= | Create List | ${tmp}
174 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
175 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
176 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
177 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
178 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
179
180 | Find NDR using binary search and pps
181 | | [Documentation]
182 | | ... | Find throughput by using RFC2544 binary search with non drop rate.
183 | | ...
184 | | ... | *Arguments:*
185 | | ... | - framesize - L2 Frame Size [B]. Type: integer
186 | | ... | - binary_min - Lower boundary of search [pps]. Type: float
187 | | ... | - binary_max - Upper boundary of search [pps]. Type: float
188 | | ... | - topology_type - Topology type. Type: string
189 | | ... | - min_rate - Lower limit of search [pps]. Type: float
190 | | ... | - max_rate - Upper limit of search [pps]. Type: float
191 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
192 | | ...
193 | | ... | *Example:*
194 | | ...
195 | | ... | \| Find NDR using binary search and pps \| 64 \| 6000000 \
196 | | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \|
197 | | ...
198 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
199 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
200 | | ...
201 | | ${duration}= | Set Variable | ${perf_trial_duration}
202 | | Set Duration | ${duration}
203 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
204 | | Set Search Frame Size | ${framesize}
205 | | Set Search Rate Type pps
206 | | Set Binary Convergence Threshold | ${threshold}
207 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
208 | | ${rate_per_stream} | ${lat}= | Verify Search Result
209 | | ${tmp}= | Create List | 100%NDR | ${lat}
210 | | ${latency}= | Create List | ${tmp}
211 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
212 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
213 | | ... | ${framesize} | ${topology_type}
214 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
215 | | Append To List | ${latency} | ${tmp}
216 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
217 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
218 | | ... | ${framesize} | ${topology_type}
219 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
220 | | Append To List | ${latency} | ${tmp}
221 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
222 | | ... | ${latency}
223 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
224 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
225
226 | Find PDR using binary search and pps
227 | | [Documentation]
228 | | ... | Find throughput by using RFC2544 binary search with partial drop rate
229 | | ... | with PDR threshold and type specified by parameter.
230 | | ...
231 | | ... | *Arguments:*
232 | | ... | - framesize - L2 Frame Size [B]. Type: integer
233 | | ... | - binary_min - Lower boundary of search [pps]. Type: float
234 | | ... | - binary_max - Upper boundary of search [pps]. Type: float
235 | | ... | - topology_type - Topology type. Type: string
236 | | ... | - min_rate - Lower limit of search [pps]. Type: float
237 | | ... | - max_rate - Upper limit of search [pps]. Type: float
238 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
239 | | ... | - loss_acceptance - Accepted loss during search. Type: float
240 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
241 | | ...
242 | | ... | *Example:*
243 | | ...
244 | | ... | \| Find PDR using binary search and pps \| 64 \| 6000000 \
245 | | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \| 0.5 \
246 | | ... | \| percentage \|
247 | | ...
248 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
249 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
250 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
251 | | ...
252 | | ${duration}= | Set Variable | ${perf_trial_duration}
253 | | Set Duration | ${duration}
254 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
255 | | Set Search Frame Size | ${framesize}
256 | | Set Search Rate Type pps
257 | | Set Loss Acceptance | ${loss_acceptance}
258 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
259 | | ... | Set Loss Acceptance Type Percentage
260 | | Set Binary Convergence Threshold | ${threshold}
261 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
262 | | ${rate_per_stream} | ${lat}= | Verify Search Result
263 | | ${tmp}= | Create List | 100%PDR | ${lat}
264 | | ${latency}= | Create List | ${tmp}
265 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
266 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
267 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
268 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
269 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
270
271 | Find NDR using combined search and pps
272 | | [Documentation]
273 | | ... | Find throughput by using RFC2544 combined search (linear+binary) with
274 | | ... | non drop rate.
275 | | ...
276 | | ... | *Arguments:*
277 | | ... | - framesize - L2 Frame Size [B]. Type: integer
278 | | ... | - start_rate - Initial start rate [pps]. Type: float
279 | | ... | - step_rate - Step of linear search [pps]. Type: float
280 | | ... | - topology_type - Topology type. Type: string
281 | | ... | - min_rate - Lower limit of search [pps]. Type: float
282 | | ... | - max_rate - Upper limit of search [pps]. Type: float
283 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
284 | | ...
285 | | ... | *Example:*
286 | | ...
287 | | ... | \| Find NDR using combined search and pps \| 64 \| 5000000 \
288 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \|
289 | | ...
290 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
291 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
292 | | ...
293 | | ${duration}= | Set Variable | ${perf_trial_duration}
294 | | Set Duration | ${duration}
295 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
296 | | Set Search Linear Step | ${step_rate}
297 | | Set Search Frame Size | ${framesize}
298 | | Set Search Rate Type pps
299 | | Set Binary Convergence Threshold | ${threshold}
300 | | Combined Search | ${start_rate} | ${topology_type}
301 | | ${rate_per_stream} | ${lat}= | Verify Search Result
302 | | ${tmp}= | Create List | 100%NDR | ${lat}
303 | | ${latency}= | Create List | ${tmp}
304 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
305 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
306 | | ... | ${framesize} | ${topology_type}
307 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
308 | | Append To List | ${latency} | ${tmp}
309 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
310 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
311 | | ... | ${framesize} | ${topology_type}
312 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
313 | | Append To List | ${latency} | ${tmp}
314 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
315 | | ... | ${latency}
316 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
317 | | ... | ${framesize} | ${topology_type}
318 | | ... | fail_on_loss=${False}
319
320 | Find PDR using combined search and pps
321 | | [Documentation]
322 | | ... | Find throughput by using RFC2544 combined search (linear+binary) with
323 | | ... | partial drop rate with PDR threshold and type specified by parameter.
324 | | ...
325 | | ... | *Arguments:*
326 | | ... | - framesize - L2 Frame Size [B]. Type: integer
327 | | ... | - start_rate - Initial start rate [pps]. Type: float
328 | | ... | - step_rate - Step of linear search [pps]. Type: float
329 | | ... | - topology_type - Topology type. Type: string
330 | | ... | - min_rate - Lower limit of search [pps]. Type: float
331 | | ... | - max_rate - Upper limit of search [pps]. Type: float
332 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
333 | | ... | - loss_acceptance - Accepted loss during search. Type: float
334 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
335 | | ...
336 | | ... | *Example:*
337 | | ...
338 | | ... | \| Find PDR using combined search and pps \| 64 \| 5000000 \
339 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \| 0.5 \
340 | | ... | \| percentage \|
341 | | ...
342 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
343 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
344 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
345 | | ...
346 | | ${duration}= | Set Variable | ${perf_trial_duration}
347 | | Set Duration | ${duration}
348 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
349 | | Set Search Linear Step | ${step_rate}
350 | | Set Search Frame Size | ${framesize}
351 | | Set Search Rate Type pps
352 | | Set Loss Acceptance | ${loss_acceptance}
353 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
354 | | ... | Set Loss Acceptance Type Percentage
355 | | Set Binary Convergence Threshold | ${threshold}
356 | | Combined Search | ${start_rate} | ${topology_type}
357 | | ${rate_per_stream} | ${lat}= | Verify Search Result
358 | | ${tmp}= | Create List | 100%PDR | ${lat}
359 | | ${latency}= | Create List | ${tmp}
360 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
361 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
362 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
363 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
364 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
365
366 | Display result of NDR search
367 | | [Documentation]
368 | | ... | Display result of NDR search in packet per seconds (total and per
369 | | ... | stream) and Gbps total bandwidth with untagged packet.
370 | | ... | Througput is calculated as:
371 | | ... | Measured rate per stream * Total number of streams
372 | | ... | Bandwidth is calculated as:
373 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
374 | | ...
375 | | ... | *Arguments:*
376 | | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string
377 | | ... | - framesize - L2 Frame Size [B]. Type: integer
378 | | ... | - nr_streams - Total number of streams. Type: integer
379 | | ... | - latency - Latency stats. Type: dictionary
380 | | ...
381 | | ... | *Example:*
382 | | ...
383 | | ... | \| Display result of NDR search \| 4400000 \| 64 \| 2 \
384 | | ... | \| [100%NDR, [10/10/10, 1/2/3]] \|
385 | | ...
386 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams} | ${latency}
387 | | ...
388 | | ${framesize}= | Get Frame Size | ${framesize}
389 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
390 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
391 | | Set Test Message | FINAL_RATE: ${rate_total} pps
392 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes
393 | | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged)
394 | | ... | append=yes
395 | | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes
396 | | :FOR | ${lat} | IN | @{latency}
397 | | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes
398
399 | Display result of PDR search
400 | | [Documentation]
401 | | ... | Display result of PDR search in packet per seconds (total and per
402 | | ... | stream) and Gbps total bandwidth with untagged packet.
403 | | ... | Througput is calculated as:
404 | | ... | Measured rate per stream * Total number of streams
405 | | ... | Bandwidth is calculated as:
406 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
407 | | ...
408 | | ... | *Arguments:*
409 | | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string
410 | | ... | - framesize - L2 Frame Size [B]. Type: integer
411 | | ... | - nr_streams - Total number of streams. Type: integer
412 | | ... | - loss_acceptance - Accepted loss during search. Type: float
413 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
414 | | ... | - latency - Latency stats. Type: dictionary
415 | | ...
416 | | ... | *Example:*
417 | | ...
418 | | ... | \| Display result of PDR search \| 4400000 \| 64 \| 2 \| 0.5 \
419 | | ... | \| percentage \| [100%NDR, [10/10/10, 1/2/3]] \|
420 | | ...
421 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams}
422 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
423 | | ...
424 | | ${framesize}= | Get Frame Size | ${framesize}
425 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
426 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
427 | | Set Test Message | FINAL_RATE: ${rate_total} pps
428 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes
429 | | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged)
430 | | ... | append=yes
431 | | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes
432 | | :FOR | ${lat} | IN | @{latency}
433 | | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes
434 | | Set Test Message
435 | | ... | ${\n}LOSS_ACCEPTANCE: ${loss_acceptance} ${loss_acceptance_type}
436 | | ... | append=yes
437
438 | Display raw results
439 | | [Documentation]
440 | | ... | Display raw results from TG in total received/send packets over trial
441 | | ... | duration in seconds.
442 | | ...
443 | | ... | *Arguments:*
444 | | ... | - framesize - L2 Frame Size [B]. Type: integer
445 | | ... | - results - Measured results. Type: string
446 | | ...
447 | | ... | *Example:*
448 | | ...
449 | | ... | \| Display raw results \| 64 \| results \|
450 | | ...
451 | | [Arguments] | ${framesize} | ${results}
452 | | ...
453 | | ${framesize}= | Get Frame Size | ${framesize}
454 | | @{tokens}= | Split String | ${results} | ,
455 | | @{received}= | Split String | @{tokens}[1] | =
456 | | @{sent}= | Split String | @{tokens}[2] | =
457 | | ${total_received} = | Set Variable | @{received}[1]
458 | | ${total_sent} = | Set Variable | @{sent}[1]
459 | | Set Test Message | MaxReceivedRate_Results [pkts/${perf_trial_duration}sec]:
460 | | Set Test Message | tx ${total_sent}, rx ${total_received} | append=yes
461
462 | Measure latency pps
463 | | [Documentation]
464 | | ... | Send traffic at specified rate. Measure min/avg/max latency
465 | | ...
466 | | ... | *Arguments:*
467 | | ... | - duration - Duration of traffic run [s]. Type: integer
468 | | ... | - rate - Rate for sending packets. Type: integer
469 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
470 | | ... | - topology_type - Topology type. Type: string
471 | | ...
472 | | ... | *Example:*
473 | | ...
474 | | ... | \| Measure latency \| 10 \| 4.0 \| 64 \| 3-node-IPv4 \|
475 | | ...
476 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
477 | | ...
478 | | Return From Keyword If | ${rate} <= 10000 | ${-1}
479 | | ${ret}= | Is DPDK performance test
480 | | Run Keyword If | ${ret}==${False} | Clear all counters on all DUTs
481 | | Send traffic on tg | ${duration} | ${rate}pps | ${framesize}
482 | | ... | ${topology_type} | warmup_time=0
483 | | Run Keyword If | ${ret}==${False} | Show statistics on all DUTs | ${nodes}
484 | | Run keyword and return | Get latency
485
486 | Traffic should pass with no loss
487 | | [Documentation]
488 | | ... | Send traffic at specified rate. No packet loss is accepted at loss
489 | | ... | evaluation.
490 | | ...
491 | | ... | *Arguments:*
492 | | ... | - duration - Duration of traffic run [s]. Type: integer
493 | | ... | - rate - Rate for sending packets. Type: string
494 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
495 | | ... | - topology_type - Topology type. Type: string
496 | | ... | - fail_on_loss - If True, the keyword fails if loss occurred.
497 | | ... | Type: boolean
498 | | ...
499 | | ... | *Example:*
500 | | ...
501 | | ... | \| Traffic should pass with no loss \| 10 \| 4.0mpps \| 64 \
502 | | ... | \| 3-node-IPv4 \|
503 | | ...
504 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
505 | | ... | ${fail_on_loss}=${True}
506 | | ...
507 | | Send traffic at specified rate | ${duration} | ${rate} | ${framesize}
508 | | ... | ${topology_type}
509 | | Run Keyword If | ${fail_on_loss} | No traffic loss occurred
510
511 | Traffic should pass with partial loss
512 | | [Documentation]
513 | | ... | Send traffic at specified rate. Partial packet loss is accepted
514 | | ... | within loss acceptance value specified as argument.
515 | | ...
516 | | ... | *Arguments:*
517 | | ... | - duration - Duration of traffic run [s]. Type: integer
518 | | ... | - rate - Rate for sending packets. Type: string
519 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
520 | | ... | - topology_type - Topology type. Type: string
521 | | ... | - loss_acceptance - Accepted loss during search. Type: float
522 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
523 | | ...
524 | | ... | *Example:*
525 | | ...
526 | | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \
527 | | ... | \| 3-node-IPv4 \| 0.5 \| percentage \|
528 | | ...
529 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
530 | | ... | ${loss_acceptance} | ${loss_acceptance_type}
531 | | ... | ${fail_on_loss}=${True}
532 | | ...
533 | | Send traffic at specified rate | ${duration} | ${rate} | ${framesize}
534 | | ... | ${topology_type}
535 | | Run Keyword If | ${fail_on_loss} | Partial traffic loss accepted
536 | | ... | ${loss_acceptance} | ${loss_acceptance_type}
537
538 | Traffic should pass with maximum rate
539 | | [Documentation]
540 | | ... | Send traffic at maximum rate.
541 | | ...
542 | | ... | *Arguments:*
543 | | ... | - duration - Duration of traffic run [s]. Type: integer
544 | | ... | - rate - Rate for sending packets. Type: string
545 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
546 | | ... | - topology_type - Topology type. Type: string
547 | | ... | Type: boolean
548 | | ...
549 | | ... | *Example:*
550 | | ...
551 | | ... | \| Traffic should pass with no loss \| 10 \| 4.0mpps \| 64 \
552 | | ... | \| 3-node-IPv4 \|
553 | | ...
554 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
555 | | ...
556 | | ${results}= | Send traffic at specified rate | ${duration} | ${rate}
557 | | ... | ${framesize} | ${topology_type}
558 | | Display raw results | ${framesize} | ${results}
559
560 | Send traffic at specified rate
561 | | [Documentation]
562 | | ... | Send traffic at specified rate.
563 | | ...
564 | | ... | *Arguments:*
565 | | ... | - duration - Duration of traffic run [s]. Type: integer
566 | | ... | - rate - Rate for sending packets. Type: string
567 | | ... | - framesize - L2 Frame Size [B]. Type: integer/string
568 | | ... | - topology_type - Topology type. Type: string
569 | | ... | Type: boolean
570 | | ...
571 | | ... | *Example:*
572 | | ...
573 | | ... | \| Send traffic at specific rate \| 10 \| 4.0mpps \| 64 \
574 | | ... | \| 3-node-IPv4 \|
575 | | ...
576 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
577 | | ...
578 | | Clear and show runtime counters with running traffic | ${duration}
579 | | ... | ${rate} | ${framesize} | ${topology_type}
580 | | ${ret}= | Is DPDK performance test
581 | | Run Keyword If | ${ret}==${False} | Clear all counters on all DUTs
582 | | Run Keyword If | ${ret}==${False} and ${pkt_trace}==${True}
583 | | ... | VPP Enable Traces On All DUTs | ${nodes}
584 | | ${results} = | Send traffic on tg | ${duration} | ${rate} | ${framesize}
585 | | ... | ${topology_type} | warmup_time=0
586 | | Run Keyword If | ${ret}==${False} | Show statistics on all DUTs | ${nodes}
587 | | Run Keyword If | ${ret}==${False} and ${pkt_trace}==${True}
588 | | ... | Show Packet Trace On All Duts | ${nodes}
589 | | Return From Keyword | ${results}
590
591 | Clear and show runtime counters with running traffic
592 | | [Documentation]
593 | | ... | Start traffic at specified rate then clear runtime counters on all
594 | | ... | DUTs. Wait for specified amount of time and capture runtime counters
595 | | ... | on all DUTs. Finally stop traffic
596 | | ...
597 | | ... | *Arguments:*
598 | | ... | - duration - Duration of traffic run [s]. Type: integer
599 | | ... | - rate - Rate for sending packets. Type: string
600 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
601 | | ... | - topology_type - Topology type. Type: string
602 | | ...
603 | | ... | *Example:*
604 | | ...
605 | | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \
606 | | ... | \| 3-node-IPv4 \| 0.5 \| percentage \|
607 | | ...
608 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
609 | | ...
610 | | Send traffic on tg | -1 | ${rate} | ${framesize} | ${topology_type}
611 | | ... | warmup_time=0 | async_call=${True} | latency=${False}
612 | | ${ret}= | Is DPDK performance test
613 | | Run Keyword If | ${ret}==${False}
614 | | ... | Clear runtime counters on all DUTs | ${nodes}
615 | | Sleep | ${duration}
616 | | Run Keyword If | ${ret}==${False}
617 | | ... | Show runtime counters on all DUTs | ${nodes}
618 | | Stop traffic on tg