aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/networking/pktgen.py
diff options
context:
space:
mode:
authorhoujingwen <houjingwen@huawei.com>2015-10-19 15:37:06 +0800
committerHou Jingwen <houjingwen@huawei.com>2015-10-22 00:55:25 +0000
commite4e8688e0633ef22b2ff0ea8ba739313d5299ecc (patch)
tree0fee27d4e504b36e9eb24530cf85a0d33fd0b463 /yardstick/benchmark/scenarios/networking/pktgen.py
parent9816c5aa786f7ec831c549b8ed4b5e8ef485da64 (diff)
Update sla check for scenarios
This patch modify the question that SLA check result is not complete. JIRA: YARDSTICK-172 Change-Id: I10438390baee92caf00dbfcdbdb833823ff8ce31 Signed-off-by: houjingwen <houjingwen@huawei.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/networking/pktgen.py')
-rw-r--r--yardstick/benchmark/scenarios/networking/pktgen.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/yardstick/benchmark/scenarios/networking/pktgen.py b/yardstick/benchmark/scenarios/networking/pktgen.py
index cc28b514a..f373fd2ec 100644
--- a/yardstick/benchmark/scenarios/networking/pktgen.py
+++ b/yardstick/benchmark/scenarios/networking/pktgen.py
@@ -86,7 +86,7 @@ class Pktgen(base.Scenario):
raise RuntimeError(stderr)
return int(stdout)
- def run(self, args):
+ def run(self, args, result):
"""execute the benchmark"""
if not self.setup_done:
@@ -119,20 +119,18 @@ class Pktgen(base.Scenario):
if status:
raise RuntimeError(stderr)
- data = json.loads(stdout)
+ result.update(json.loads(stdout))
- data['packets_received'] = self._iptables_get_result()
+ result['packets_received'] = self._iptables_get_result()
if "sla" in args:
- sent = data['packets_sent']
- received = data['packets_received']
+ sent = result['packets_sent']
+ received = result['packets_received']
ppm = 1000000 * (sent - received) / sent
sla_max_ppm = int(args["sla"]["max_ppm"])
- assert ppm <= sla_max_ppm, "ppm %d > sla_max_ppm %d" \
+ assert ppm <= sla_max_ppm, "ppm %d > sla_max_ppm %d; " \
% (ppm, sla_max_ppm)
- return data
-
def _test():
'''internal test function'''