python3: fix RF 'only continuation marker' warning
[csit.git] / resources / libraries / robot / performance / performance_utils.robot
1 # Copyright (c) 2019 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.InterfaceUtil
19 | Library | resources.libraries.python.TrafficGenerator
20 | Library | resources.libraries.python.TrafficGenerator.OptimizedSearch
21 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
22 | Library | resources.libraries.python.Trace
23 | Variables | resources/libraries/python/Constants.py
24 |
25 | Documentation
26 | ... | Performance suite keywords - utilities to find and verify NDR and PDR.
27
28 *** Keywords ***
29 | Find NDR and PDR intervals using optimized search
30 | | [Documentation]
31 | | ... | Find boundaries for RFC2544 compatible NDR and PDR values
32 | | ... | using an optimized search algorithm.
33 | | ... | Display findings as a formatted test message.
34 | | ... | Fail if a resulting lower bound has too high loss fraction.
35 | | ... | Input rates are understood as uni-directional,
36 | | ... | reported result contains aggregate rates.
37 | | ... | Currently, the min_rate value is hardcoded to match test teardowns.
38 | |
39 | | ... | *Test (or broader scope) variables read:*
40 | | ... | - traffic_profile - Name of module defining traffc for measurements.
41 | | ... | Type: string
42 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str
43 | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps].
44 | | ... | Type: float
45 | |
46 | | ... | *Arguments:*
47 | | ... | - packet_loss_ratio - Accepted loss during search. Type: float
48 | | ... | - final_relative_width - Maximal width multiple of upper. Type: float
49 | | ... | - final_trial_duration - Duration of final trials [s]. Type: float
50 | | ... | - initial_trial_duration - Duration of initial trials [s]. Type: float
51 | | ... | - intermediate phases - Number of intermediate phases [1]. Type: int
52 | | ... | - timeout - Fail if search duration is longer [s]. Type: float
53 | | ... | - doublings - How many doublings to do when expanding [1]. Type: int
54 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
55 | | ... | Type: int
56 | |
57 | | ... | *Example:*
58 | |
59 | | ... | \| Find NDR and PDR intervals using optimized search \| \${0.005} \
60 | | ... | \| \${0.005} \| \${30.0} \| \${1.0} \| \${2} \| \${600.0} \| \${2} \
61 | | ... | \| \${2} \|
62 | |
63 | | [Arguments] | ${packet_loss_ratio}=${0.005}
64 | | ... | ${final_relative_width}=${0.005} | ${final_trial_duration}=${30.0}
65 | | ... | ${initial_trial_duration}=${1.0}
66 | | ... | ${number_of_intermediate_phases}=${2} | ${timeout}=${720.0}
67 | | ... | ${doublings}=${2} | ${traffic_directions}=${2}
68 | |
69 | | ${result} = | Perform optimized ndrpdr search | ${frame_size}
70 | | ... | ${traffic_profile} | ${10000} | ${max_rate}
71 | | ... | ${packet_loss_ratio} | ${final_relative_width}
72 | | ... | ${final_trial_duration} | ${initial_trial_duration}
73 | | ... | ${number_of_intermediate_phases} | timeout=${timeout}
74 | | ... | doublings=${doublings} | traffic_directions=${traffic_directions}
75 | | Display result of NDRPDR search | ${result}
76 | | Check NDRPDR interval validity | ${result.pdr_interval}
77 | | ... | ${packet_loss_ratio}
78 | | Check NDRPDR interval validity | ${result.ndr_interval}
79 | | ${rate_sum}= | Set Variable | ${result.ndr_interval.measured_low.target_tr}
80 | | ${rate_per_stream}= | Evaluate | ${rate_sum} / float(${traffic_directions})
81 | | Send traffic at specified rate
82 | | ... | ${2.0} | ${rate_per_stream}pps | ${framesize} | ${traffic_profile}
83 | | ... | traffic_directions=${traffic_directions}
84 | | ${rate_sum}= | Set Variable | ${result.pdr_interval.measured_low.target_tr}
85 | | ${rate_per_stream}= | Evaluate | ${rate_sum} / float(${traffic_directions})
86 | | Send traffic at specified rate
87 | | ... | ${2.0} | ${rate_per_stream}pps | ${framesize} | ${traffic_profile}
88 | | ... | traffic_directions=${traffic_directions}
89
90 | Find Throughput Using MLRsearch
91 | | [Documentation]
92 | | ... | Find and return lower bound PDR (zero PLR by default)
93 | | ... | aggregate throughput using MLRsearch algorithm.
94 | | ... | Input rates are understood as uni-directional.
95 | | ... | Currently, the min_rate value is hardcoded to match test teardowns.
96 | |
97 | | ... | *Test (or broader scope) variables read:*
98 | | ... | - traffic_profile - Name of module defining traffc for measurements.
99 | | ... | Type: string
100 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str
101 | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps].
102 | | ... | Type: float
103 | |
104 | | ... | *Arguments:*
105 | | ... | - packet_loss_ratio - Accepted loss during search. Type: float
106 | | ... | - final_relative_width - Maximal width multiple of upper. Type: float
107 | | ... | - final_trial_duration - Duration of final trials [s]. Type: float
108 | | ... | - initial_trial_duration - Duration of initial trials [s]. Type: float
109 | | ... | - intermediate phases - Number of intermediate phases [1]. Type: int
110 | | ... | - timeout - Fail if search duration is longer [s]. Type: float
111 | | ... | - doublings - How many doublings to do when expanding [1]. Type: int
112 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
113 | | ... | Type: int
114 | |
115 | | ... | *Returns:*
116 | | ... | - Lower bound for bi-directional throughput at given PLR. Type: float
117 | |
118 | | ... | *Example:*
119 | |
120 | | ... | \| \${throughpt}= \| Find Throughput Using MLRsearch \| \${0} \
121 | | ... | \| \${0.001} \| \${10.0}\| \${1.0} \| \${1} \| \${720.0} \| \${2} \
122 | | ... | \| \${2} \|
123 | |
124 | | [Arguments] | ${packet_loss_ratio}=${0.0}
125 | | ... | ${final_relative_width}=${0.001} | ${final_trial_duration}=${10.0}
126 | | ... | ${initial_trial_duration}=${1.0}
127 | | ... | ${number_of_intermediate_phases}=${1} | ${timeout}=${720.0}
128 | | ... | ${doublings}=${2} | ${traffic_directions}=${2}
129 | |
130 | | ${result} = | Perform optimized ndrpdr search | ${frame_size}
131 | | ... | ${traffic_profile} | ${10000} | ${max_rate}
132 | | ... | ${packet_loss_ratio} | ${final_relative_width}
133 | | ... | ${final_trial_duration} | ${initial_trial_duration}
134 | | ... | ${number_of_intermediate_phases} | timeout=${timeout}
135 | | ... | doublings=${doublings} | traffic_directions=${traffic_directions}
136 | | Return From Keyword | ${result.pdr_interval.measured_low.transmit_rate}
137
138 | Find critical load using PLRsearch
139 | | [Documentation]
140 | | ... | Find boundaries for troughput (of given target loss ratio)
141 | | ... | using PLRsearch algorithm.
142 | | ... | Display results as formatted test message.
143 | | ... | Fail if computed lower bound is below minimal rate.
144 | | ... | Input rates are understood as uni-directional,
145 | | ... | reported result contains aggregate rates.
146 | | ... | Currently, the min_rate value is hardcoded to match test teardowns.
147 | |
148 | | ... | *Test (or broader scope) variables read:*
149 | | ... | - traffic_profile - Name of module defining traffc for measurements.
150 | | ... | Type: string
151 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str
152 | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps].
153 | | ... | Type: float
154 | |
155 | | ... | *Arguments:*
156 | | ... | - packet_loss_ratio - Accepted loss during search. Type: float
157 | | ... | - timeout - Stop when search duration is longer [s]. Type: float
158 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
159 | | ... | Type: int
160 | |
161 | | ... | *Example:*
162 | |
163 | | ... | \| Find critical load using PLR search \| \${1e-7} \| \${120} \
164 | | ... | \| \${2} \|
165 | |
166 | | [Arguments] | ${packet_loss_ratio}=${1e-7} | ${timeout}=${1800.0}
167 | | ... | ${traffic_directions}=${2}
168 | |
169 | | ${min_rate} = | Set Variable | ${10000}
170 | | ${average} | ${stdev} = | Perform soak search | ${frame_size}
171 | | ... | ${traffic_profile} | ${min_rate} | ${max_rate}
172 | | ... | ${packet_loss_ratio} | timeout=${timeout}
173 | | ... | traffic_directions=${traffic_directions}
174 | | ${lower} | ${upper} = | Display result of soak search
175 | | ... | ${average} | ${stdev}
176 | | Should Not Be True | ${lower} < ${min_rate}
177 | | ... | Lower bound ${lower} is below unidirectional minimum ${min_rate}.
178
179 | Display single bound
180 | | [Documentation]
181 | | ... | Display one bound of NDR+PDR search,
182 | | ... | in packet per seconds (total and per stream)
183 | | ... | and Gbps total bandwidth (for initial packet size).
184 | | ... | Througput is calculated as:
185 | | ... | Sum of measured rates over streams
186 | | ... | Bandwidth is calculated as:
187 | | ... | (Throughput * (L2 Frame Size + IPG) * 8)
188 | | ... | The given result should contain latency data as well.
189 | |
190 | | ... | *Arguments:*
191 | | ... | - text - Flavor text describing which bound is this. Type: string
192 | | ... | - rate_total - Total (not per stream) measured Tr [pps]. Type: float
193 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
194 | | ... | - latency - Latency data to display if non-empty. Type: string
195 | |
196 | | ... | *Example:*
197 | |
198 | | ... | \| Display single bound \| NDR lower bound \| \${12345.67} \
199 | | ... | \| \${64} \| show_latency=\${EMPTY} \|
200 | |
201 | | [Arguments] | ${text} | ${rate_total} | ${frame_size} | ${latency}=${EMPTY}
202 | |
203 | | ${bandwidth_total} = | Evaluate | ${rate_total} * (${frame_size}+20)*8 / 1e9
204 | | Set Test Message | ${\n}${text}: ${rate_total} pps, | append=yes
205 | | Set Test Message | ${bandwidth_total} Gbps (initial) | append=yes
206 | | Return From Keyword If | not """${latency}"""
207 | | Set Test Message | ${\n}LATENCY [min/avg/max/hdrh] per stream: ${latency}
208 | | ... | append=yes
209
210 | Display Reconfig Test Message
211 | | [Documentation]
212 | | ... | Display the number of packets lost (bidirectionally)
213 | | ... | due to reconfiguration under traffic.
214 | |
215 | | ... | *Arguments:*
216 | | ... | - result - Result of bidirectional measurtement.
217 | | ... |   Type: ReceiveRateMeasurement
218 | |
219 | | ... | *Example:*
220 | |
221 | | ... | \| Display Reconfig Test Message \| \${result} \|
222 | |
223 | | [Arguments] | ${result}
224 | |
225 | | Set Test Message | Packets lost due to reconfig: ${result.loss_count}
226 | | ${time_lost} = | Evaluate | ${result.loss_count} / ${result.target_tr}
227 | | Set Test Message | ${\n}Implied time lost: ${time_lost} | append=yes
228
229 | Display result of NDRPDR search
230 | | [Documentation]
231 | | ... | Display result of NDR+PDR search, both quantities, both bounds,
232 | | ... | aggregate in packet per seconds
233 | | ... | and Gbps total bandwidth (for initial packet size).
234 | | ... | Througput is calculated as:
235 | | ... | Sum of measured rate over streams
236 | | ... | Bandwidth is calculated as:
237 | | ... | (Throughput * (L2 Frame Size + IPG) * 8)
238 | | ... | The given result should contain latency data as well.
239 | |
240 | | ... | *Test (or broader scope) variables read:*
241 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str
242 | | ... | *Arguments:*
243 | | ... | - result - Measured result data per stream [pps]. Type: NdrPdrResult
244 | |
245 | | ... | *Example:*
246 | |
247 | | ... | \| Display result of NDRPDR search \| \${result} \|
248 | |
249 | | [Arguments] | ${result}
250 | |
251 | | ${frame_size} = | Get Average Frame Size | ${frame_size}
252 | | Display single bound | NDR_LOWER
253 | | ... | ${result.ndr_interval.measured_low.transmit_rate} | ${frame_size}
254 | | ... | ${result.ndr_interval.measured_low.latency}
255 | | Display single bound | NDR_UPPER
256 | | ... | ${result.ndr_interval.measured_high.transmit_rate} | ${frame_size}
257 | | Display single bound | PDR_LOWER
258 | | ... | ${result.pdr_interval.measured_low.transmit_rate} | ${frame_size}
259 | | ... | ${result.pdr_interval.measured_low.latency}
260 | | Display single bound | PDR_UPPER
261 | | ... | ${result.pdr_interval.measured_high.transmit_rate} | ${frame_size}
262
263 | Display result of soak search
264 | | [Documentation]
265 | | ... | Display result of soak search, avg+-stdev, as upper/lower bounds,
266 | | ... | in aggregate packets per seconds
267 | | ... | and Gbps total bandwidth (for initial packet size).
268 | | ... | Througput is calculated as:
269 | | ... | Sum of measured rates over streams
270 | | ... | Bandwidth is calculated as:
271 | | ... | (Throughput * (L2 Frame Size + IPG) * 8)
272 | |
273 | | ... | *Test (or broader scope) variables read:*
274 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str
275 | | ... | *Arguments:*
276 | | ... | - avg - Estimated average critical load [pps]. Type: float
277 | | ... | - stdev - Standard deviation of critical load [pps]. Type: float
278 | |
279 | | ... | *Returns:*
280 | | ... | - Lower and upper bound of critical load [pps]. Type: 2-tuple of float
281 | |
282 | | ... | *Example:*
283 | |
284 | | ... | \| Display result of soak search \| \${100000} \| \${100} \|
285 | |
286 | | [Arguments] | ${avg} | ${stdev}
287 | |
288 | | ${frame_size} = | Get Average Frame Size | ${frame_size}
289 | | ${avg} = | Convert To Number | ${avg}
290 | | ${stdev} = | Convert To Number | ${stdev}
291 | | ${lower} = | Evaluate | ${avg} - ${stdev}
292 | | ${upper} = | Evaluate | ${avg} + ${stdev}
293 | | Display single bound | PLRsearch lower bound | ${lower} | ${frame_size}
294 | | Display single bound | PLRsearch upper bound | ${upper} | ${frame_size}
295 | | Return From Keyword | ${lower} | ${upper}
296
297 | Check NDRPDR interval validity
298 | | [Documentation]
299 | | ... | Extract loss ratio of lower bound of the interval.
300 | | ... | Fail if it does not reach the allowed value.
301 | |
302 | | ... | *Arguments:*
303 | | ... | - interval - Measured interval. Type: ReceiveRateInterval
304 | | ... | - packet_loss_ratio - Accepted loss (0.0 for NDR). Type: float
305 | |
306 | | ... | *Example:*
307 | |
308 | | ... | \| Check NDRPDR interval validity \| \${result.pdr_interval} \
309 | | ... | \| \${0.005} \|
310 | |
311 | | [Arguments] | ${interval} | ${packet_loss_ratio}=${0.0}
312 | |
313 | | ${lower_bound} = | Set Variable | ${interval.measured_low}
314 | | ${lower_bound_lf} = | Set Variable | ${lower_bound.loss_fraction}
315 | | Return From Keyword If | ${lower_bound_lf} <= ${packet_loss_ratio}
316 | | ${message}= | Catenate | SEPARATOR=${SPACE}
317 | | ... | Minimal rate loss fraction ${lower_bound_lf}
318 | | ... | does not reach target ${packet_loss_ratio}.
319 | | ${message_zero} = | Set Variable | Zero packets forwarded!
320 | | ${message_other} = | Set Variable | ${lower_bound.loss_count} packets lost.
321 | | ${message} = | Set Variable If | ${lower_bound_lf} >= 1.0
322 | | ... | ${message}${\n}${message_zero} | ${message}${\n}${message_other}
323 | | Fail | ${message}
324
325 | Traffic should pass with maximum rate
326 | | [Documentation]
327 | | ... | Send traffic at maximum rate.
328 | |
329 | | ... | *Test (or broader scope) variables read:*
330 | | ... | - traffic_profile - Name of module defining traffc for measurements.
331 | | ... | Type: string
332 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str
333 | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps].
334 | | ... | Type: float
335 | |
336 | | ... | *Arguments:*
337 | | ... | - subsamples - How many trials in this measurement. Type: int
338 | | ... | - trial_duration - Duration of single trial [s]. Type: float
339 | | ... | - fail_no_traffic - Whether to fail on zero receive count. Type: boolean
340 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
341 | | ... | Type: int
342 | | ... | - tx_port - TX port of TG, default 0. Type: integer
343 | | ... | - rx_port - RX port of TG, default 1. Type: integer
344 | |
345 | | ... | *Example:*
346 | |
347 | | ... | \| Traffic should pass with maximum rate \| \${1} \| \${10.0} \
348 | | ... | \| \${False} \| \${2} \| \${0} \| \${1} \|
349 | |
350 | | [Arguments] | ${trial_duration}=${PERF_TRIAL_DURATION}
351 | | ... | ${fail_no_traffic}=${True} | ${subsamples}=${PERF_TRIAL_MULTIPLICITY}
352 | | ... | ${traffic_directions}=${2} | ${tx_port}=${0} | ${rx_port}=${1}
353 | |
354 | | ${results} = | Send traffic at specified rate | ${trial_duration}
355 | | ... | ${max_rate}pps | ${frame_size} | ${traffic_profile} | ${subsamples}
356 | | ... | ${traffic_directions} | ${tx_port} | ${rx_port}
357 | | Set Test Message | ${\n}Maximum Receive Rate trial results
358 | | Set Test Message | in packets per second: ${results}
359 | | ... | append=yes
360 | | Run Keyword If | ${fail_no_traffic} | Fail if no traffic forwarded
361
362 | Send traffic at specified rate
363 | | [Documentation]
364 | | ... | Send traffic at specified rate.
365 | | ... | Return list of measured receive rates.
366 | | ... | The rate argument should be TRex friendly, so it should include "pps".
367 | |
368 | | ... | *Arguments:*
369 | | ... | - trial_duration - Duration of single trial [s]. Type: float
370 | | ... | - rate - Rate for sending packets. Type: string
371 | | ... | - frame_size - L2 Frame Size [B]. Type: integer/string
372 | | ... | - traffic_profile - Name of module defining traffc for measurements.
373 | | ... | Type: string
374 | | ... | - subsamples - How many trials in this measurement. Type: int
375 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
376 | | ... | Type: int
377 | | ... | - tx_port - TX port of TG, default 0. Type: integer
378 | | ... | - rx_port - RX port of TG, default 1. Type: integer
379 | | ... | - pkt_trace - True to enable packet trace. Type: boolean
380 | |
381 | | ... | *Example:*
382 | |
383 | | ... | \| Send traffic at specified rate \| \${1.0} \| 4.0mpps \| \${64} \
384 | | ... | \| 3-node-IPv4 \| \${10} \| \${2} \| \${0} | \${1} \| \${False}
385 | |
386 | | [Arguments] | ${trial_duration} | ${rate} | ${frame_size}
387 | | ... | ${traffic_profile} | ${subsamples}=${1} | ${traffic_directions}=${2}
388 | | ... | ${tx_port}=${0} | ${rx_port}=${1} | ${pkt_trace}=${False}
389 | |
390 | | Clear and show runtime counters with running traffic | ${trial_duration}
391 | | ... | ${rate} | ${frame_size} | ${traffic_profile}
392 | | ... | ${traffic_directions} | ${tx_port} | ${rx_port}
393 | | Run Keyword If | ${dut_stats}==${True}
394 | | ... | Clear statistics on all DUTs | ${nodes}
395 | | Run Keyword If | ${dut_stats}==${True} and ${pkt_trace}==${True}
396 | | ... | VPP Enable Traces On All DUTs | ${nodes} | fail_on_error=${False}
397 | | Run Keyword If | ${dut_stats}==${True}
398 | | ... | VPP enable elog traces on all DUTs | ${nodes}
399 | | ${results} = | Create List
400 | | FOR | ${i} | IN RANGE | ${subsamples}
401 | | | # The following line is skipping some default arguments,
402 | | | # that is why subsequent arguments have to be named.
403 | | | Send traffic on tg | ${trial_duration} | ${rate} | ${frame_size}
404 | | | ... | ${traffic_profile} | warmup_time=${0}
405 | | | ... | traffic_directions=${traffic_directions} | tx_port=${tx_port}
406 | | | ... | rx_port=${rx_port}
407 | | | ${rx} = | Get Received
408 | | | ${rr} = | Evaluate | ${rx} / ${trial_duration}
409 | | | Append To List | ${results} | ${rr}
410 | | END
411 | | Run Keyword If | ${dut_stats}==${True} | Show event logger on all DUTs
412 | | ... | ${nodes}
413 | | Run Keyword If | ${dut_stats}==${True} | Show statistics on all DUTs
414 | | ... | ${nodes}
415 | | Run Keyword If | ${dut_stats}==${True} and ${pkt_trace}==${True}
416 | | ... | Show Packet Trace On All Duts | ${nodes} | maximum=${100}
417 | | Return From Keyword | ${results}
418
419 | Clear and show runtime counters with running traffic
420 | | [Documentation]
421 | | ... | Start traffic at specified rate then clear runtime counters on all
422 | | ... | DUTs. Wait for specified amount of time and capture runtime counters
423 | | ... | on all DUTs. Finally stop traffic
424 | |
425 | | ... | *Arguments:*
426 | | ... | - duration - Duration of traffic run [s]. Type: integer
427 | | ... | - rate - Unidirectional rate for sending packets. Type: string
428 | | ... | - frame_size - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
429 | | ... | - traffic_profile - Name of module defining traffc for measurements.
430 | | ... | Type: string
431 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
432 | | ... | Type: int
433 | | ... | - tx_port - TX port of TG, default 0. Type: integer
434 | | ... | - rx_port - RX port of TG, default 1. Type: integer
435 | |
436 | | ... | *Example:*
437 | |
438 | | ... | \| Clear and show runtime counters with running traffic \| \${10} \
439 | | ... | \| 4.0mpps \| \${64} \| 3-node-IPv4 \| \${2} \| \${0} \| \${1} \|
440 | |
441 | | [Arguments] | ${duration} | ${rate} | ${frame_size} | ${traffic_profile}
442 | | ... | ${traffic_directions}=${2} | ${tx_port}=${0} | ${rx_port}=${1}
443 | |
444 | | # Duration of -1 means we will stop traffic manually.
445 | | Send traffic on tg | ${-1} | ${rate} | ${frame_size} | ${traffic_profile}
446 | | ... | warmup_time=${0} | async_call=${True} | latency=${False}
447 | | ... | traffic_directions=${traffic_directions} | tx_port=${tx_port}
448 | | ... | rx_port=${rx_port}
449 | | Run Keyword If | ${dut_stats}==${True}
450 | | ... | VPP clear runtime on all DUTs | ${nodes}
451 | | Sleep | ${duration}
452 | | Run Keyword If | ${dut_stats}==${True}
453 | | ... | VPP show runtime on all DUTs | ${nodes}
454 | | Stop traffic on tg
455
456 | Start Traffic on Background
457 | | [Documentation]
458 | | ... | Start traffic at specified rate then return control to Robot.
459 | | ... | This keyword is useful if the test needs to do something
460 | | ... | while traffic is running.
461 | |
462 | | ... | *Test (or broader scope) variables read:*
463 | | ... | - traffic_profile - Name of module defining traffc for measurements.
464 | | ... | Type: string
465 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str
466 | | ... | *Arguments:*
467 | | ... | - rate - Unidirectional rate for sending packets. Type: string
468 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
469 | | ... | Type: int
470 | | ... | - tx_port - TX port of TG, default 0. Type: integer
471 | | ... | - rx_port - RX port of TG, default 1. Type: integer
472 | |
473 | | ... | *Example:*
474 | |
475 | | ... | \| Start Traffic on Background \| 4.0mpps \| \${2} \| \${0} \
476 | | ... | \| \${1} \|
477 | |
478 | | [Arguments] | ${rate} | ${traffic_directions}=${2} | ${tx_port}=${0}
479 | | ... | ${rx_port}=${1}
480 | |
481 | | # Duration of -1 means we will stop traffic manually.
482 | | Send traffic on tg | ${-1} | ${rate} | ${frame_size} | ${traffic_profile}
483 | | ... | warmup_time=${0} | async_call=${True} | latency=${False}
484 | | ... | traffic_directions=${traffic_directions} | tx_port=${tx_port}
485 | | ... | rx_port=${rx_port}
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}