X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fbenchmark%2Fscenarios%2Fnetworking%2Fvsperf.py;h=f2c2ea9b8f9affa48ce3b4cd26c08126f18b0008;hb=1025a5d703cec7a479f7644dc916dfa82a84ffaf;hp=39912a95a17ee58c03c5344688375e03ee6d294a;hpb=65e770afb564045d647abe2bdc2892ebe1130015;p=yardstick.git diff --git a/yardstick/benchmark/scenarios/networking/vsperf.py b/yardstick/benchmark/scenarios/networking/vsperf.py index 39912a95a..f2c2ea9b8 100644 --- a/yardstick/benchmark/scenarios/networking/vsperf.py +++ b/yardstick/benchmark/scenarios/networking/vsperf.py @@ -13,6 +13,7 @@ # limitations under the License. """ Vsperf specific scenario definition """ +from __future__ import absolute_import import logging import os import subprocess @@ -111,7 +112,7 @@ class Vsperf(base.Scenario): None) def setup(self): - '''scenario setup''' + """scenario setup""" vsperf = self.context_cfg['host'] vsperf_user = vsperf.get('user', 'ubuntu') vsperf_ssh_port = vsperf.get('ssh_port', ssh.DEFAULT_PORT) @@ -133,10 +134,8 @@ class Vsperf(base.Scenario): # traffic generation could last long self.client.wait(timeout=1800) - # copy script to host if needed - if self.vsperf_conf: - self.client.run("cat > ~/vsperf.conf", - stdin=open(self.vsperf_conf, "rb")) + # copy script to host + self.client._put_file_shell(self.vsperf_conf, '~/vsperf.conf') # execute external setup script if self.setup_script: @@ -213,7 +212,7 @@ class Vsperf(base.Scenario): # convert result.csv to JSON format reader = csv.DictReader(stdout.split('\r\n')) - result.update(reader.next()) + result.update(next(reader)) # sla check; go through all defined SLAs and check if values measured # by VSPERF are higher then those defined by SLAs