CSIT-1071 Add traffic evaluation criteria to MRR
[csit.git] / resources / libraries / robot / performance / performance_utils.robot
1 # Copyright (c) 2018 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.DpdkUtil
19 | Library | resources.libraries.python.InterfaceUtil
20 | Library | resources.libraries.python.KubernetesUtils
21 | Library | resources.libraries.python.VhostUser
22 | Library | resources.libraries.python.TrafficGenerator
23 | Library | resources.libraries.python.TrafficGenerator.OptimizedSearch
24 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
25 | Library | resources.libraries.python.Trace
26 | Resource | resources/libraries/robot/shared/default.robot
27 | Resource | resources/libraries/robot/shared/interfaces.robot
28 | Resource | resources/libraries/robot/shared/counters.robot
29 | Resource | resources/libraries/robot/shared/container.robot
30 | Resource | resources/libraries/robot/shared/memif.robot
31 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
32 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
33 | Resource | resources/libraries/robot/ip/ip4.robot
34 | Resource | resources/libraries/robot/ip/ip6.robot
35 | Resource | resources/libraries/robot/vm/qemu.robot
36 | Resource | resources/libraries/robot/l2/tagging.robot
37 | Documentation | Performance suite keywords - utilities to find and verify NDR
38 | ... | and PDR.
39
40 *** Keywords ***
41 | Calculate pps
42 | | [Documentation]
43 | | ... | Calculate pps for given rate and L2 frame size,
44 | | ... | additional 20B are added to L2 frame size as padding.
45 | | ...
46 | | ... | *Arguments*
47 | | ... | - bps - Rate in bps. Type: integer
48 | | ... | - framesize - L2 frame size in Bytes. Type: integer
49 | | ...
50 | | ... | *Return*
51 | | ... | - Calculated pps. Type: integer
52 | | ...
53 | | ... | *Example:*
54 | | ...
55 | | ... | \| Calculate pps \| 10000000000 \| 64 \|
56 | | ...
57 | | [Arguments] | ${bps} | ${framesize}
58 | | ...
59 | | ${framesize}= | Get Frame Size | ${framesize}
60 | | ${ret}= | Evaluate | (${bps}/((${framesize}+20)*8)).__trunc__()
61 | | Return From Keyword | ${ret}
62
63 | Get Frame Size
64 | | [Documentation]
65 | | ... | Framesize can be either integer in case of a single packet
66 | | ... | in stream, or set of packets in case of IMIX type or simmilar.
67 | | ... | This keyword returns average framesize.
68 | | ...
69 | | ... | *Arguments:*
70 | | ... | - framesize - Framesize. Type: integer or string
71 | | ...
72 | | ... | *Example:*
73 | | ...
74 | | ... | \| Get Frame Size \| IMIX_v4_1 \|
75 | | ...
76 | | [Arguments] | ${framesize}
77 | | ...
78 | | Return From Keyword If | '${framesize}' == 'IMIX_v4_1' | ${353.83333}
79 | | Return From Keyword | ${framesize}
80
81 | Find NDR using linear search and pps
82 | | [Documentation]
83 | | ... | Find throughput by using RFC2544 linear search with non drop rate.
84 | | ...
85 | | ... | *Arguments:*
86 | | ... | - framesize - L2 Frame Size [B]. Type: integer
87 | | ... | - start_rate - Initial start rate [pps]. Type: float
88 | | ... | - step_rate - Step of linear search [pps]. Type: float
89 | | ... | - topology_type - Topology type. Type: string
90 | | ... | - min_rate - Lower limit of search [pps]. Type: float
91 | | ... | - max_rate - Upper limit of search [pps]. Type: float
92 | | ...
93 | | ... | *Return:*
94 | | ... | - No value returned
95 | | ...
96 | | ... | *Example:*
97 | | ...
98 | | ... | \| Find NDR using linear search and pps \| 64 \| 5000000 \
99 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \|
100 | | ...
101 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
102 | | ... | ${topology_type} | ${min_rate} | ${max_rate}
103 | | ...
104 | | ${duration}= | Set Variable | ${perf_trial_duration}
105 | | Set Duration | ${duration}
106 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
107 | | Set Search Linear Step | ${step_rate}
108 | | Set Search Frame Size | ${framesize}
109 | | Set Search Rate Type pps
110 | | Linear Search | ${start_rate} | ${topology_type}
111 | | ${rate_per_stream} | ${lat}= | Verify Search Result
112 | | ${tmp}= | Create List | 100%NDR | ${lat}
113 | | ${latency}= | Create List | ${tmp}
114 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
115 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
116 | | ... | ${framesize} | ${topology_type}
117 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
118 | | Append To List | ${latency} | ${tmp}
119 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
120 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
121 | | ... | ${framesize} | ${topology_type}
122 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
123 | | Append To List | ${latency} | ${tmp}
124 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
125 | | ... | ${latency}
126 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
127 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
128
129 | Find PDR using linear search and pps
130 | | [Documentation]
131 | | ... | Find throughput by using RFC2544 linear search with partial drop rate
132 | | ... | with PDR threshold and type specified by parameter.
133 | | ...
134 | | ... | *Arguments:*
135 | | ... | - framesize - L2 Frame Size [B]. Type: integer
136 | | ... | - start_rate - Initial start rate [pps]. Type: float
137 | | ... | - step_rate - Step of linear search [pps]. Type: float
138 | | ... | - topology_type - Topology type. Type: string
139 | | ... | - min_rate - Lower limit of search [pps]. Type: float
140 | | ... | - max_rate - Upper limit of search [pps]. Type: float
141 | | ... | - loss_acceptance - Accepted loss during search. Type: float
142 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
143 | | ...
144 | | ... | *Example:*
145 | | ...
146 | | ... | \| Find PDR using linear search and pps \| 64 \| 5000000 \
147 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 0.5 \| percentage \|
148 | | ...
149 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
150 | | ... | ${topology_type} | ${min_rate} | ${max_rate}
151 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
152 | | ...
153 | | ${duration}= | Set Variable | ${perf_trial_duration}
154 | | Set Duration | ${duration}
155 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
156 | | Set Search Linear Step | ${step_rate}
157 | | Set Search Frame Size | ${framesize}
158 | | Set Search Rate Type pps
159 | | Set Loss Acceptance | ${loss_acceptance}
160 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
161 | | ... | Set Loss Acceptance Type Percentage
162 | | Linear Search | ${start_rate} | ${topology_type}
163 | | ${rate_per_stream} | ${lat}= | Verify Search Result
164 | | ${tmp}= | Create List | 100%PDR | ${lat}
165 | | ${latency}= | Create List | ${tmp}
166 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
167 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
168 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
169 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
170 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
171
172 | Find NDR using binary search and pps
173 | | [Documentation]
174 | | ... | Find throughput by using RFC2544 binary search with non drop rate.
175 | | ...
176 | | ... | *Arguments:*
177 | | ... | - framesize - L2 Frame Size [B]. Type: integer
178 | | ... | - binary_min - Lower boundary of search [pps]. Type: float
179 | | ... | - binary_max - Upper boundary of search [pps]. Type: float
180 | | ... | - topology_type - Topology type. Type: string
181 | | ... | - min_rate - Lower limit of search [pps]. Type: float
182 | | ... | - max_rate - Upper limit of search [pps]. Type: float
183 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
184 | | ...
185 | | ... | *Example:*
186 | | ...
187 | | ... | \| Find NDR using binary search and pps \| 64 \| 6000000 \
188 | | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \|
189 | | ...
190 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
191 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
192 | | ...
193 | | ${duration}= | Set Variable | ${perf_trial_duration}
194 | | Set Duration | ${duration}
195 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
196 | | Set Search Frame Size | ${framesize}
197 | | Set Search Rate Type pps
198 | | Set Binary Convergence Threshold | ${threshold}
199 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
200 | | ${rate_per_stream} | ${lat}= | Verify Search Result
201 | | ${tmp}= | Create List | 100%NDR | ${lat}
202 | | ${latency}= | Create List | ${tmp}
203 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
204 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
205 | | ... | ${framesize} | ${topology_type}
206 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
207 | | Append To List | ${latency} | ${tmp}
208 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
209 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
210 | | ... | ${framesize} | ${topology_type}
211 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
212 | | Append To List | ${latency} | ${tmp}
213 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
214 | | ... | ${latency}
215 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
216 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
217
218 | Find PDR using binary search and pps
219 | | [Documentation]
220 | | ... | Find throughput by using RFC2544 binary search with partial drop rate
221 | | ... | with PDR threshold and type specified by parameter.
222 | | ...
223 | | ... | *Arguments:*
224 | | ... | - framesize - L2 Frame Size [B]. Type: integer
225 | | ... | - binary_min - Lower boundary of search [pps]. Type: float
226 | | ... | - binary_max - Upper boundary of search [pps]. Type: float
227 | | ... | - topology_type - Topology type. Type: string
228 | | ... | - min_rate - Lower limit of search [pps]. Type: float
229 | | ... | - max_rate - Upper limit of search [pps]. Type: float
230 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
231 | | ... | - loss_acceptance - Accepted loss during search. Type: float
232 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
233 | | ...
234 | | ... | *Example:*
235 | | ...
236 | | ... | \| Find PDR using binary search and pps \| 64 \| 6000000 \
237 | | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \| 0.5 \
238 | | ... | \| percentage \|
239 | | ...
240 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
241 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
242 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
243 | | ...
244 | | ${duration}= | Set Variable | ${perf_trial_duration}
245 | | Set Duration | ${duration}
246 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
247 | | Set Search Frame Size | ${framesize}
248 | | Set Search Rate Type pps
249 | | Set Loss Acceptance | ${loss_acceptance}
250 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
251 | | ... | Set Loss Acceptance Type Percentage
252 | | Set Binary Convergence Threshold | ${threshold}
253 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
254 | | ${rate_per_stream} | ${lat}= | Verify Search Result
255 | | ${tmp}= | Create List | 100%PDR | ${lat}
256 | | ${latency}= | Create List | ${tmp}
257 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
258 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
259 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
260 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
261 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
262
263 | Find NDR using combined search and pps
264 | | [Documentation]
265 | | ... | Find throughput by using RFC2544 combined search (linear+binary) with
266 | | ... | non drop rate.
267 | | ...
268 | | ... | *Arguments:*
269 | | ... | - framesize - L2 Frame Size [B]. Type: integer
270 | | ... | - start_rate - Initial start rate [pps]. Type: float
271 | | ... | - step_rate - Step of linear search [pps]. Type: float
272 | | ... | - topology_type - Topology type. Type: string
273 | | ... | - min_rate - Lower limit of search [pps]. Type: float
274 | | ... | - max_rate - Upper limit of search [pps]. Type: float
275 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
276 | | ...
277 | | ... | *Example:*
278 | | ...
279 | | ... | \| Find NDR using combined search and pps \| 64 \| 5000000 \
280 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \|
281 | | ...
282 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
283 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
284 | | ...
285 | | ${duration}= | Set Variable | ${perf_trial_duration}
286 | | Set Duration | ${duration}
287 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
288 | | Set Search Linear Step | ${step_rate}
289 | | Set Search Frame Size | ${framesize}
290 | | Set Search Rate Type pps
291 | | Set Binary Convergence Threshold | ${threshold}
292 | | Combined Search | ${start_rate} | ${topology_type}
293 | | ${rate_per_stream} | ${lat}= | Verify Search Result
294 | | ${tmp}= | Create List | 100%NDR | ${lat}
295 | | ${latency}= | Create List | ${tmp}
296 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
297 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
298 | | ... | ${framesize} | ${topology_type}
299 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
300 | | Append To List | ${latency} | ${tmp}
301 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
302 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
303 | | ... | ${framesize} | ${topology_type}
304 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
305 | | Append To List | ${latency} | ${tmp}
306 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
307 | | ... | ${latency}
308 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
309 | | ... | ${framesize} | ${topology_type}
310 | | ... | fail_on_loss=${False}
311
312 | Find PDR using combined search and pps
313 | | [Documentation]
314 | | ... | Find throughput by using RFC2544 combined search (linear+binary) with
315 | | ... | partial drop rate with PDR threshold and type specified by parameter.
316 | | ...
317 | | ... | *Arguments:*
318 | | ... | - framesize - L2 Frame Size [B]. Type: integer
319 | | ... | - start_rate - Initial start rate [pps]. Type: float
320 | | ... | - step_rate - Step of linear search [pps]. Type: float
321 | | ... | - topology_type - Topology type. Type: string
322 | | ... | - min_rate - Lower limit of search [pps]. Type: float
323 | | ... | - max_rate - Upper limit of search [pps]. Type: float
324 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
325 | | ... | - loss_acceptance - Accepted loss during search. Type: float
326 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
327 | | ...
328 | | ... | *Example:*
329 | | ...
330 | | ... | \| Find PDR using combined search and pps \| 64 \| 5000000 \
331 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \| 0.5 \
332 | | ... | \| percentage \|
333 | | ...
334 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
335 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
336 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
337 | | ...
338 | | ${duration}= | Set Variable | ${perf_trial_duration}
339 | | Set Duration | ${duration}
340 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
341 | | Set Search Linear Step | ${step_rate}
342 | | Set Search Frame Size | ${framesize}
343 | | Set Search Rate Type pps
344 | | Set Loss Acceptance | ${loss_acceptance}
345 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
346 | | ... | Set Loss Acceptance Type Percentage
347 | | Set Binary Convergence Threshold | ${threshold}
348 | | Combined Search | ${start_rate} | ${topology_type}
349 | | ${rate_per_stream} | ${lat}= | Verify Search Result
350 | | ${tmp}= | Create List | 100%PDR | ${lat}
351 | | ${latency}= | Create List | ${tmp}
352 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
353 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
354 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
355 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
356 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
357
358 | Find NDR and PDR intervals using optimized search
359 | | [Documentation]
360 | | ... | Find boundaries for RFC2544 compatible NDR and PDR values
361 | | ... | using an optimized search algorithm.
362 | | ... | Display results as formatted test message.
363 | | ... | Fail if a resulting lower bound has too high drop fraction.
364 | | ... | Proceed with Perform additional measurements based on NDRPDR result.
365 | | ... | TODO: Should the trial duration of the additional
366 | | ... | measurements be configurable?
367 | | ...
368 | | ... | *Arguments:*
369 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str
370 | | ... | - topology_type - Topology type. Type: string
371 | | ... | - fail_rate - Lower limit of search [pps]. Type: float
372 | | ... | - line_rate - Upper limit of search [pps]. Type: float
373 | | ... | - allowed_drop_fraction - Accepted loss during search. Type: float
374 | | ... | - final_relative_width - Maximal width multiple of upper. Type: float
375 | | ... | - final_trial_duration - Duration of final trials [s]. Type: float
376 | | ... | - initial_trial_duration - Duration of initial trials [s]. Type: float
377 | | ... | - intermediate phases - Number of intermediate phases [1]. Type: int
378 | | ... | - timeout - Fail if search duration is longer [s]. Type: float
379 | | ...
380 | | ... | *Example:*
381 | | ...
382 | | ... | \| Find NDR and PDR intervals using optimized search \| \${64} \| \
383 | | ... | 3-node-IPv4 \| \${100000} \| \${14880952} \| \${0.005} \| \${0.005} \
384 | | ... | \| \${30.0} \| \${1.0} \| \${2} \| ${600.0}
385 | | ...
386 | | [Arguments] | ${frame_size} | ${topology_type} | ${fail_rate} | ${line_rate}
387 | | ... | ${allowed_drop_fraction}=${0.005} | ${final_relative_width}=${0.005}
388 | | ... | ${final_trial_duration}=${30.0} | ${initial_trial_duration}=${1.0}
389 | | ... | ${intermediate_phases}=${2} | ${timeout}=${600.0}
390 | | ...
391 | | ${result}= | Perform optimized ndrpdr search | ${frame_size}
392 | | ... | ${topology_type} | ${fail_rate} | ${line_rate}
393 | | ... | ${allowed_drop_fraction} | ${final_relative_width}
394 | | ... | ${final_trial_duration} | ${initial_trial_duration}
395 | | ... | ${intermediate_phases} | timeout=${timeout}
396 | | Display result of NDRPDR search | ${result} | ${frame_size}
397 | | Check NDRPDR interval validity | ${result.pdr_interval}
398 | | ... | ${allowed_drop_fraction}
399 | | Check NDRPDR interval validity | ${result.ndr_interval}
400 | | Perform additional measurements based on NDRPDR result
401 | | ... | ${result} | ${frame_size} | ${topology_type}
402
403 | Display single bound
404 | | [Documentation]
405 | | ... | Display one bound of NDR+PDR search,
406 | | ... | in packet per seconds (total and per stream)
407 | | ... | and Gbps total bandwidth with untagged packet.
408 | | ... | Througput is calculated as:
409 | | ... | Measured rate per stream * Total number of streams
410 | | ... | Bandwidth is calculated as:
411 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
412 | | ... | The given result should contain latency data as well.
413 | | ...
414 | | ... | *Arguments:*
415 | | ... | - text - Flavor text describing which bound is this. Type: string
416 | | ... | - rate_total - Total (not per stream) measured Tr [pps]. Type: float
417 | | ... | - framesize - L2 Frame Size [B]. Type: integer
418 | | ... | - latency - Latency data to display if non-empty. Type: string
419 | | ...
420 | | ... | *Example:*
421 | | ...
422 | | ... | \| Display single bound \| NDR lower bound \| \${12345.67} \
423 | | ... | \| \${64} \| show_latency=\${EMPTY}
424 | | ...
425 | | [Arguments] | ${text} | ${rate_total} | ${framesize} | ${latency}=${EMPTY}
426 | | ...
427 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
428 | | Set Test Message | ${\n}${text}: ${rate_total} pps, | append=yes
429 | | Set Test Message | ${bandwidth_total} Gbps (untagged) | append=yes
430 | | Return From Keyword If | not """${latency}"""
431 | | Set Test Message | ${\n}LATENCY usec [min/avg/max] per stream: ${latency}
432 | | ... | append=yes
433
434 | Display result of NDRPDR search
435 | | [Documentation]
436 | | ... | Display result of NDR+PDR search, both quantities, both bounds,
437 | | ... | in packet per seconds (total and per stream)
438 | | ... | and Gbps total bandwidth with untagged packet.
439 | | ... | Througput is calculated as:
440 | | ... | Measured rate per stream * Total number of streams
441 | | ... | Bandwidth is calculated as:
442 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
443 | | ... | The given result should contain latency data as well.
444 | | ...
445 | | ... | *Arguments:*
446 | | ... | - result - Measured result data per stream [pps]. Type: NdrPdrResult
447 | | ... | - framesize - L2 Frame Size [B]. Type: integer
448 | | ...
449 | | ... | *Example:*
450 | | ...
451 | | ... | \| Display result of NDRPDR search \| \${result} \| \${64}
452 | | ...
453 | | [Arguments] | ${result} | ${framesize}
454 | | ...
455 | | ${framesize}= | Get Frame Size | ${framesize}
456 | | Display single bound | NDR_LOWER
457 | | ... | ${result.ndr_interval.measured_low.transmit_rate} | ${framesize}
458 | | ... | ${result.ndr_interval.measured_low.latency}
459 | | Display single bound | NDR_UPPER
460 | | ... | ${result.ndr_interval.measured_high.transmit_rate} | ${framesize}
461 | | Display single bound | PDR_LOWER
462 | | ... | ${result.pdr_interval.measured_low.transmit_rate} | ${framesize}
463 | | ... | ${result.pdr_interval.measured_low.latency}
464 | | Display single bound | PDR_UPPER
465 | | ... | ${result.pdr_interval.measured_high.transmit_rate} | ${framesize}
466
467 | Check NDRPDR interval validity
468 | | [Documentation]
469 | | ... | Extract drop fraction of lower bound of the interval.
470 | | ... | Fail if it does not reach the allowed value.
471 | | ...
472 | | ... | *Arguments:*
473 | | ... | - interval - Measured interval. Type: ReceiveRateInterval
474 | | ... | - allowed_drop_fraction - Accepted loss (0.0 for NDR). Type: float
475 | | ...
476 | | ... | *Example:*
477 | | ...
478 | | ... | \| Check NDRPDR interval validity \| \${result.pdr_interval} \
479 | | ... | \| \${0.005}
480 | | ...
481 | | [Arguments] | ${interval} | ${allowed_drop_fraction}=${0.0}
482 | | ...
483 | | ${lower_bound_df}= | Set Variable | ${interval.measured_low.drop_fraction}
484 | | Return From Keyword If | ${lower_bound_df} <= ${allowed_drop_fraction}
485 | | ${messagge}= | Catenate | SEPARATOR=${SPACE}
486 | | ... | Lower bound fraction ${lower_bound_df}
487 | | ... | does not reach ${allowed_drop_fraction}.
488 | | Fail | ${message}
489
490 | Perform additional measurements based on NDRPDR result
491 | | [Documentation]
492 | | ... | Perform any additional measurements which are not directly needed
493 | | ... | for determining NDR nor PDR, but which are needed for gathering
494 | | ... | additional data for debug purposes.
495 | | ... | Currently, just "Traffic should pass with no loss" is called.
496 | | ... | TODO: Move latency measurements from optimized search here.
497 | | ...
498 | | ... | *Arguments:*
499 | | ... | - result - Measured result data per stream [pps]. Type: NdrPdrResult
500 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str
501 | | ... | - topology_type - Topology type. Type: string
502 | | ...
503 | | ... | *Example:*
504 | | ... | \| Perform additional measurements based on NDRPDR result \
505 | | ... | \| \${result} \| ${64} \| 3-node-IPv4
506 | | ...
507 | | [Arguments] | ${result} | ${framesize} | ${topology_type}
508 | | ...
509 | | ${duration}= | Set Variable | 5.0
510 | | ${rate_per_stream}= | Evaluate
511 | | ... | ${result.ndr_interval.measured_low.target_tr} / 2.0
512 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
513 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
514
515 | Display result of NDR search
516 | | [Documentation]
517 | | ... | Display result of NDR search in packet per seconds (total and per
518 | | ... | stream) and Gbps total bandwidth with untagged packet.
519 | | ... | Througput is calculated as:
520 | | ... | Measured rate per stream * Total number of streams
521 | | ... | Bandwidth is calculated as:
522 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
523 | | ...
524 | | ... | *Arguments:*
525 | | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string
526 | | ... | - framesize - L2 Frame Size [B]. Type: integer
527 | | ... | - nr_streams - Total number of streams. Type: integer
528 | | ... | - latency - Latency stats. Type: dictionary
529 | | ...
530 | | ... | *Example:*
531 | | ...
532 | | ... | \| Display result of NDR search \| 4400000 \| 64 \| 2 \
533 | | ... | \| [100%NDR, [10/10/10, 1/2/3]] \|
534 | | ...
535 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams} | ${latency}
536 | | ...
537 | | ${framesize}= | Get Frame Size | ${framesize}
538 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
539 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
540 | | Set Test Message | FINAL_RATE: ${rate_total} pps
541 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes
542 | | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged)
543 | | ... | append=yes
544 | | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes
545 | | :FOR | ${lat} | IN | @{latency}
546 | | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes
547
548 | Display result of PDR search
549 | | [Documentation]
550 | | ... | Display result of PDR search in packet per seconds (total and per
551 | | ... | stream) and Gbps total bandwidth with untagged packet.
552 | | ... | Througput is calculated as:
553 | | ... | Measured rate per stream * Total number of streams
554 | | ... | Bandwidth is calculated as:
555 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
556 | | ...
557 | | ... | *Arguments:*
558 | | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string
559 | | ... | - framesize - L2 Frame Size [B]. Type: integer
560 | | ... | - nr_streams - Total number of streams. Type: integer
561 | | ... | - loss_acceptance - Accepted loss during search. Type: float
562 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
563 | | ... | - latency - Latency stats. Type: dictionary
564 | | ...
565 | | ... | *Example:*
566 | | ...
567 | | ... | \| Display result of PDR search \| 4400000 \| 64 \| 2 \| 0.5 \
568 | | ... | \| percentage \| [100%NDR, [10/10/10, 1/2/3]] \|
569 | | ...
570 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams}
571 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
572 | | ...
573 | | ${framesize}= | Get Frame Size | ${framesize}
574 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
575 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
576 | | Set Test Message | FINAL_RATE: ${rate_total} pps
577 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes
578 | | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged)
579 | | ... | append=yes
580 | | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes
581 | | :FOR | ${lat} | IN | @{latency}
582 | | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes
583 | | Set Test Message
584 | | ... | ${\n}LOSS_ACCEPTANCE: ${loss_acceptance} ${loss_acceptance_type}
585 | | ... | append=yes
586
587 | Display raw results
588 | | [Documentation]
589 | | ... | Display raw results from TG in total received/send packets over trial
590 | | ... | duration in seconds.
591 | | ...
592 | | ... | *Arguments:*
593 | | ... | - framesize - L2 Frame Size [B]. Type: integer
594 | | ... | - results - Measured results. Type: string
595 | | ...
596 | | ... | *Example:*
597 | | ...
598 | | ... | \| Display raw results \| 64 \| results \|
599 | | ...
600 | | [Arguments] | ${framesize} | ${results}
601 | | ...
602 | | ${framesize}= | Get Frame Size | ${framesize}
603 | | @{tokens}= | Split String | ${results} | ,
604 | | @{received}= | Split String | @{tokens}[1] | =
605 | | @{sent}= | Split String | @{tokens}[2] | =
606 | | ${total_received} = | Set Variable | @{received}[1]
607 | | ${total_sent} = | Set Variable | @{sent}[1]
608 | | Set Test Message | MaxReceivedRate_Results [pkts/${perf_trial_duration}sec]:
609 | | Set Test Message | tx ${total_sent}, rx ${total_received} | append=yes
610
611 | Measure latency pps
612 | | [Documentation]
613 | | ... | Send traffic at specified rate. Measure min/avg/max latency
614 | | ...
615 | | ... | *Arguments:*
616 | | ... | - duration - Duration of traffic run [s]. Type: integer
617 | | ... | - rate - Rate for sending packets. Type: integer
618 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
619 | | ... | - topology_type - Topology type. Type: string
620 | | ...
621 | | ... | *Example:*
622 | | ...
623 | | ... | \| Measure latency \| 10 \| 4.0 \| 64 \| 3-node-IPv4 \|
624 | | ...
625 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
626 | | ...
627 | | Return From Keyword If | ${rate} <= 10000 | ${-1}
628 | | Send traffic on tg | ${duration} | ${rate}pps | ${framesize}
629 | | ... | ${topology_type} | warmup_time=0
630 | | Run keyword and return | Get latency
631
632 | Traffic should pass with no loss
633 | | [Documentation]
634 | | ... | Send traffic at specified rate. No packet loss is accepted at loss
635 | | ... | evaluation.
636 | | ...
637 | | ... | *Arguments:*
638 | | ... | - duration - Duration of traffic run [s]. Type: integer
639 | | ... | - rate - Rate for sending packets. Type: string
640 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
641 | | ... | - topology_type - Topology type. Type: string
642 | | ... | - fail_on_loss - If True, the keyword fails if loss occurred.
643 | | ... | Type: boolean
644 | | ...
645 | | ... | *Example:*
646 | | ...
647 | | ... | \| Traffic should pass with no loss \| 10 \| 4.0mpps \| 64 \
648 | | ... | \| 3-node-IPv4 \|
649 | | ...
650 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
651 | | ... | ${fail_on_loss}=${True}
652 | | ...
653 | | Send traffic at specified rate | ${duration} | ${rate} | ${framesize}
654 | | ... | ${topology_type}
655 | | Run Keyword If | ${fail_on_loss} | No traffic loss occurred
656
657 | Traffic should pass with partial loss
658 | | [Documentation]
659 | | ... | Send traffic at specified rate. Partial packet loss is accepted
660 | | ... | within loss acceptance value specified as argument.
661 | | ...
662 | | ... | *Arguments:*
663 | | ... | - duration - Duration of traffic run [s]. Type: integer
664 | | ... | - rate - Rate for sending packets. Type: string
665 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
666 | | ... | - topology_type - Topology type. Type: string
667 | | ... | - loss_acceptance - Accepted loss during search. Type: float
668 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
669 | | ...
670 | | ... | *Example:*
671 | | ...
672 | | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \
673 | | ... | \| 3-node-IPv4 \| 0.5 \| percentage \|
674 | | ...
675 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
676 | | ... | ${loss_acceptance} | ${loss_acceptance_type}
677 | | ... | ${fail_on_loss}=${True}
678 | | ...
679 | | Send traffic at specified rate | ${duration} | ${rate} | ${framesize}
680 | | ... | ${topology_type}
681 | | Run Keyword If | ${fail_on_loss} | Partial traffic loss accepted
682 | | ... | ${loss_acceptance} | ${loss_acceptance_type}
683
684 | Traffic should pass with maximum rate
685 | | [Documentation]
686 | | ... | Send traffic at maximum rate.
687 | | ...
688 | | ... | *Arguments:*
689 | | ... | - duration - Duration of traffic run [s]. Type: integer
690 | | ... | - rate - Rate for sending packets. Type: string
691 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
692 | | ... | - topology_type - Topology type. Type: string
693 | | ... | Type: boolean
694 | | ...
695 | | ... | *Example:*
696 | | ...
697 | | ... | \| Traffic should pass with maximum rate \| 10 \| 4.0mpps \| 64 \
698 | | ... | \| 3-node-IPv4 \|
699 | | ...
700 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
701 | | ... | ${fail_no_traffic}=${True}
702 | | ...
703 | | ${results}= | Send traffic at specified rate | ${duration} | ${rate}
704 | | ... | ${framesize} | ${topology_type}
705 | | Display raw results | ${framesize} | ${results}
706 | | Run Keyword If | ${fail_no_traffic} | Fail if no traffic forwarded
707
708 | Send traffic at specified rate
709 | | [Documentation]
710 | | ... | Send traffic at specified rate.
711 | | ...
712 | | ... | *Arguments:*
713 | | ... | - duration - Duration of traffic run [s]. Type: integer
714 | | ... | - rate - Rate for sending packets. Type: string
715 | | ... | - framesize - L2 Frame Size [B]. Type: integer/string
716 | | ... | - topology_type - Topology type. Type: string
717 | | ... | Type: boolean
718 | | ...
719 | | ... | *Example:*
720 | | ...
721 | | ... | \| Send traffic at specific rate \| 10 \| 4.0mpps \| 64 \
722 | | ... | \| 3-node-IPv4 \|
723 | | ...
724 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
725 | | ...
726 | | Clear and show runtime counters with running traffic | ${duration}
727 | | ... | ${rate} | ${framesize} | ${topology_type}
728 | | Run Keyword If | ${dut_stats}==${True} | Clear all counters on all DUTs
729 | | Run Keyword If | ${dut_stats}==${True} and ${pkt_trace}==${True}
730 | | ... | VPP Enable Traces On All DUTs | ${nodes}
731 | | ${results} = | Send traffic on tg | ${duration} | ${rate} | ${framesize}
732 | | ... | ${topology_type} | warmup_time=0
733 | | Run Keyword If | ${dut_stats}==${True} | Show statistics on all DUTs | ${nodes}
734 | | Run Keyword If | ${dut_stats}==${True} and ${pkt_trace}==${True}
735 | | ... | Show Packet Trace On All Duts | ${nodes} | maximum=${100}
736 | | Return From Keyword | ${results}
737
738 | Clear and show runtime counters with running traffic
739 | | [Documentation]
740 | | ... | Start traffic at specified rate then clear runtime counters on all
741 | | ... | DUTs. Wait for specified amount of time and capture runtime counters
742 | | ... | on all DUTs. Finally stop traffic
743 | | ...
744 | | ... | *Arguments:*
745 | | ... | - duration - Duration of traffic run [s]. Type: integer
746 | | ... | - rate - Rate for sending packets. Type: string
747 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
748 | | ... | - topology_type - Topology type. Type: string
749 | | ...
750 | | ... | *Example:*
751 | | ...
752 | | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \
753 | | ... | \| 3-node-IPv4 \| 0.5 \| percentage \|
754 | | ...
755 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
756 | | ...
757 | | Send traffic on tg | -1 | ${rate} | ${framesize} | ${topology_type}
758 | | ... | warmup_time=0 | async_call=${True} | latency=${False}
759 | | Run Keyword If | ${dut_stats}==${True}
760 | | ... | Clear runtime counters on all DUTs | ${nodes}
761 | | Sleep | ${duration}
762 | | Run Keyword If | ${dut_stats}==${True}
763 | | ... | Show runtime counters on all DUTs | ${nodes}
764 | | Stop traffic on tg