Support existing test types with ASTF
[csit.git] / resources / libraries / robot / performance / performance_utils.robot
1 # Copyright (c) 2020 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.PerfUtil
19 | Library | resources.libraries.python.InterfaceUtil
20 | Library | resources.libraries.python.TrafficGenerator
21 | Library | resources.libraries.python.TrafficGenerator.OptimizedSearch
22 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
23 | Library | resources.libraries.python.Trace
24 | Variables | resources/libraries/python/Constants.py
25 | Resource | resources/libraries/robot/performance/performance_actions.robot
26 | Resource | resources/libraries/robot/performance/performance_display.robot
27 | Resource | resources/libraries/robot/performance/performance_vars.robot
28 |
29 | Documentation
30 | ... | Performance suite keywords - utilities to find and verify NDR and PDR.
31 | ... | See performance_vars.robot for values accessed via there.
32
33 # Library/suite scope variables are maybe defined in performance_vars.robot.
34
35 *** Keywords ***
36 | Clear and show runtime counters with running traffic
37 | | [Documentation]
38 | | ... | Start traffic at specified rate then clear runtime counters on all
39 | | ... | DUTs. Wait for specified amount of time and capture runtime counters
40 | | ... | on all DUTs. Finally stop traffic.
41 | |
42 | | ... | TODO: Support resetter if this is not the first trial-ish action?
43 | |
44 | | ... | *Example:*
45 | |
46 | | ... | \| Clear and show runtime counters with running traffic \|
47 | |
48 | | ${ppta} = | Get Packets Per Transaction Aggregated
49 | | ${runtime_duration} = | Get Runtime Duration
50 | | ${runtime_rate} = | Get Runtime Rate
51 | | ${traffic_directions} = | Get Traffic Directions
52 | | ${transaction_duration} = | Get Transaction Duration
53 | | ${transaction_scale} = | Get Transaction Scale
54 | | ${transaction_type} = | Get Transaction Type
55 | | ${use_latency} = | Get Use Latency
56 | | # Duration of -1 means we will stop traffic manually.
57 | | Send traffic on tg
58 | | ... | duration=${-1}
59 | | ... | rate=${runtime_rate}
60 | | ... | frame_size=${frame_size}
61 | | ... | traffic_profile=${traffic_profile}
62 | | ... | async_call=${True}
63 | | ... | ppta=${ppta}
64 | | ... | use_latency=${use_latency}
65 | | ... | traffic_directions=${traffic_directions}
66 | | ... | transaction_duration=${transaction_duration}
67 | | ... | transaction_scale=${transaction_scale}
68 | | ... | transaction_type=${transaction_type}
69 | | ... | duration_limit=${0.0}
70 | | FOR | ${action} | IN | @{pre_run_stats}
71 | | | Run Keyword | Additional Statistics Action For ${action}
72 | | END
73 | | Sleep | ${runtime_duration}
74 | | FOR | ${action} | IN | @{post_run_stats}
75 | | | Run Keyword | Additional Statistics Action For ${action}
76 | | END
77 | | Stop traffic on tg
78
79 | Find critical load using PLRsearch
80 | | [Documentation]
81 | | ... | Find boundaries for troughput (of hardcoded target loss ratio)
82 | | ... | using PLRsearch algorithm.
83 | | ... | Display results as formatted test message.
84 | | ... | Fail if computed lower bound is 110% of the minimal rate or less.
85 | | ... | Input rates are understood as uni-directional,
86 | | ... | reported result contains aggregate rates.
87 | | ... | Currently, the min_rate value is hardcoded to match test teardowns.
88 | | ... | Call \${resetter} (if defined) to reset DUT state before each trial.
89 | |
90 | | ... | *Test (or broader scope) variables read:*
91 | | ... | - traffic_profile - Name of module defining traffc for measurements.
92 | | ... | Type: string
93 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
94 | | ... | string
95 | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps].
96 | | ... | Type: float
97 | |
98 | | ... | *Example:*
99 | |
100 | | ... | \| Find critical load using PLR search \|
101 | |
102 | | # Get values via performance_vars.
103 | | ${max_rate} = | Get Max Rate
104 | | ${min_rate} = | Get Min Rate
105 | | ${ppta} = | Get Packets Per Transaction Aggregated
106 | | ${resetter} = | Get Resetter
107 | | ${traffic_directions} = | Get Traffic Directions
108 | | ${transaction_duration} = | Get Transaction Duration
109 | | ${transaction_scale} = | Get Transaction Scale
110 | | ${transaction_type} = | Get Transaction Type
111 | | ${use_latency} = | Get Use Latency
112 | | ${average} | ${stdev} = | Perform soak search
113 | | ... | frame_size=${frame_size}
114 | | ... | traffic_profile=${traffic_profile}
115 | | ... | minimum_transmit_rate=${min_rate}
116 | | ... | maximum_transmit_rate=${max_rate}
117 | | ... | plr_target=${1e-7}
118 | | ... | tdpt=${0.1}
119 | | ... | initial_count=${50}
120 | | ... | ppta=${ppta}
121 | | ... | resetter=${resetter}
122 | | ... | timeout=${1800.0}
123 | | ... | trace_enabled=${False}
124 | | ... | traffic_directions=${traffic_directions}
125 | | ... | transaction_scale=${transaction_scale}
126 | | ... | transaction_duration=${transaction_duration}
127 | | ... | transaction_type=${transaction_type}
128 | | ... | use_latency=${use_latency}
129 | | ${lower} | ${upper} = | Display result of soak search
130 | | ... | ${average} | ${stdev}
131 | | Set Test Variable | \${rate for teardown} | ${lower}
132 | | Should Not Be True | 1.1 * ${min_rate} > ${lower}
133 | | ... | Lower bound ${lower} too small for unidirectional minimum ${min_rate}.
134
135 | Find NDR and PDR intervals using optimized search
136 | | [Documentation]
137 | | ... | Find boundaries for RFC2544 compatible NDR and PDR values
138 | | ... | using an optimized search algorithm.
139 | | ... | Display findings as a formatted test message.
140 | | ... | Fail if a resulting lower bound has too high loss fraction.
141 | | ... | Input rates are understood as uni-directional,
142 | | ... | reported result contains aggregate rates.
143 | | ... | Additional latency measurements are performed for smaller loads,
144 | | ... | even if latency stream is disabled in search. Their results
145 | | ... | are also displayed.
146 | | ... | Finally, two measurements for runtime stats are done (not displayed).
147 | | ... | Currently, the min_rate value is hardcoded to 90kpps,
148 | | ... | allowing measurement at 10% of the discovered rate
149 | | ... | without breaking latency streams.
150 | | ... | Call \${resetter} (if defined) to reset DUT state before each trial.
151 | |
152 | | ... | *Test (or broader scope) variables read:*
153 | | ... | - traffic_profile - Name of module defining traffc for measurements.
154 | | ... | Type: string
155 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
156 | | ... | string
157 | | ... | - max_rate - Calculated maximal transmit rate [tps].
158 | | ... | Type: float
159 | | ... | - resetter - Callable to reset DUT state before each trial.
160 | | ... | - transaction_scale - Number of ASTF transaction (zero if unlimited).
161 | | ... | - transaction_type - String identifier to determine how to count
162 | | ... | transactions. Default is "packet".
163 | | ... | - disable_latency - If true, skip anything related to latency.
164 | | ... | Useful if transaction_scale is high and TPS is low. Default: false.
165 | |
166 | | ... | *Example:*
167 | |
168 | | ... | \| Find NDR and PDR intervals using optimized search \|
169 | |
170 | | # Get values via performance_vars.
171 | | ${disable_latency} = | Get Disable Latency
172 | | ${max_rate} = | Get Max Rate
173 | | ${min_rate} = | Get Min Rate
174 | | # \${packet_loss_ratio} is used twice so it is worth a variable.
175 | | ${packet_loss_ratio} = | Get Packet Loss Ratio
176 | | ${ppta} = | Get Packets Per Transaction Aggregated
177 | | ${resetter} = | Get Resetter
178 | | ${traffic_directions} = | Get Traffic Directions
179 | | ${transaction_duration} = | Get Transaction Duration
180 | | ${transaction_scale} = | Get Transaction Scale
181 | | ${transaction_type} = | Get Transaction Type
182 | | ${use_latency} = | Get Use Latency
183 | | ${result} = | Perform optimized ndrpdr search
184 | | ... | frame_size=${frame_size}
185 | | ... | traffic_profile=${traffic_profile}
186 | | ... | minimum_transmit_rate=${min_rate}
187 | | ... | maximum_transmit_rate=${max_rate}
188 | | ... | packet_loss_ratio=${packet_loss_ratio}
189 | | ... | final_relative_width=${0.005}
190 | | ... | final_trial_duration=${30.0}
191 | | ... | initial_trial_duration=${1.0}
192 | | ... | number_of_intermediate_phases=${2}
193 | | ... | timeout=${720.0}
194 | | ... | doublings=${2}
195 | | ... | ppta=${ppta}
196 | | ... | resetter=${resetter}
197 | | ... | traffic_directions=${traffic_directions}
198 | | ... | transaction_duration=${transaction_duration}
199 | | ... | transaction_scale=${transaction_scale}
200 | | ... | transaction_type=${transaction_type}
201 | | ... | use_latency=${use_latency}
202 | | Display result of NDRPDR search | ${result}
203 | | Check NDRPDR interval validity | ${result.pdr_interval}
204 | | ... | ${packet_loss_ratio}
205 | | Check NDRPDR interval validity | ${result.ndr_interval}
206 | | ${pdr} = | Set Variable | ${result.pdr_interval.measured_low.target_tr}
207 | | ${ndr} = | Set Variable | ${result.ndr_interval.measured_low.target_tr}
208 | | # We expect NDR and PDR to have different-looking stats.
209 | | Send traffic at specified rate
210 | | ... | rate=${pdr}
211 | | ... | trial_duration=${1.0}
212 | | ... | trial_multiplicity=${1}
213 | | ... | use_latency=${use_latency}
214 | | ... | duration_limit=${1.0}
215 | | Run Keyword If | ${ndr} != ${pdr}
216 | | ... | Send traffic at specified rate
217 | | ... | rate=${ndr}
218 | | ... | trial_duration=${1.0}
219 | | ... | trial_multiplicity=${1}
220 | | ... | use_latency=${use_latency}
221 | | ... | duration_limit=${1.0}
222 | | Return From Keyword If | ${disable_latency}
223 | | ${rate} = | Evaluate | 0.9 * ${pdr}
224 | | Measure and show latency at specified rate | Latency at 90% PDR: | ${rate}
225 | | ${rate} = | Evaluate | 0.5 * ${pdr}
226 | | Measure and show latency at specified rate | Latency at 50% PDR: | ${rate}
227 | | ${rate} = | Evaluate | 0.1 * ${pdr}
228 | | Measure and show latency at specified rate | Latency at 10% PDR: | ${rate}
229 | | Measure and show latency at specified rate | Latency at 0% PDR: | ${0.0}
230
231 | Find Throughput Using MLRsearch
232 | | [Documentation]
233 | | ... | Find and return lower bound NDR (zero PLR)
234 | | ... | aggregate throughput using MLRsearch algorithm.
235 | | ... | Input rates are understood as uni-directional.
236 | | ... | Currently, the min_rate value is hardcoded to match test teardowns.
237 | | ... | Call \${resetter} (if defined) to reset DUT state before each trial.
238 | |
239 | | ... | *Test (or broader scope) variables read:*
240 | | ... | - traffic_profile - Name of module defining traffc for measurements.
241 | | ... | Type: string
242 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
243 | | ... | string
244 | | ... | - max_rate - Calculated maximal transmit rate [tps].
245 | | ... | Type: float
246 | | ... | - resetter - Callable to reset DUT state before each trial.
247 | | ... | - transaction_scale - Number of ASTF transaction (zero if unlimited).
248 | | ... | - transaction_type - String identifier to determine how to count
249 | | ... | transactions. Default is "packet".
250 | |
251 | | ... | *Returns:*
252 | | ... | - Lower bound for bi-directional throughput at given PLR. Type: float
253 | |
254 | | ... | *Example:*
255 | |
256 | | ... | \| \${throughpt}= \| Find Throughput Using MLRsearch \|
257 | |
258 | | ${max_rate} = | Get Max Rate
259 | | ${min_rate} = | Get Min Rate
260 | | ${ppta} = | Get Packets Per Transaction Aggregated
261 | | ${resetter} = | Get Resetter
262 | | ${traffic_directions} = | Get Traffic Directions
263 | | ${transaction_duration} = | Get Transaction Duration
264 | | ${transaction_scale} = | Get Transaction Scale
265 | | ${transaction_type} = | Get Transaction Type
266 | | ${use_latency} = | Get Use Latency
267 | | ${result} = | Perform optimized ndrpdr search
268 | | ... | frame_size=${frame_size}
269 | | ... | traffic_profile=${traffic_profile}
270 | | ... | minimum_transmit_rate=${min_rate}
271 | | ... | maximum_transmit_rate=${max_rate}
272 | | ... | packet_loss_ratio=${0.0}
273 | | ... | final_relative_width=${0.001}
274 | | ... | final_trial_duration=${10.0}
275 | | ... | initial_trial_duration=${1.0}
276 | | ... | number_of_intermediate_phases=${1}
277 | | ... | timeout=${720}
278 | | ... | doublings=${2}
279 | | ... | ppta=${ppta}
280 | | ... | resetter=${resetter}
281 | | ... | traffic_directions=${traffic_directions}
282 | | ... | transaction_duration=${transaction_duration}
283 | | ... | transaction_scale=${transaction_scale}
284 | | ... | transaction_type=${transaction_type}
285 | | ... | use_latency=${use_latency}
286 | | Check NDRPDR interval validity | ${result.pdr_interval}
287 | | ... | ${0.0}
288 | | Return From Keyword | ${result.pdr_interval.measured_low.target_tr}
289
290 | Measure and show latency at specified rate
291 | | [Documentation]
292 | | ... | Send traffic at specified rate, single trial.
293 | | ... | Extract latency information and append it to text message.
294 | | ... | The rate argument is int, so should not include "pps".
295 | | ... | If the given rate is too low, a safe value is used instead.
296 | | ... | Call \${resetter} (if defined) to reset DUT state before each trial.
297 | |
298 | | ... | *Arguments:*
299 | | ... | - message_prefix - Preface to test message addition. Type: string
300 | | ... | - rate - Rate [tps] for sending packets.
301 | | ... | Type: float
302 | |
303 | | ... | *Example:*
304 | |
305 | | ... | \| Measure and show latency at specified rate \| Latency at 90% NDR \
306 | | ... | \| ${10000000} \|
307 | |
308 | | [Arguments] | ${message_prefix} | ${rate}
309 | |
310 | | ${min_rate} = | Get Min Rate
311 | | ${ppta} = | Get Packets Per Transaction Aggregated
312 | | ${real_rate} = | Evaluate | max(${rate}, ${min_rate})
313 | | ${traffic_directions} = | Get Traffic Directions
314 | | ${transaction_duration} = | Get Transaction Duration
315 | | ${transaction_scale} = | Get Transaction Scale
316 | | ${transaction_type} = | Get Transaction Type
317 | | Call Resetter
318 | | Send traffic on tg
319 | | ... | duration=${PERF_TRIAL_LATENCY_DURATION}
320 | | ... | rate=${real_rate}
321 | | ... | frame_size=${frame_size}
322 | | ... | traffic_profile=${traffic_profile}
323 | | ... | async_call=${False}
324 | | ... | duration_limit=${PERF_TRIAL_LATENCY_DURATION}
325 | | ... | ppta=${ppta}
326 | | ... | traffic_directions=${traffic_directions}
327 | | ... | transaction_duration=${transaction_duration}
328 | | ... | transaction_scale=${transaction_scale}
329 | | ... | transaction_type=${transaction_type}
330 | | ... | use_latency=${True}
331 | | ${latency} = | Get Latency Int
332 | | Set Test Message | ${\n}${message_prefix} ${latency} | append=${True}
333
334 | Send ramp-up traffic
335 | | [Documentation]
336 | | ... | Do nothing unless positive ramp-up duration is specified.
337 | | ... | Else perform one trial with appropriate rate and duration.
338 | | ... | This is useful for tests that set DUT state via traffic.
339 | | ... | Rate has to bee low enough so packets are not lost,
340 | | ... | Duration has to be long enough to set all the state.
341 | | ... | The trial results are discarded.
342 | |
343 | | ... | *Test (or broader scope) variables read:*
344 | | ... | - traffic_profile - Name of module defining traffic for measurements.
345 | | ... | Type: string
346 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
347 | | ... | string
348 | | ... | - ramp_up_duration - Suitable traffic duration [s].
349 | | ... | Type: float
350 | | ... | - ramp_up_rate - Suitable transmit rate [tps].
351 | | ... | Type: float
352 | | ... | - transaction_type - String identifier to determine how to count
353 | | ... | transactions. Default is "packet".
354 | |
355 | | ... | *Example:*
356 | |
357 | | ... | \| Send ramp-up traffic \|
358 | |
359 | | ${ramp_up_duration} = | Get Ramp Up Duration
360 | | Run Keyword Unless | ${ramp_up_duration} > 0.0 | Return From Keyword
361 | | ${ramp_up_rate} = | Get Ramp Up Rate
362 | | ${ppta} = | Get Packets Per Transaction Aggregated
363 | | ${traffic_directions} = | Get Traffic Directions
364 | | ${transaction_duration} = | Get Transaction Duration
365 | | ${transaction_scale} = | Get Transaction Scale
366 | | ${transaction_type} = | Get Transaction Type
367 | | ${use_latency} = | Get Use Latency
368 | | Send traffic on tg
369 | | ... | duration=${ramp_up_duration}
370 | | ... | rate=${ramp_up_rate}
371 | | ... | frame_size=${frame_size}
372 | | ... | traffic_profile=${traffic_profile}
373 | | ... | async_call=${False}
374 | | ... | duration_limit=${0.0}
375 | | ... | ppta=${ppta}
376 | | ... | use_latency=${use_latency}
377 | | ... | traffic_directions=${traffic_directions}
378 | | ... | transaction_duration=${transaction_duration}
379 | | ... | transaction_scale=${transaction_scale}
380 | | ... | transaction_type=${transaction_type}
381
382 | Send traffic at specified rate
383 | | [Documentation]
384 | | ... | Perform a warmup, show runtime counters during it.
385 | | ... | Then send traffic at specified rate, possibly multiple trials.
386 | | ... | Show various DUT stats, optionally also packet trace.
387 | | ... | Return list of measured receive rates.
388 | | ... | Call \${resetter} (if defined) to reset DUT state before each trial.
389 | |
390 | | ... | *Arguments:*
391 | | ... | - trial_duration - Duration of single trial [s]. Type: float
392 | | ... | - rate - Target transmit rate [tps]. Type: float
393 | | ... | Type: string
394 | | ... | - trial_multiplicity - How many trials in this measurement.
395 | | ... | Type: boolean
396 | | ... | - use_latency - Use latency stream in search; default value: False.
397 | | ... | Type: boolean
398 | | ... | - duration_limit - Hard limit for trial duration, overriding duration
399 | | ... | computed from transaction_scale. Default 0.0 means no limit.
400 | |
401 | | ... | *Example:*
402 | |
403 | | ... | \| Send traffic at specified rate \| \${1.0} \| ${4000000.0} \
404 | | ... | \| \${10} \| ${False} \| ${1.0} \|
405 | |
406 | | [Arguments] | ${trial_duration} | ${rate} | ${trial_multiplicity}
407 | | ... | ${use_latency}=${False} | ${duration_limit}=${0.0}
408 | |
409 | | ${ppta} = | Get Packets Per Transaction Aggregated
410 | | ${traffic_directions} = | Get Traffic Directions
411 | | ${transaction_duration} = | Get Transaction Duration
412 | | ${transaction_scale} = | Get Transaction Scale
413 | | ${transaction_type} = | Get Transaction Type
414 | | Set Test Variable | \${rate_for_teardown} | ${rate}
415 | | FOR | ${action} | IN | @{pre_stats}
416 | | | Run Keyword | Additional Statistics Action For ${action}
417 | | END
418 | | ${results} = | Create List
419 | | FOR | ${i} | IN RANGE | ${trial_multiplicity}
420 | | | Call Resetter
421 | | | Send traffic on tg
422 | | | ... | duration=${trial_duration}
423 | | | ... | rate=${rate}
424 | | | ... | frame_size=${frame_size}
425 | | | ... | traffic_profile=${traffic_profile}
426 | | | ... | async_call=${False}
427 | | | ... | duration_limit=${duration_limit}
428 | | | ... | ppta=${ppta}
429 | | | ... | traffic_directions=${traffic_directions}
430 | | | ... | transaction_duration=${transaction_duration}
431 | | | ... | transaction_scale=${transaction_scale}
432 | | | ... | transaction_type=${transaction_type}
433 | | | ... | use_latency=${use_latency}
434 | | | ${result}= | Get Measurement Result
435 | | | # Out of several quantities for aborted traffic (duration stretching),
436 | | | # the approximated receive rate is the best estimate we have.
437 | | | Append To List | ${results} | ${result.approximated_receive_rate}
438 | | END
439 | | FOR | ${action} | IN | @{post_stats}
440 | | | Run Keyword | Additional Statistics Action For ${action}
441 | | END
442 | | Return From Keyword | ${results}
443
444 | Start Traffic on Background
445 | | [Documentation]
446 | | ... | Start traffic at specified rate then return control to Robot.
447 | | ... | This keyword is useful if the test needs to do something
448 | | ... | while traffic is running.
449 | |
450 | | ... | *Test (or broader scope) variables read:*
451 | | ... | - traffic_profile - Name of module defining traffc for measurements.
452 | | ... | Type: string
453 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
454 | | ... | string
455 | | ... | *Arguments:*
456 | | ... | - rate - Rate [tps] for sending packets.
457 | | ... | Type: float
458 | |
459 | | ... | *Example:*
460 | |
461 | | ... | \| Start Traffic on Background \| ${4000000.0} \|
462 | |
463 | | [Arguments] | ${rate}
464 | |
465 | | ${ppta} = | Get Packets Per Transaction Aggregated
466 | | ${traffic_directions} = | Get Traffic Directions
467 | | ${transaction_duration} = | Get Transaction Duration
468 | | ${transaction_scale} = | Get Transaction Scale
469 | | ${transaction_type} = | Get Transaction Type
470 | | ${use_latency} = | Get Use Latency
471 | | Call Resetter
472 | | # Duration of -1 means we will stop traffic manually.
473 | | Send traffic on tg
474 | | ... | duration=${-1}
475 | | ... | rate=${rate}
476 | | ... | frame_size=${frame_size}
477 | | ... | traffic_profile=${traffic_profile}
478 | | ... | async_call=${True}
479 | | ... | duration_limit=${0.0}
480 | | ... | ppta=${ppta}
481 | | ... | traffic_directions=${traffic_directions}
482 | | ... | transaction_duration=${transaction_duration}
483 | | ... | transaction_scale=${transaction_scale}
484 | | ... | transaction_type=${transaction_type}
485 | | ... | use_latency=${use_latency}
486
487 | Stop Running Traffic
488 | | [Documentation]
489 | | ... | Stop the running traffic, return measurement result.
490 | | ... | For bidirectional traffic, the reported values are bi-directional.
491 | |
492 | | ... | *Returns:*
493 | | ... | - Measurement result. Type: ReceiveRateMeasurement
494 | |
495 | | ... | *Example:*
496 | |
497 | | ... | \${result}= \| Stop Running Traffic \|
498 | |
499 | | ${result}= | Stop traffic on tg
500 | | Return From Keyword | ${result}
501
502 | Traffic should pass with maximum rate
503 | | [Documentation]
504 | | ... | Send traffic at maximum rate.
505 | | ... | Call \${resetter} (if defined) to reset DUT state before each trial.
506 | | ... | Fail if no packets were forwarded.
507 | |
508 | | ... | *Test (or broader scope) variables read:*
509 | | ... | - traffic_profile - Name of module defining traffic for measurements.
510 | | ... | Type: string
511 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
512 | | ... | string
513 | | ... | - max_rate - Calculated maximal transmit rate [tps].
514 | | ... | Type: float
515 | | ... | - transaction_type - String identifier to determine how to count
516 | | ... | transactions. Default is "packet".
517 | |
518 | | ... | *Example:*
519 | |
520 | | ... | \| Traffic should pass with maximum rate \|
521 | |
522 | | ${max_rate} = | Get Max Rate
523 | | ${transaction_type} = | Get Transaction Type
524 | | ${trial_duration} = | Get Mrr Trial Duration
525 | | ${trial_multiplicity} = | Get Mrr Trial Multiplicity
526 | | ${use_latency} = | Get Use Latency
527 | | # The following also sets \${rate_for_teardown}
528 | | ${results} = | Send traffic at specified rate
529 | | ... | rate=${max_rate}
530 | | ... | trial_duration=${trial_duration}
531 | | ... | trial_multiplicity=${trial_multiplicity}
532 | | ... | use_latency=${use_latency}
533 | | ... | duration_limit=${0.0}
534 | | ${unit} = | Set Variable If | """_cps""" in """${transaction_type}"""
535 | | ... | estimated connections per second | packets per second
536 | | Set Test Message | ${\n}Maximum Receive Rate trial results
537 | | Set Test Message | in ${unit}: ${results}
538 | | ... | append=yes
539 | | Fail if no traffic forwarded