diff options
Diffstat (limited to 'yardstick/benchmark/scenarios/networking/pktgen.py')
-rw-r--r-- | yardstick/benchmark/scenarios/networking/pktgen.py | 14 |
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''' |