diff options
author | Miikka Koistinen <miikka.koistinen@nokia.com> | 2018-06-08 13:54:48 +0300 |
---|---|---|
committer | Miikka Koistinen <miikka.koistinen@nokia.com> | 2018-06-15 14:32:37 +0300 |
commit | 39f80e9b06395ae1515cfcf08508504ad4dd978a (patch) | |
tree | 9b9ecfcf72e6438228787d67c12212a498e885b6 /yardstick/benchmark/scenarios/networking/vsperf.py | |
parent | ded989093f16c2d7d8900b2a3afbc0521d474e08 (diff) |
Convert SLA asserts to raises
This commit converts Python assertions to a custom exception in all
places where SLA validation is checked with an assertion.
This commit also fixes all emerged pylint errors.
JIRA: YARDSTICK-966
Change-Id: If771ed03b2cbc0a43a57fcfb9293f18740b3ff80
Signed-off-by: Miikka Koistinen <miikka.koistinen@nokia.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/networking/vsperf.py')
-rw-r--r-- | yardstick/benchmark/scenarios/networking/vsperf.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/yardstick/benchmark/scenarios/networking/vsperf.py b/yardstick/benchmark/scenarios/networking/vsperf.py index 705544c41..2b3474070 100644 --- a/yardstick/benchmark/scenarios/networking/vsperf.py +++ b/yardstick/benchmark/scenarios/networking/vsperf.py @@ -215,15 +215,15 @@ class Vsperf(base.Scenario): if 'sla' in self.scenario_cfg and \ 'metrics' in self.scenario_cfg['sla']: for metric in self.scenario_cfg['sla']['metrics'].split(','): - assert metric in result, \ - '%s is not collected by VSPERF' % (metric) - assert metric in self.scenario_cfg['sla'], \ - '%s is not defined in SLA' % (metric) + self.verify_SLA(metric in result, + '%s was not collected by VSPERF' % metric) + self.verify_SLA(metric in self.scenario_cfg['sla'], + '%s is not defined in SLA' % metric) vs_res = float(result[metric]) sla_res = float(self.scenario_cfg['sla'][metric]) - assert vs_res >= sla_res, \ - 'VSPERF_%s(%f) < SLA_%s(%f)' % \ - (metric, vs_res, metric, sla_res) + self.verify_SLA(vs_res >= sla_res, + 'VSPERF_%s(%f) < SLA_%s(%f)' + % (metric, vs_res, metric, sla_res)) def teardown(self): """cleanup after the test execution""" |