Framework: main heap size value multiplication
[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 |
26 | Documentation
27 | ... | Performance suite keywords - utilities to find and verify NDR and PDR.
28
29 *** Variables ***
30 | ${trial_duration}= | ${PERF_TRIAL_DURATION}
31 | ${trial_multiplicity}= | ${PERF_TRIAL_MULTIPLICITY}
32 | ${extended_debug}= | ${EXTENDED_DEBUG}
33 | # Variable holding multiplicator of main heap size. By default it is set to 1
34 | # that means the main heap size will be set to 2G. Some tests may require more
35 | # memory for IP FIB (e.g. nat44det tests with 4M or 16M sessions).
36 | ${heap_size_mult}= | ${1}
37 | # Variable holding trial duration extension [s] used in pre_stats action
38 | # clear-show-runtime-with-traffic. By default it is set to 0 but some
39 | # tests (e.g. NAT) needs this duration extension in ramp up phase (e.g. to
40 | # create all required nat sessions).
41 | ${pre_stats_duration_ext}= | ${0}
42
43 *** Keywords ***
44 | Find NDR and PDR intervals using optimized search
45 | | [Documentation]
46 | | ... | Find boundaries for RFC2544 compatible NDR and PDR values
47 | | ... | using an optimized search algorithm.
48 | | ... | Display findings as a formatted test message.
49 | | ... | Fail if a resulting lower bound has too high loss fraction.
50 | | ... | Input rates are understood as uni-directional,
51 | | ... | reported result contains aggregate rates.
52 | | ... | Additional latency measurements are performed for smaller loads,
53 | | ... | their results are also displayed.
54 | | ... | Finally, two measurements for runtime stats are done (not displayed).
55 | | ... | Currently, the min_rate value is hardcoded to 90kpps,
56 | | ... | allowing measurement at 10% of the discovered rate
57 | | ... | without breaking latency streams.
58 | |
59 | | ... | *Test (or broader scope) variables read:*
60 | | ... | - traffic_profile - Name of module defining traffc for measurements.
61 | | ... | Type: string
62 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
63 | | ... | string
64 | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps].
65 | | ... | Type: float
66 | |
67 | | ... | *Arguments:*
68 | | ... | - packet_loss_ratio - Accepted loss during search. Type: float
69 | | ... | - final_relative_width - Maximal width multiple of upper. Type: float
70 | | ... | - final_trial_duration - Duration of final trials [s]. Type: float
71 | | ... | - initial_trial_duration - Duration of initial trials [s]. Type: float
72 | | ... | - intermediate phases - Number of intermediate phases [1].
73 | | ... | Type: integer
74 | | ... | - timeout - Fail if search duration is longer [s]. Type: float
75 | | ... | - doublings - How many doublings to do when expanding [1].
76 | | ... | Type: integer
77 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
78 | | ... | Type: integer
79 | | ... | - latency_duration - Duration for latency-specific trials. Type: float
80 | | ... | - latency - False to disable latency measurement; default value: True.
81 | | ... | Type: boolean
82 | |
83 | | ... | *Example:*
84 | |
85 | | ... | \| Find NDR and PDR intervals using optimized search \| \${0.005} \
86 | | ... | \| \${0.005} \| \${30.0} \| \${1.0} \| \${2} \| \${600.0} \| \${2} \
87 | | ... | \| \${2} \| ${5.0} \|
88 | |
89 | | [Arguments] | ${packet_loss_ratio}=${0.005}
90 | | ... | ${final_relative_width}=${0.005} | ${final_trial_duration}=${30.0}
91 | | ... | ${initial_trial_duration}=${1.0}
92 | | ... | ${number_of_intermediate_phases}=${2} | ${timeout}=${720.0}
93 | | ... | ${doublings}=${2} | ${traffic_directions}=${2}
94 | | ... | ${latency_duration}=${PERF_TRIAL_LATENCY_DURATION}
95 | | ... | ${latency}=${True}
96 | |
97 | | # Latency measurements will need more than 9000 pps.
98 | | ${result} = | Perform optimized ndrpdr search | ${frame_size}
99 | | ... | ${traffic_profile} | ${9001} | ${max_rate}
100 | | ... | ${packet_loss_ratio} | ${final_relative_width}
101 | | ... | ${final_trial_duration} | ${initial_trial_duration}
102 | | ... | ${number_of_intermediate_phases} | timeout=${timeout}
103 | | ... | doublings=${doublings} | traffic_directions=${traffic_directions}
104 | | ... | latency=${latency}
105 | | Display result of NDRPDR search | ${result}
106 | | Check NDRPDR interval validity | ${result.pdr_interval}
107 | | ... | ${packet_loss_ratio}
108 | | Check NDRPDR interval validity | ${result.ndr_interval}
109 | | ${pdr_sum}= | Set Variable | ${result.pdr_interval.measured_low.target_tr}
110 | | ${pdr_per_stream}= | Evaluate | ${pdr_sum} / float(${traffic_directions})
111 | | ${ndr_sum}= | Set Variable | ${result.ndr_interval.measured_low.target_tr}
112 | | ${ndr_per_stream}= | Evaluate | ${ndr_sum} / float(${traffic_directions})
113 | | ${rate}= | Evaluate | 0.9 * ${pdr_per_stream}
114 | | Run Keyword If | ${latency}
115 | | ... | Measure and show latency at specified rate | Latency at 90% PDR:
116 | | ... | ${latency_duration} | ${rate} | ${framesize}
117 | | ... | ${traffic_profile} | ${traffic_directions}
118 | | ${rate}= | Evaluate | 0.5 * ${pdr_per_stream}
119 | | Run Keyword If | ${latency}
120 | | ... | Measure and show latency at specified rate | Latency at 50% PDR:
121 | | ... | ${latency_duration} | ${rate} | ${framesize}
122 | | ... | ${traffic_profile} | ${traffic_directions}
123 | | ${rate}= | Evaluate | 0.1 * ${pdr_per_stream}
124 | | Run Keyword If | ${latency}
125 | | ... | Measure and show latency at specified rate | Latency at 10% PDR:
126 | | ... | ${latency_duration} | ${rate} | ${framesize}
127 | | ... | ${traffic_profile} | ${traffic_directions}
128 | | Run Keyword If | ${latency}
129 | | ... | Measure and show latency at specified rate | Latency at 0% PDR:
130 | | ... | ${latency_duration} | ${0} | ${framesize}
131 | | ... | ${traffic_profile} | ${traffic_directions}
132 | | # Finally, trials with runtime and other stats.
133 | | # We expect NDR and PDR to have different-looking stats.
134 | | Send traffic at specified rate
135 | | ... | ${1.0} | ${pdr_per_stream} | ${framesize} | ${traffic_profile}
136 | | ... | traffic_directions=${traffic_directions}
137 | | Send traffic at specified rate
138 | | ... | ${1.0} | ${ndr_per_stream} | ${framesize} | ${traffic_profile}
139 | | ... | traffic_directions=${traffic_directions}
140
141 | Find Throughput Using MLRsearch
142 | | [Documentation]
143 | | ... | Find and return lower bound PDR (zero PLR by default)
144 | | ... | aggregate throughput using MLRsearch algorithm.
145 | | ... | Input rates are understood as uni-directional.
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: integer or
152 | | ... | string
153 | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps].
154 | | ... | Type: float
155 | |
156 | | ... | *Arguments:*
157 | | ... | - packet_loss_ratio - Accepted loss during search. Type: float
158 | | ... | - final_relative_width - Maximal width multiple of upper. Type: float
159 | | ... | - final_trial_duration - Duration of final trials [s]. Type: float
160 | | ... | - initial_trial_duration - Duration of initial trials [s]. Type: float
161 | | ... | - intermediate phases - Number of intermediate phases [1].
162 | | ... | Type: integer
163 | | ... | - timeout - Fail if search duration is longer [s]. Type: float
164 | | ... | - doublings - How many doublings to do when expanding [1].
165 | | ... | Type: integer
166 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
167 | | ... | Type: integer
168 | | ... | - latency - True to enable latency measurement; default value: False.
169 | | ... | Type: boolean
170 | |
171 | | ... | *Returns:*
172 | | ... | - Lower bound for bi-directional throughput at given PLR. Type: float
173 | |
174 | | ... | *Example:*
175 | |
176 | | ... | \| \${throughpt}= \| Find Throughput Using MLRsearch \| \${0} \
177 | | ... | \| \${0.001} \| \${10.0}\| \${1.0} \| \${1} \| \${720.0} \| \${2} \
178 | | ... | \| \${2} \|
179 | |
180 | | [Arguments] | ${packet_loss_ratio}=${0.0}
181 | | ... | ${final_relative_width}=${0.001} | ${final_trial_duration}=${10.0}
182 | | ... | ${initial_trial_duration}=${1.0}
183 | | ... | ${number_of_intermediate_phases}=${1} | ${timeout}=${720.0}
184 | | ... | ${doublings}=${2} | ${traffic_directions}=${2} | ${latency}=${False}
185 | |
186 | | ${result} = | Perform optimized ndrpdr search | ${frame_size}
187 | | ... | ${traffic_profile} | ${10000} | ${max_rate}
188 | | ... | ${packet_loss_ratio} | ${final_relative_width}
189 | | ... | ${final_trial_duration} | ${initial_trial_duration}
190 | | ... | ${number_of_intermediate_phases} | timeout=${timeout}
191 | | ... | doublings=${doublings} | traffic_directions=${traffic_directions}
192 | | ... | latency=${latency}
193 | | Check NDRPDR interval validity | ${result.pdr_interval}
194 | | ... | ${packet_loss_ratio}
195 | | Return From Keyword | ${result.pdr_interval.measured_low.target_tr}
196
197 | Find critical load using PLRsearch
198 | | [Documentation]
199 | | ... | Find boundaries for troughput (of given target loss ratio)
200 | | ... | using PLRsearch algorithm.
201 | | ... | Display results as formatted test message.
202 | | ... | Fail if computed lower bound 110% of the minimal rate or less.
203 | | ... | Input rates are understood as uni-directional,
204 | | ... | reported result contains aggregate rates.
205 | | ... | Currently, the min_rate value is hardcoded to match test teardowns.
206 | |
207 | | ... | *Test (or broader scope) variables read:*
208 | | ... | - traffic_profile - Name of module defining traffc for measurements.
209 | | ... | Type: string
210 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
211 | | ... | string
212 | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps].
213 | | ... | Type: float
214 | |
215 | | ... | *Arguments:*
216 | | ... | - packet_loss_ratio - Accepted loss during search. Type: float
217 | | ... | - timeout - Stop when search duration is longer [s]. Type: float
218 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
219 | | ... | Type: integer
220 | | ... | - latency - True to enable latency measurement; default value: False.
221 | | ... | Type: boolean
222 | |
223 | | ... | *Example:*
224 | |
225 | | ... | \| Find critical load using PLR search \| \${1e-7} \| \${120} \
226 | | ... | \| \${2} \|
227 | |
228 | | [Arguments] | ${packet_loss_ratio}=${1e-7} | ${timeout}=${1800.0}
229 | | ... | ${traffic_directions}=${2} | ${latency}=${False}
230 | |
231 | | ${min_rate} = | Set Variable | ${10000}
232 | | ${average} | ${stdev} = | Perform soak search | ${frame_size}
233 | | ... | ${traffic_profile} | ${min_rate} | ${max_rate}
234 | | ... | ${packet_loss_ratio} | timeout=${timeout}
235 | | ... | traffic_directions=${traffic_directions} | latency=${latency}
236 | | ${lower} | ${upper} = | Display result of soak search
237 | | ... | ${average} | ${stdev}
238 | | Should Not Be True | 1.1 * ${traffic_directions} * ${min_rate} > ${lower}
239 | | ... | Lower bound ${lower} too small for unidirectional minimum ${min_rate}.
240
241 | Display single bound
242 | | [Documentation]
243 | | ... | Display one bound of NDR+PDR search,
244 | | ... | in packet per seconds (total and per stream)
245 | | ... | and Gbps total bandwidth (for initial packet size).
246 | | ... | Througput is calculated as:
247 | | ... | Sum of measured rates over streams
248 | | ... | Bandwidth is calculated as:
249 | | ... | (Throughput * (L2 Frame Size + IPG) * 8)
250 | | ... | The given result should contain latency data as well.
251 | |
252 | | ... | *Arguments:*
253 | | ... | - text - Flavor text describing which bound is this. Type: string
254 | | ... | - rate_total - Total (not per stream) measured Tr [pps]. Type: float
255 | | ... | - frame_size - L2 Frame Size [B]. Type: integer
256 | | ... | - latency - Latency data to display if non-empty. Type: string
257 | |
258 | | ... | *Example:*
259 | |
260 | | ... | \| Display single bound \| NDR lower bound \| \${12345.67} \
261 | | ... | \| \${64} \| latency=\${EMPTY} \|
262 | |
263 | | [Arguments] | ${text} | ${rate_total} | ${frame_size} | ${latency}=${EMPTY}
264 | |
265 | | ${bandwidth_total} = | Evaluate | ${rate_total} * (${frame_size}+20)*8 / 1e9
266 | | Set Test Message | ${\n}${text}: ${rate_total} pps, | append=yes
267 | | Set Test Message | ${bandwidth_total} Gbps (initial) | append=yes
268 | | Return From Keyword If | not """${latency}"""
269 | | Set Test Message | ${\n}LATENCY [min/avg/max/hdrh] per stream: ${latency}
270 | | ... | append=yes
271
272 | Display Reconfig Test Message
273 | | [Documentation]
274 | | ... | Display the number of packets lost (bidirectionally)
275 | | ... | due to reconfiguration under traffic.
276 | |
277 | | ... | *Arguments:*
278 | | ... | - result - Result of bidirectional measurtement.
279 | | ... | Type: ReceiveRateMeasurement
280 | |
281 | | ... | *Example:*
282 | |
283 | | ... | \| Display Reconfig Test Message \| \${result} \|
284 | |
285 | | [Arguments] | ${result}
286 | |
287 | | Set Test Message | Packets lost due to reconfig: ${result.loss_count}
288 | | ${time_lost} = | Evaluate | ${result.loss_count} / ${result.target_tr}
289 | | Set Test Message | ${\n}Implied time lost: ${time_lost} | append=yes
290
291 | Display result of NDRPDR search
292 | | [Documentation]
293 | | ... | Display result of NDR+PDR search, both quantities, both bounds,
294 | | ... | aggregate in packet per seconds
295 | | ... | and Gbps total bandwidth (for initial packet size).
296 | | ... | Througput is calculated as:
297 | | ... | Sum of measured rate over streams
298 | | ... | Bandwidth is calculated as:
299 | | ... | (Throughput * (L2 Frame Size + IPG) * 8)
300 | | ... | The given result should contain latency data as well.
301 | |
302 | | ... | *Test (or broader scope) variables read:*
303 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
304 | | ... | string
305 | | ... | *Arguments:*
306 | | ... | - result - Measured result data per stream [pps]. Type: NdrPdrResult
307 | |
308 | | ... | *Example:*
309 | |
310 | | ... | \| Display result of NDRPDR search \| \${result} \|
311 | |
312 | | [Arguments] | ${result}
313 | |
314 | | ${frame_size} = | Get Average Frame Size | ${frame_size}
315 | | Display single bound | NDR_LOWER
316 | | ... | ${result.ndr_interval.measured_low.target_tr} | ${frame_size}
317 | | ... | ${result.ndr_interval.measured_low.latency}
318 | | Display single bound | NDR_UPPER
319 | | ... | ${result.ndr_interval.measured_high.target_tr} | ${frame_size}
320 | | Display single bound | PDR_LOWER
321 | | ... | ${result.pdr_interval.measured_low.target_tr} | ${frame_size}
322 | | ... | ${result.pdr_interval.measured_low.latency}
323 | | Display single bound | PDR_UPPER
324 | | ... | ${result.pdr_interval.measured_high.target_tr} | ${frame_size}
325
326 | Display result of soak search
327 | | [Documentation]
328 | | ... | Display result of soak search, avg+-stdev, as upper/lower bounds,
329 | | ... | in aggregate packets per seconds
330 | | ... | and Gbps total bandwidth (for initial packet size).
331 | | ... | Througput is calculated as:
332 | | ... | Sum of measured rates over streams
333 | | ... | Bandwidth is calculated as:
334 | | ... | (Throughput * (L2 Frame Size + IPG) * 8)
335 | |
336 | | ... | *Test (or broader scope) variables read:*
337 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
338 | | ... | string
339 | | ... | *Arguments:*
340 | | ... | - avg - Estimated average critical load [pps]. Type: float
341 | | ... | - stdev - Standard deviation of critical load [pps]. Type: float
342 | |
343 | | ... | *Returns:*
344 | | ... | - Lower and upper bound of critical load [pps]. Type: 2-tuple of float
345 | |
346 | | ... | *Example:*
347 | |
348 | | ... | \| Display result of soak search \| \${100000} \| \${100} \|
349 | |
350 | | [Arguments] | ${avg} | ${stdev}
351 | |
352 | | ${frame_size} = | Get Average Frame Size | ${frame_size}
353 | | ${avg} = | Convert To Number | ${avg}
354 | | ${stdev} = | Convert To Number | ${stdev}
355 | | ${lower} = | Evaluate | ${avg} - ${stdev}
356 | | ${upper} = | Evaluate | ${avg} + ${stdev}
357 | | Display single bound | PLRsearch lower bound | ${lower} | ${frame_size}
358 | | Display single bound | PLRsearch upper bound | ${upper} | ${frame_size}
359 | | Return From Keyword | ${lower} | ${upper}
360
361 | Check NDRPDR interval validity
362 | | [Documentation]
363 | | ... | Extract loss ratio of lower bound of the interval.
364 | | ... | Fail if it does not reach the allowed value.
365 | |
366 | | ... | *Arguments:*
367 | | ... | - interval - Measured interval. Type: ReceiveRateInterval
368 | | ... | - packet_loss_ratio - Accepted loss (0.0 for NDR). Type: float
369 | |
370 | | ... | *Example:*
371 | |
372 | | ... | \| Check NDRPDR interval validity \| \${result.pdr_interval} \
373 | | ... | \| \${0.005} \|
374 | |
375 | | [Arguments] | ${interval} | ${packet_loss_ratio}=${0.0}
376 | |
377 | | ${lower_bound} = | Set Variable | ${interval.measured_low}
378 | | ${lower_bound_lf} = | Set Variable | ${lower_bound.loss_fraction}
379 | | Return From Keyword If | ${lower_bound_lf} <= ${packet_loss_ratio}
380 | | ${message}= | Catenate | SEPARATOR=${SPACE}
381 | | ... | Minimal rate loss fraction ${lower_bound_lf}
382 | | ... | does not reach target ${packet_loss_ratio}.
383 | | ${message_zero} = | Set Variable | Zero packets forwarded!
384 | | ${message_other} = | Set Variable | ${lower_bound.loss_count} packets lost.
385 | | ${message} = | Set Variable If | ${lower_bound_lf} >= 1.0
386 | | ... | ${message}${\n}${message_zero} | ${message}${\n}${message_other}
387 | | Fail | ${message}
388
389 | Traffic should pass with maximum rate
390 | | [Documentation]
391 | | ... | Send traffic at maximum rate.
392 | |
393 | | ... | *Test (or broader scope) variables read:*
394 | | ... | - traffic_profile - Name of module defining traffic for measurements.
395 | | ... | Type: string
396 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
397 | | ... | string
398 | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps].
399 | | ... | Type: float
400 | |
401 | | ... | *Arguments:*
402 | | ... | - trial_duration - Duration of single trial [s]. Type: float
403 | | ... | - fail_no_traffic - Whether to fail on zero receive count;
404 | | ... | default value: True. Type: boolean
405 | | ... | - trial_multiplicity - How many trials in this measurement.
406 | | ... | Type: integer
407 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic;
408 | | ... | default value: 2. Type: integer
409 | | ... | - tx_port - TX port of TG; default value: 0. Type: integer
410 | | ... | - rx_port - RX port of TG; default value: 1. Type: integer
411 | | ... | - latency - True to enable latency measurement; default value: False.
412 | | ... | Type: boolean
413 | |
414 | | ... | *Example:*
415 | |
416 | | ... | \| Traffic should pass with maximum rate \| \${1} \| \${False} \
417 | | ... | \| \${10.0} \| \${2} \| \${0} \| \${1} \| \${True} \|
418 | |
419 | | [Arguments] | ${trial_duration}=${trial_duration}
420 | | ... | ${fail_no_traffic}=${True}
421 | | ... | ${trial_multiplicity}=${trial_multiplicity}
422 | | ... | ${traffic_directions}=${2} | ${tx_port}=${0} | ${rx_port}=${1}
423 | | ... | ${latency}=${False}
424 | |
425 | | ${results}= | Send traffic at specified rate
426 | | ... | ${trial_duration} | ${max_rate} | ${frame_size}
427 | | ... | ${traffic_profile} | ${trial_multiplicity}
428 | | ... | ${traffic_directions} | ${tx_port} | ${rx_port} | latency=${latency}
429 | | Set Test Message | ${\n}Maximum Receive Rate trial results
430 | | Set Test Message | in packets per second: ${results}
431 | | ... | append=yes
432 | | Run Keyword If | ${fail_no_traffic} | Fail if no traffic forwarded
433
434 | Send traffic at specified rate
435 | | [Documentation]
436 | | ... | Perform a warmup, show runtime counters during it.
437 | | ... | Then send traffic at specified rate, possibly multiple trials.
438 | | ... | Show various DUT stats, optionally also packet trace.
439 | | ... | Return list of measured receive rates.
440 | |
441 | | ... | *Arguments:*
442 | | ... | - trial_duration - Duration of single trial [s]. Type: float
443 | | ... | - rate - Target aggregate transmit rate [pps] / Connections per second
444 | | ... | (CPS) for UDP/TCP flows. Type: float
445 | | ... | - frame_size - L2 Frame Size [B]. Type: integer or string
446 | | ... | - traffic_profile - Name of module defining traffc for measurements.
447 | | ... | Type: string
448 | | ... | - trial_multiplicity - How many trials in this measurement.
449 | | ... | Type: integer
450 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
451 | | ... | Type: integer
452 | | ... | - tx_port - TX port of TG; default value: 0. Type: integer
453 | | ... | - rx_port - RX port of TG; default value: 1. Type: integer
454 | | ... | - extended_debug - True to enable extended debug.
455 | | ... | Type: boolean
456 | | ... | - latency - True to enable latency measurement; default value: False.
457 | | ... | Type: boolean
458 | |
459 | | ... | *Example:*
460 | |
461 | | ... | \| Send traffic at specified rate \| \${1.0} \| ${4000000.0} \
462 | | ... | \| \${64} \| 3-node-IPv4 \| \${10} \| \${2} \| \${0} \| \${1} \
463 | | ... | \| ${False} \| ${True} \|
464 | |
465 | | [Arguments] | ${trial_duration} | ${rate} | ${frame_size}
466 | | ... | ${traffic_profile} | ${trial_multiplicity}=${trial_multiplicity}
467 | | ... | ${traffic_directions}=${2} | ${tx_port}=${0} | ${rx_port}=${1}
468 | | ... | ${extended_debug}=${extended_debug} | ${latency}=${False}
469 | |
470 | | Set Test Variable | ${extended_debug}
471 | | # Following setting of test variables is needed as
472 | | # "Clear and show runtime counters with running traffic" has been moved to
473 | | # pre_stats actions.
474 | | Set Test Variable | ${rate}
475 | | Set Test Variable | ${traffic_directions}
476 | | Set Test Variable | ${tx_port}
477 | | Set Test Variable | ${rx_port}
478 | | FOR | ${action} | IN | @{pre_stats}
479 | | | Run Keyword | Additional Statistics Action For ${action}
480 | | END
481 | | ${results} = | Create List
482 | | FOR | ${i} | IN RANGE | ${trial_multiplicity}
483 | | | # The following line is skipping some default arguments,
484 | | | # that is why subsequent arguments have to be named.
485 | | | Send traffic on tg | ${trial_duration} | ${rate} | ${frame_size}
486 | | | ... | ${traffic_profile} | warmup_time=${0}
487 | | | ... | traffic_directions=${traffic_directions} | tx_port=${tx_port}
488 | | | ... | rx_port=${rx_port} | latency=${latency}
489 | | | ${rx} = | Get Received
490 | | | ${rr} = | Evaluate | ${rx} / ${trial_duration}
491 | | | Append To List | ${results} | ${rr}
492 | | END
493 | | FOR | ${action} | IN | @{post_stats}
494 | | | Run Keyword | Additional Statistics Action For ${action}
495 | | END
496 | | Return From Keyword | ${results}
497
498 | Measure and show latency at specified rate
499 | | [Documentation]
500 | | ... | Send traffic at specified rate, single trial.
501 | | ... | Extract latency information and append it to text message.
502 | | ... | The rate argument is int, so should not include "pps".
503 | | ... | If the given rate is too low, a safe value is used instead.
504 | |
505 | | ... | *Arguments:*
506 | | ... | - message_prefix - Preface to test message addition. Type: string
507 | | ... | - trial_duration - Duration of single trial [s]. Type: float
508 | | ... | - rate - Rate [pps] for sending packets in case of T-Rex stateless
509 | | ... | mode or multiplier of profile CPS in case of T-Rex astf mode.
510 | | ... | Type: float
511 | | ... | - frame_size - L2 Frame Size [B]. Type: integer or string
512 | | ... | - traffic_profile - Name of module defining traffic for measurements.
513 | | ... | Type: string
514 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
515 | | ... | Type: integer
516 | | ... | - tx_port - TX port of TG; default value: 0. Type: integer
517 | | ... | - rx_port - RX port of TG; default value: 1. Type: integer
518 | | ... | - safe_rate - To apply if rate is below this, as latency pps is fixed.
519 | | ... | In pps. Type: integer.
520 | |
521 | | ... | *Example:*
522 | |
523 | | ... | \| Measure and show latency at specified rate \| Latency at 90% NDR \
524 | | ... | \| \${1.0} \| ${10000000} \| \${64} \| 3-node-IPv4 \| \${2} \
525 | | ... | \| \${0} \| \${1} \| ${9500} \|
526 | |
527 | | [Arguments] | ${message_prefix} | ${trial_duration} | ${rate}
528 | | ... | ${frame_size} | ${traffic_profile} | ${traffic_directions}=${2}
529 | | ... | ${tx_port}=${0} | ${rx_port}=${1} | ${safe_rate}=${9001}
530 | |
531 | | ${real_rate} = | Evaluate | max(${rate}, ${safe_rate})
532 | | # The following line is skipping some default arguments,
533 | | # that is why subsequent arguments have to be named.
534 | | Send traffic on tg | ${trial_duration} | ${real_rate} | ${frame_size}
535 | | ... | ${traffic_profile} | warmup_time=${0}
536 | | ... | traffic_directions=${traffic_directions} | tx_port=${tx_port}
537 | | ... | rx_port=${rx_port} | latency=${True}
538 | | ${latency} = | Get Latency Int
539 | | Set Test Message | ${\n}${message_prefix} ${latency} | append=${True}
540
541 | Clear and show runtime counters with running traffic
542 | | [Documentation]
543 | | ... | Start traffic at specified rate then clear runtime counters on all
544 | | ... | DUTs. Wait for specified amount of time and capture runtime counters
545 | | ... | on all DUTs. Finally stop traffic
546 | |
547 | | ... | *Arguments:*
548 | | ... | - duration - Duration of traffic run [s]. Type: integer
549 | | ... | - rate - Rate [pps] for sending packets in case of T-Rex stateless
550 | | ... | mode or multiplier of profile CPS in case of T-Rex astf mode.
551 | | ... | Type: float
552 | | ... | - frame_size - L2 Frame Size [B] or IMIX_v4_1. Type: integer or string
553 | | ... | - traffic_profile - Name of module defining traffc for measurements.
554 | | ... | Type: string
555 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
556 | | ... | Type: integer
557 | | ... | - tx_port - TX port of TG; default value: 0. Type: integer
558 | | ... | - rx_port - RX port of TG, default value: 1. Type: integer
559 | |
560 | | ... | *Example:*
561 | |
562 | | ... | \| Clear and show runtime counters with running traffic \| \${10} \
563 | | ... | \| ${4000000.0} \| \${64} \| 3-node-IPv4 \| \${2} \| \${0} \| \${1} \|
564 | |
565 | | [Arguments] | ${duration} | ${rate} | ${frame_size} | ${traffic_profile}
566 | | ... | ${traffic_directions}=${2} | ${tx_port}=${0} | ${rx_port}=${1}
567 | |
568 | | # Duration of -1 means we will stop traffic manually.
569 | | Send traffic on tg | ${-1} | ${rate} | ${frame_size} | ${traffic_profile}
570 | | ... | warmup_time=${0} | async_call=${True} | latency=${False}
571 | | ... | traffic_directions=${traffic_directions} | tx_port=${tx_port}
572 | | ... | rx_port=${rx_port}
573 | | FOR | ${action} | IN | @{pre_run_stats}
574 | | | Run Keyword | Additional Statistics Action For ${action}
575 | | END
576 | | Sleep | ${duration}
577 | | FOR | ${action} | IN | @{post_run_stats}
578 | | | Run Keyword | Additional Statistics Action For ${action}
579 | | END
580 | | Stop traffic on tg
581
582 | Start Traffic on Background
583 | | [Documentation]
584 | | ... | Start traffic at specified rate then return control to Robot.
585 | | ... | This keyword is useful if the test needs to do something
586 | | ... | while traffic is running.
587 | |
588 | | ... | *Test (or broader scope) variables read:*
589 | | ... | - traffic_profile - Name of module defining traffc for measurements.
590 | | ... | Type: string
591 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
592 | | ... | string
593 | | ... | *Arguments:*
594 | | ... | - rate - Rate [pps] for sending packets in case of T-Rex stateless
595 | | ... | mode or multiplier of profile CPS in case of T-Rex astf mode.
596 | | ... | Type: float
597 | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic.
598 | | ... | Type: integer
599 | | ... | - tx_port - TX port of TG; default value: 0. Type: integer
600 | | ... | - rx_port - RX port of TG; default value: 1. Type: integer
601 | |
602 | | ... | *Example:*
603 | |
604 | | ... | \| Start Traffic on Background \| ${4000000.0} \| \${2} \| \${0} \
605 | | ... | \| \${1} \|
606 | |
607 | | [Arguments] | ${rate} | ${traffic_directions}=${2} | ${tx_port}=${0}
608 | | ... | ${rx_port}=${1}
609 | |
610 | | # Duration of -1 means we will stop traffic manually.
611 | | Send traffic on tg | ${-1} | ${rate} | ${frame_size} | ${traffic_profile}
612 | | ... | warmup_time=${0} | async_call=${True} | latency=${False}
613 | | ... | traffic_directions=${traffic_directions} | tx_port=${tx_port}
614 | | ... | rx_port=${rx_port}
615
616 | Stop Running Traffic
617 | | [Documentation]
618 | | ... | Stop the running traffic, return measurement result.
619 | | ... | For bidirectional traffic, the reported values are bi-directional.
620 | |
621 | | ... | *Returns:*
622 | | ... | - Measurement result. Type: ReceiveRateMeasurement
623 | |
624 | | ... | *Example:*
625 | |
626 | | ... | \${result}= \| Stop Running Traffic \|
627 | |
628 | | ${result}= | Stop traffic on tg
629 | | Return From Keyword | ${result}
630
631 | Additional Statistics Action For vpp-clear-stats
632 | | [Documentation]
633 | | ... | Additional Statistics Action for clear VPP statistics.
634 | |
635 | | Clear Statistics On All DUTs | ${nodes}
636
637 | Additional Statistics Action For vpp-show-stats
638 | | [Documentation]
639 | | ... | Additional Statistics Action for show VPP statistics.
640 | |
641 | | Show Statistics On All DUTs | ${nodes}
642
643 | Additional Statistics Action For vpp-clear-runtime
644 | | [Documentation]
645 | | ... | Additional Statistics Action for clear VPP runtime.
646 | |
647 | | VPP Clear Runtime On All DUTs | ${nodes}
648
649 | Additional Statistics Action For vpp-show-runtime
650 | | [Documentation]
651 | | ... | Additional Statistics Action for show VPP runtime.
652 | |
653 | | VPP Show Runtime On All DUTs | ${nodes}
654
655 | Additional Statistics Action For vpp-enable-packettrace
656 | | [Documentation]
657 | | ... | Additional Statistics Action for enable VPP packet trace.
658 | |
659 | | Run Keyword If | ${extended_debug}==${True}
660 | | ... | VPP Enable Traces On All DUTs | ${nodes} | fail_on_error=${False}
661
662 | Additional Statistics Action For vpp-show-packettrace
663 | | [Documentation]
664 | | ... | Additional Statistics Action for show VPP packet trace.
665 | |
666 | | Run Keyword If | ${extended_debug}==${True}
667 | | ... | Show Packet Trace On All Duts | ${nodes} | maximum=${100}
668
669 | Additional Statistics Action For vpp-enable-elog
670 | | [Documentation]
671 | | ... | Additional Statistics Action for enable VPP elog trace.
672 | |
673 | | VPP Enable Elog Traces On All DUTs | ${nodes}
674
675 | Additional Statistics Action For vpp-show-elog
676 | | [Documentation]
677 | | ... | Additional Statistics Action for show VPP elog trace.
678 | |
679 | | Show Event Logger On All DUTs | ${nodes}
680
681 | Additional Statistics Action For bash-perf-stat
682 | | [Documentation]
683 | | ... | Additional Statistics Action for bash command "perf stat".
684 | |
685 | | Run Keyword If | ${extended_debug}==${True}
686 | | ... | Perf Stat On All DUTs | ${nodes} | cpu_list=${cpu_alloc_str}
687
688 | Additional Statistics Action For clear-show-runtime-with-traffic
689 | | [Documentation]
690 | | ... | Additional Statistics Action for clear and show runtime counters with
691 | | ... | running traffic.
692 | |
693 | | ${trial_duration}= | Evaluate
694 | | ... | ${trial_duration} + ${pre_stats_duration_ext}
695 | | ${rate}= | Get Variable Value | ${pre_stats_rate} | ${rate}
696 | | Clear and show runtime counters with running traffic
697 | | ... | ${trial_duration} | ${rate}
698 | | ... | ${frame_size} | ${traffic_profile} | ${traffic_directions}
699 | | ... | ${tx_port} | ${rx_port}
700
701 | Additional Statistics Action For vpp-det44-verify-sessions
702 | | [Documentation]
703 | | ... | Additional Statistics Action to verify that all required DET44
704 | | ... | sessions are established.
705 | |
706 | | Verify DET44 sessions number | ${nodes['DUT1']} | ${n_sessions}
707
708 | Additional Statistics Action For noop
709 | | [Documentation]
710 | | ... | Additional Statistics Action for no operation.
711 | |
712 | | No operation