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