diff options
author | Peter Mikus <pmikus@cisco.com> | 2018-05-07 14:42:17 +0200 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2018-05-10 05:59:02 +0000 |
commit | 6e9d38fbad8198f8647e3e71d12b5859490c21f2 (patch) | |
tree | 4007d59f81c77e56669b2288c36fc0b02c93e8f4 /resources/libraries | |
parent | 7577a3ff000ba4c61394bc49754a257fbb3d31ef (diff) |
CSIT-1071 Add traffic evaluation criteria to MRR
- Fail the testcase if there is no traffic pass.
Change-Id: I162187073aafa286793ce488fda9fd065bb55213
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries')
-rw-r--r-- | resources/libraries/python/TrafficGenerator.py | 15 | ||||
-rw-r--r-- | resources/libraries/robot/performance/performance_utils.robot | 4 |
2 files changed, 16 insertions, 3 deletions
diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py index aa839dd80e..e7c8c4829a 100644 --- a/resources/libraries/python/TrafficGenerator.py +++ b/resources/libraries/python/TrafficGenerator.py @@ -520,9 +520,20 @@ class TrafficGenerator(AbstractRateProvider): :raises Exception: If loss occured. """ if self._loss is None: - raise Exception('The traffic generation has not been issued') + raise RuntimeError('The traffic generation has not been issued') if self._loss != '0': - raise Exception('Traffic loss occurred: {0}'.format(self._loss)) + raise RuntimeError('Traffic loss occurred: {0}'.format(self._loss)) + + def fail_if_no_traffic_forwarded(self): + """Fail if no traffic forwarded. + + :returns: nothing + :raises Exception: If no traffic forwarded. + """ + if self._received is None: + raise RuntimeError('The traffic generation has not been issued') + if self._received == '0': + raise RuntimeError('No traffic forwarded') def partial_traffic_loss_accepted(self, loss_acceptance, loss_acceptance_type): diff --git a/resources/libraries/robot/performance/performance_utils.robot b/resources/libraries/robot/performance/performance_utils.robot index 1de57b9596..771e7486cb 100644 --- a/resources/libraries/robot/performance/performance_utils.robot +++ b/resources/libraries/robot/performance/performance_utils.robot @@ -694,14 +694,16 @@ | | ... | | ... | *Example:* | | ... -| | ... | \| Traffic should pass with no loss \| 10 \| 4.0mpps \| 64 \ +| | ... | \| Traffic should pass with maximum rate \| 10 \| 4.0mpps \| 64 \ | | ... | \| 3-node-IPv4 \| | | ... | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type} +| | ... | ${fail_no_traffic}=${True} | | ... | | ${results}= | Send traffic at specified rate | ${duration} | ${rate} | | ... | ${framesize} | ${topology_type} | | Display raw results | ${framesize} | ${results} +| | Run Keyword If | ${fail_no_traffic} | Fail if no traffic forwarded | Send traffic at specified rate | | [Documentation] |