aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/robot
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/robot')
-rw-r--r--resources/libraries/robot/ip/nat.robot10
-rw-r--r--resources/libraries/robot/performance/performance_utils.robot66
-rw-r--r--resources/libraries/robot/performance/performance_vars.robot51
3 files changed, 87 insertions, 40 deletions
diff --git a/resources/libraries/robot/ip/nat.robot b/resources/libraries/robot/ip/nat.robot
index 75b8cce7b6..202ade34a5 100644
--- a/resources/libraries/robot/ip/nat.robot
+++ b/resources/libraries/robot/ip/nat.robot
@@ -1,4 +1,4 @@
-# Copyright (c) 2020 Cisco and/or its affiliates.
+# Copyright (c) 2021 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@ -57,8 +57,8 @@
| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${DUT1_${int}2}[0]
| | ${resetter} = | Set NAT44 Address Range
| | ... | ${dut1} | ${out_net} | ${out_net_end}
-| | ${ramp_up_duration} = | Get Ramp Up Duration
-| | Return From Keyword If | ${ramp_up_duration}
+| | ${ramp_up_rate} = | Get Ramp Up Rate
+| | Return From Keyword If | ${ramp_up_rate}
| | Set Test Variable | \${resetter}
# TODO: Remove when 'ip4.Initialize IPv4 forwarding in circular topology' KW
@@ -221,8 +221,8 @@
| |
| | ${resetter} = | Set DET44 Mapping
| | ... | ${node} | ${ip_in} | ${subnet_in} | ${ip_out} | ${subnet_out}
-| | ${ramp_up_duration} = | Get Ramp Up Duration
-| | Return From Keyword If | ${ramp_up_duration}
+| | ${ramp_up_rate} = | Get Ramp Up Rate
+| | Return From Keyword If | ${ramp_up_rate}
| | Set Test Variable | \${resetter}
| Initialize NAT44 deterministic mode in circular topology
diff --git a/resources/libraries/robot/performance/performance_utils.robot b/resources/libraries/robot/performance/performance_utils.robot
index 9a1de5cc77..638a834fc1 100644
--- a/resources/libraries/robot/performance/performance_utils.robot
+++ b/resources/libraries/robot/performance/performance_utils.robot
@@ -51,6 +51,8 @@
| | ... | \| Clear and show runtime counters with running traffic \|
| |
| | ${ppta} = | Get Packets Per Transaction Aggregated
+| | ${ramp_up_duration} = | Get Ramp Up Duration
+| | ${ramp_up_rate} = | Get Ramp Up Rate
| | ${runtime_duration} = | Get Runtime Duration
| | ${runtime_rate} = | Get Runtime Rate
| | ${traffic_directions} = | Get Traffic Directions
@@ -72,6 +74,8 @@
| | ... | transaction_scale=${transaction_scale}
| | ... | transaction_type=${transaction_type}
| | ... | duration_limit=${0.0}
+| | ... | ramp_up_duration=${ramp_up_duration}
+| | ... | ramp_up_rate=${ramp_up_rate}
| | FOR | ${action} | IN | @{pre_run_stats}
| | | Run Keyword | Additional Statistics Action For ${action}
| | END
@@ -89,7 +93,6 @@
| | ... | Fail if computed lower bound is 110% of the minimal rate or less.
| | ... | Input rates are unidirectional, in transaction per second.
| | ... | Reported result may contain aggregate pps rates, depending on test.
-| | ... | Currently, the min_rate value is hardcoded to match test teardowns.
| | ... | Call \${resetter} (if defined) to reset DUT state before each trial.
| |
| | ... | *Test (or broader scope) variables read:*
@@ -106,8 +109,10 @@
| |
| | # Get values via performance_vars.
| | ${max_rate} = | Get Max Rate
-| | ${min_rate} = | Get Min Rate
+| | ${min_rate_soft} = | Get Min Rate Soft
| | ${ppta} = | Get Packets Per Transaction Aggregated
+| | ${ramp_up_duration} = | Get Ramp Up Duration
+| | ${ramp_up_rate} = | Get Ramp Up Rate
| | ${resetter} = | Get Resetter
| | ${traffic_directions} = | Get Traffic Directions
| | ${transaction_duration} = | Get Transaction Duration
@@ -117,7 +122,7 @@
| | ${average} | ${stdev} = | Perform soak search
| | ... | frame_size=${frame_size}
| | ... | traffic_profile=${traffic_profile}
-| | ... | minimum_transmit_rate=${min_rate}
+| | ... | minimum_transmit_rate=${min_rate_soft}
| | ... | maximum_transmit_rate=${max_rate}
| | ... | plr_target=${1e-7}
| | ... | tdpt=${0.1}
@@ -131,11 +136,13 @@
| | ... | transaction_duration=${transaction_duration}
| | ... | transaction_type=${transaction_type}
| | ... | use_latency=${use_latency}
+| | ... | ramp_up_duration=${ramp_up_duration}
+| | ... | ramp_up_rate=${ramp_up_rate}
| | ${lower} | ${upper} = | Display result of soak search
| | ... | ${average} | ${stdev}
| | Set Test Variable | \${rate for teardown} | ${lower}
-| | Should Not Be True | 1.1 * ${min_rate} > ${lower}
-| | ... | Lower bound ${lower} too small for unidirectional minimum ${min_rate}.
+| | Should Not Be True | 1.1 * ${min_rate_soft} > ${lower}
+| | ... | Lower bound ${lower} too small for unidir minimum ${min_rate_soft}.
| Find NDR and PDR intervals using optimized search
| | [Documentation]
@@ -149,9 +156,6 @@
| | ... | even if latency stream is disabled in search. Their results
| | ... | are also displayed.
| | ... | Finally, two measurements for runtime stats are done (not displayed).
-| | ... | Currently, the min_rate value is hardcoded to 90kpps,
-| | ... | allowing measurement at 10% of the discovered rate
-| | ... | without breaking latency streams.
| | ... | Call \${resetter} (if defined) to reset DUT state before each trial.
| |
| | ... | *Test (or broader scope) variables read:*
@@ -175,10 +179,12 @@
| | # Get values via performance_vars.
| | ${disable_latency} = | Get Disable Latency
| | ${max_rate} = | Get Max Rate
-| | ${min_rate} = | Get Min Rate
+| | ${min_rate_soft} = | Get Min Rate Soft
| | # \${packet_loss_ratio} is used twice so it is worth a variable.
| | ${packet_loss_ratio} = | Get Packet Loss Ratio
| | ${ppta} = | Get Packets Per Transaction Aggregated
+| | ${ramp_up_duration} = | Get Ramp Up Duration
+| | ${ramp_up_rate} = | Get Ramp Up Rate
| | ${resetter} = | Get Resetter
| | ${traffic_directions} = | Get Traffic Directions
| | ${transaction_duration} = | Get Transaction Duration
@@ -188,7 +194,7 @@
| | ${result} = | Perform optimized ndrpdr search
| | ... | frame_size=${frame_size}
| | ... | traffic_profile=${traffic_profile}
-| | ... | minimum_transmit_rate=${min_rate}
+| | ... | minimum_transmit_rate=${min_rate_soft}
| | ... | maximum_transmit_rate=${max_rate}
| | ... | packet_loss_ratio=${packet_loss_ratio}
| | ... | final_relative_width=${0.005}
@@ -204,6 +210,8 @@
| | ... | transaction_scale=${transaction_scale}
| | ... | transaction_type=${transaction_type}
| | ... | use_latency=${use_latency}
+| | ... | ramp_up_duration=${ramp_up_duration}
+| | ... | ramp_up_rate=${ramp_up_rate}
| | Display result of NDRPDR search | ${result}
| | Check NDRPDR interval validity | ${result.pdr_interval}
| | ... | ${packet_loss_ratio}
@@ -238,7 +246,6 @@
| | ... | Find and return lower bound NDR (zero PLR)
| | ... | throughput using MLRsearch algorithm.
| | ... | Input and output rates are understood as uni-directional, in tps.
-| | ... | Currently, the min_rate value is hardcoded to match test teardowns.
| | ... | Call \${resetter} (if defined) to reset DUT state before each trial.
| |
| | ... | *Test (or broader scope) variables read:*
@@ -262,8 +269,10 @@
| | ... | \| \${throughpt}= \| Find Throughput Using MLRsearch \|
| |
| | ${max_rate} = | Get Max Rate
-| | ${min_rate} = | Get Min Rate
+| | ${min_rate_soft} = | Get Min Rate Soft
| | ${ppta} = | Get Packets Per Transaction Aggregated
+| | ${ramp_up_duration} = | Get Ramp Up Duration
+| | ${ramp_up_rate} = | Get Ramp Up Rate
| | ${resetter} = | Get Resetter
| | ${traffic_directions} = | Get Traffic Directions
| | ${transaction_duration} = | Get Transaction Duration
@@ -273,7 +282,7 @@
| | ${result} = | Perform optimized ndrpdr search
| | ... | frame_size=${frame_size}
| | ... | traffic_profile=${traffic_profile}
-| | ... | minimum_transmit_rate=${min_rate}
+| | ... | minimum_transmit_rate=${min_rate_soft}
| | ... | maximum_transmit_rate=${max_rate}
| | ... | packet_loss_ratio=${0.0}
| | ... | final_relative_width=${0.001}
@@ -289,6 +298,8 @@
| | ... | transaction_scale=${transaction_scale}
| | ... | transaction_type=${transaction_type}
| | ... | use_latency=${use_latency}
+| | ... | ramp_up_duration=${ramp_up_duration}
+| | ... | ramp_up_rate=${ramp_up_rate}
| | Check NDRPDR interval validity | ${result.pdr_interval}
| | ... | ${0.0}
| | Return From Keyword | ${result.pdr_interval.measured_low.target_tr}
@@ -313,9 +324,11 @@
| |
| | [Arguments] | ${message_prefix} | ${rate}
| |
-| | ${min_rate} = | Get Min Rate
+| | ${min_rate_hard} = | Get Min Rate Hard
| | ${ppta} = | Get Packets Per Transaction Aggregated
-| | ${real_rate} = | Evaluate | max(${rate}, ${min_rate})
+| | ${ramp_up_duration} = | Get Ramp Up Duration
+| | ${ramp_up_rate} = | Get Ramp Up Rate
+| | ${real_rate} = | Evaluate | max(${rate}, ${min_rate_hard})
| | ${traffic_directions} = | Get Traffic Directions
| | ${transaction_duration} = | Get Transaction Duration
| | ${transaction_scale} = | Get Transaction Scale
@@ -334,12 +347,14 @@
| | ... | transaction_scale=${transaction_scale}
| | ... | transaction_type=${transaction_type}
| | ... | use_latency=${True}
+| | ... | ramp_up_duration=${ramp_up_duration}
+| | ... | ramp_up_rate=${ramp_up_rate}
| | ${latency} = | Get Latency Int
| | Set Test Message | ${\n}${message_prefix} ${latency} | append=${True}
| Send ramp-up traffic
| | [Documentation]
-| | ... | Do nothing unless positive ramp-up duration is specified.
+| | ... | Fail unless positive ramp-up rate is specified.
| | ... | Else perform one trial with appropriate rate and duration.
| | ... | This is useful for tests that set DUT state via traffic.
| | ... | Rate has to bee low enough so packets are not lost,
@@ -362,9 +377,9 @@
| |
| | ... | \| Send ramp-up traffic \|
| |
-| | ${ramp_up_duration} = | Get Ramp Up Duration
-| | Run Keyword Unless | ${ramp_up_duration} > 0.0 | Return From Keyword
| | ${ramp_up_rate} = | Get Ramp Up Rate
+| | Run Keyword Unless | ${ramp_up_rate} > 0.0 | Fail | Ramp up rate missing!
+| | ${ramp_up_duration} = | Get Ramp Up Duration
| | ${ppta} = | Get Packets Per Transaction Aggregated
| | ${traffic_directions} = | Get Traffic Directions
| | ${transaction_duration} = | Get Transaction Duration
@@ -384,6 +399,9 @@
| | ... | transaction_duration=${transaction_duration}
| | ... | transaction_scale=${transaction_scale}
| | ... | transaction_type=${transaction_type}
+| | ... | ramp_up_duration=${ramp_up_duration}
+| | ... | ramp_up_rate=${ramp_up_rate}
+| | ... | ramp_up_only=${True}
| Send traffic at specified rate
| | [Documentation]
@@ -413,6 +431,8 @@
| | ... | ${use_latency}=${False} | ${duration_limit}=${0.0}
| |
| | ${ppta} = | Get Packets Per Transaction Aggregated
+| | ${ramp_up_duration} = | Get Ramp Up Duration
+| | ${ramp_up_rate} = | Get Ramp Up Rate
| | ${traffic_directions} = | Get Traffic Directions
| | ${transaction_duration} = | Get Transaction Duration
| | ${transaction_scale} = | Get Transaction Scale
@@ -424,7 +444,7 @@
| | ${results} = | Create List
| | FOR | ${i} | IN RANGE | ${trial_multiplicity}
| | | Call Resetter
-| | | Send traffic on tg
+| | | ${result}= | Send traffic on tg
| | | ... | duration=${trial_duration}
| | | ... | rate=${rate}
| | | ... | frame_size=${frame_size}
@@ -437,7 +457,8 @@
| | | ... | transaction_scale=${transaction_scale}
| | | ... | transaction_type=${transaction_type}
| | | ... | use_latency=${use_latency}
-| | | ${result}= | Get Measurement Result
+| | | ... | ramp_up_duration=${ramp_up_duration}
+| | | ... | ramp_up_rate=${ramp_up_rate}
| | | # Out of several quantities for aborted traffic (duration stretching),
| | | # the approximated receive rate is the best estimate we have.
| | | Append To List | ${results} | ${result.approximated_receive_rate}
@@ -625,6 +646,8 @@
| | [Arguments] | ${rate}
| |
| | ${ppta} = | Get Packets Per Transaction Aggregated
+| | ${ramp_up_duration} = | Get Ramp Up Duration
+| | ${ramp_up_rate} = | Get Ramp Up Rate
| | ${traffic_directions} = | Get Traffic Directions
| | ${transaction_duration} = | Get Transaction Duration
| | ${transaction_scale} = | Get Transaction Scale
@@ -640,11 +663,14 @@
| | ... | async_call=${True}
| | ... | duration_limit=${0.0}
| | ... | ppta=${ppta}
+| | ... | ramp_up_duration=${ramp_up_duration}
+| | ... | ramp_up_rate=${ramp_up_rate}
| | ... | traffic_directions=${traffic_directions}
| | ... | transaction_duration=${transaction_duration}
| | ... | transaction_scale=${transaction_scale}
| | ... | transaction_type=${transaction_type}
| | ... | use_latency=${use_latency}
+| | # TODO: Ramp-up?
| Stop Running Traffic
| | [Documentation]
diff --git a/resources/libraries/robot/performance/performance_vars.robot b/resources/libraries/robot/performance/performance_vars.robot
index 4a6d385363..9fff489279 100644
--- a/resources/libraries/robot/performance/performance_vars.robot
+++ b/resources/libraries/robot/performance/performance_vars.robot
@@ -60,25 +60,46 @@
| | Return From Keyword If | ${max_rate} | ${max_rate}
| | Fail | \${max_rate} is not defined. Call Set Max Rate And Jumbo keyword.
-| Get Min Rate
+| Get Min Rate Hard
| | [Documentation]
-| | ... | Return a hardcoded value. This is an abstraction, useful in case
-| | ... | we start allowing various other overrides or computations.
-| | ... | Call this just before calling a Python keyword,
-| | ... | as those have restricted access to Robot variables.
-| |
-| | ... | The return value controls the minimal unidirectional packet rate.
-| | ... | The value is also usable for minimal TPS value for ASTF tests.
+| | ... | Return a hardcoded value.
+| | ... | The return value controls the minimal unidirectional packet rate,
+| | ... | to be used anywhere, including latency measurements at 0% load.
| | ... | The current value is the smallest one permitted
| | ... | by STL profiles with latency streams.
| | ... | Return type: float.
| |
| | ... | *Example:*
| |
-| | ... | \| \${min_rate} = \| Get Min Rate \|
+| | ... | \| \${min_rate_hard} = \| Get Min Rate Hard \|
| |
| | Return From Keyword | ${9001.0}
+| Get Min Rate Soft
+| | [Documentation]
+| | ... | If ramp up rate is not defined, return the hard min value.
+| | ... | If ramp up rate is defined (and larger than hard min), return that.
+| | ... | The reason is, ramp up rate should already guarantee no loss.
+| |
+| | ... | The return value controls the minimal unidirectional packet rate,
+| | ... | to be used in various search algorithms.
+| | ... | Latency measurements may want even lower loads, use hard min for that.
+| |
+| | ... | The value is also usable for minimal TPS value for ASTF tests.
+| | ... | Return type: float.
+| |
+| | ... | Currently, undefined ramp up rate is reported as zero,
+| | ... | so we return the maximum of ramp up rate and the hard min rate.
+| |
+| | ... | *Example:*
+| |
+| | ... | \| \${min_rate_soft} = \| Get Min Rate Soft \|
+| |
+| | ${min_rate_hard} = | Get Min Rate Hard
+| | ${ramp_up_rate} = | Get Ramp Up Rate
+| | ${min_rate_soft} = | Evaluate | max(${ramp_up_rate}, ${min_rate_hard})
+| | Return From Keyword | ${min_rate_soft}
+
| Get Mrr Trial Duration
| | [Documentation]
| | ... | Return value from Constants. This is an abstraction, useful in case
@@ -179,7 +200,7 @@
| |
| | ... | The return value determines the required duration of ramp-up phase.
| | ... | Typically used to prepare a specific state on DUT.
-| | ... | If the value is zero, ramp-up phase is skipped.
+| | ... | If the value is zero, ramp-up phase is either skipped or size-limited.
| | ... | Return type: float.
| |
| | ... | *Example:*
@@ -192,12 +213,13 @@
| Get Ramp Up Rate
| | [Documentation]
| | ... | Return value of \${ramp_up_rate},
-| | ... | if not defined return \${max_rate}.
+| | ... | if not defined, return zero.
| |
| | ... | The return value determines the rate for ramp-up phase.
| | ... | Typically used to limit the rate when max rate
| | ... | would lose packets in the ramp up phase, thus not setting
| | ... | the DUT state correctly.
+| | ... | If the value is zero, ramp-up phase should be skipped.
| | ... | Return type: float.
| |
| | ... | *Example:*
@@ -205,13 +227,12 @@
| | ... | \| \${ramp_up_rate} = \| Get Ramp Up Rate \|
| |
| | ${ramp_up_rate} = | Get Variable Value | \${ramp_up_rate} | ${0.0}
-| | Return From Keyword If | ${ramp_up_rate} | ${ramp_up_rate}
-| | Run Keyword And Return | Get Max Rate
+| | Return From Keyword | ${ramp_up_rate}
| Get Rate For Teardown
| | [Documentation]
| | ... | Return value of \${rate_for_teardown},
-| | ... | if not defined (or zero) return the min rate.
+| | ... | if not defined (or zero) return the soft min rate.
| |
| | ... | The return value determines the rate for teardown trial,
| | ... | that is executed if a perf test fails.
@@ -226,7 +247,7 @@
| |
| | ${rate_for_teardown} = | Get Variable Value | \${rate_for_teardown} | ${0.0}
| | Return From Keyword If | ${rate_for_teardown} | ${rate_for_teardown}
-| | Run Keyword And Return | Get Min Rate
+| | Run Keyword And Return | Get Min Rate Soft
| Get Resetter
| | [Documentation]