summaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/networking/ping.py
diff options
context:
space:
mode:
authorrexlee8776 <limingjiang@huawei.com>2017-07-05 02:50:06 +0000
committerrexlee8776 <limingjiang@huawei.com>2017-07-06 07:49:10 +0000
commit25a37b2048281c64719bd6ad67860f65f6c31546 (patch)
tree726e1ff64ea3470ab6b91db8fdbc386383f08903 /yardstick/benchmark/scenarios/networking/ping.py
parent3369461d0e51b22aa96e5bfd0d80b3f0f7f82c67 (diff)
move flatten dict key to common utils
So it can easily be used by other testcase to unify result JIRA: YARDSTICK-702 Change-Id: Id4fde38a9a0c2a87a6c870bdb7b0c8f3a3b371ac Signed-off-by: rexlee8776 <limingjiang@huawei.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/networking/ping.py')
-rw-r--r--yardstick/benchmark/scenarios/networking/ping.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/yardstick/benchmark/scenarios/networking/ping.py b/yardstick/benchmark/scenarios/networking/ping.py
index a929e5337..6a7927de4 100644
--- a/yardstick/benchmark/scenarios/networking/ping.py
+++ b/yardstick/benchmark/scenarios/networking/ping.py
@@ -15,6 +15,7 @@ import pkg_resources
import logging
import yardstick.ssh as ssh
+from yardstick.common import utils
from yardstick.benchmark.scenarios import base
LOG = logging.getLogger(__name__)
@@ -57,8 +58,8 @@ class Ping(base.Scenario):
destination = self.context_cfg['target'].get('ipaddr', '127.0.0.1')
dest_list = [s.strip() for s in destination.split(',')]
- result["rtt"] = {}
- rtt_result = result["rtt"]
+ rtt_result = {}
+ ping_result = {"rtt": rtt_result}
for pos, dest in enumerate(dest_list):
if 'targets' in self.scenario_cfg:
@@ -88,6 +89,7 @@ class Ping(base.Scenario):
(rtt_result[target_vm_name], sla_max_rtt)
else:
LOG.error("ping '%s' '%s' timeout", options, target_vm)
+ result.update(utils.flatten_dict_key(ping_result))
def _test(): # pragma: no cover