# iperf3 scenario
# iperf3 homepage at: http://software.es.net/iperf/
+from __future__ import absolute_import
+from __future__ import print_function
+
import logging
-import json
+
import pkg_resources
+from oslo_serialization import jsonutils
import yardstick.ssh as ssh
from yardstick.benchmark.scenarios import base
self.host.close()
status, stdout, stderr = self.target.execute("pkill iperf3")
if status:
- LOG.warn(stderr)
+ LOG.warning(stderr)
self.target.close()
def run(self, result):
# Note: convert all ints to floats in order to avoid
# schema conflicts in influxdb. We probably should add
# a format func in the future.
- result.update(json.loads(stdout, parse_int=float))
+ result.update(
+ jsonutils.loads(stdout, parse_int=float))
if "sla" in self.scenario_cfg:
sla_iperf = self.scenario_cfg["sla"]
def _test():
- '''internal test function'''
+ """internal test function"""
key_filename = pkg_resources.resource_filename('yardstick.resources',
'files/yardstick_key')
ctx = {
p = Iperf(args, ctx)
p.run(result)
- print result
+ print(result)
+
if __name__ == '__main__':
_test()