+| |
+| | ... | \| Start Traffic on Background \| ${4000000.0} \|
+| |
+| | [Arguments] | ${rate}
+| |
+| | ${ppta} = | Get Packets Per Transaction Aggregated
+| | ${ramp_up_duration} = | Get Ramp Up Duration
+| | ${ramp_up_rate} = | Get Ramp Up Rate
+| | ${traffic_directions} = | Get Traffic Directions
+| | ${transaction_duration} = | Get Transaction Duration
+| | ${transaction_scale} = | Get Transaction Scale
+| | ${transaction_type} = | Get Transaction Type
+| | ${use_latency} = | Get Use Latency
+| | Call Resetter
+| | # Duration of -1 means we will stop traffic manually.
+| | Send traffic on tg
+| | ... | duration=${-1}
+| | ... | rate=${rate}
+| | ... | frame_size=${frame_size}
+| | ... | traffic_profile=${traffic_profile}
+| | ... | async_call=${True}
+| | ... | duration_limit=${0.0}
+| | ... | ppta=${ppta}
+| | ... | ramp_up_duration=${ramp_up_duration}
+| | ... | ramp_up_rate=${ramp_up_rate}
+| | ... | traffic_directions=${traffic_directions}
+| | ... | transaction_duration=${transaction_duration}
+| | ... | transaction_scale=${transaction_scale}
+| | ... | transaction_type=${transaction_type}
+| | ... | use_latency=${use_latency}
+| | # TODO: Ramp-up?
+
+| Stop Running Traffic
+| | [Documentation]
+| | ... | Stop the running traffic, return measurement result.
+| | ... | For bidirectional traffic, the reported values are bi-directional.
+| |
+| | ... | *Returns:*
+| | ... | - Measurement result. Type: ReceiveRateMeasurement
+| |
+| | ... | *Example:*
+| |
+| | ... | \${result}= \| Stop Running Traffic \|
+| |
+| | ${result}= | Stop traffic on tg
+| | Return From Keyword | ${result}
+
+| Traffic should pass with maximum rate
+| | [Documentation]
+| | ... | Send traffic at maximum rate.
+| | ... | Call \${resetter} (if defined) to reset DUT state before each trial.
+| | ... | Fail if no packets were forwarded.
+| |
+| | ... | *Test (or broader scope) variables read:*
+| | ... | - traffic_profile - Name of module defining traffic for measurements.
+| | ... | Type: string
+| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
+| | ... | string
+| | ... | - max_rate - Calculated maximal transmit rate [tps].
+| | ... | Type: float
+| | ... | - transaction_type - String identifier to determine how to count
+| | ... | transactions. Default is "packet".
+| |
+| | ... | *Example:*
+| |
+| | ... | \| Traffic should pass with maximum rate \|
+| |
+| | ${max_rate} = | Get Max Rate
+| | ${transaction_type} = | Get Transaction Type
+| | ${trial_duration} = | Get Mrr Trial Duration
+| | ${trial_multiplicity} = | Get Mrr Trial Multiplicity
+| | ${use_latency} = | Get Use Latency
+| | # The following also sets \${rate_for_teardown}
+| | ${results} = | Send traffic at specified rate
+| | ... | rate=${max_rate}
+| | ... | trial_duration=${trial_duration}
+| | ... | trial_multiplicity=${trial_multiplicity}
+| | ... | use_latency=${use_latency}
+| | ... | duration_limit=${0.0}
+| | ${unit} = | Set Variable If | """_cps""" in """${transaction_type}"""
+| | ... | estimated connections per second | packets per second
+| | Set Test Message | ${\n}Maximum Receive Rate trial results
+| | Set Test Message | in ${unit}: ${results}
+| | ... | append=yes
+| | Fail if no traffic forwarded