X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fbenchmark%2Fscenarios%2Fnetworking%2Fpktgen_dpdk.py;h=0b70629f83e26d232d05b46f67dab27f294689a1;hb=8f91b0a5c1f47953dd1a14541b71505dbf8f869a;hp=189cc789568fa790277253c901a2f5babe621e9c;hpb=293a8ed0c22d7944c8fc671792683d45d3fa8d48;p=yardstick.git diff --git a/yardstick/benchmark/scenarios/networking/pktgen_dpdk.py b/yardstick/benchmark/scenarios/networking/pktgen_dpdk.py index 189cc7895..0b70629f8 100644 --- a/yardstick/benchmark/scenarios/networking/pktgen_dpdk.py +++ b/yardstick/benchmark/scenarios/networking/pktgen_dpdk.py @@ -6,6 +6,7 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +from __future__ import absolute_import import pkg_resources import logging import time @@ -36,7 +37,7 @@ class PktgenDPDKLatency(base.Scenario): self.setup_done = False def setup(self): - '''scenario setup''' + """scenario setup""" self.pktgen_dpdk_script = pkg_resources.resource_filename( 'yardstick.benchmark.scenarios.networking', PktgenDPDKLatency.PKTGEN_DPDK_SCRIPT) @@ -60,8 +61,7 @@ class PktgenDPDKLatency(base.Scenario): self.server.wait(timeout=600) # copy script to host - self.server.run("cat > ~/testpmd_fwd.sh", - stdin=open(self.testpmd_script, "rb")) + self.server._put_file_shell(self.testpmd_script, '~/testpmd_fwd.sh') LOG.info("user:%s, host:%s", host_user, host_ip) self.client = ssh.SSH(host_user, host_ip, @@ -70,8 +70,8 @@ class PktgenDPDKLatency(base.Scenario): self.client.wait(timeout=600) # copy script to host - self.client.run("cat > ~/pktgen_dpdk.sh", - stdin=open(self.pktgen_dpdk_script, "rb")) + self.client._put_file_shell( + self.pktgen_dpdk_script, '~/pktgen_dpdk.sh') self.setup_done = True self.testpmd_args = '' @@ -153,7 +153,7 @@ class PktgenDPDKLatency(base.Scenario): latency_sum = 0 for i in latency_list: latency_sum += int(i) - avg_latency = latency_sum/len(latency_list) + avg_latency = latency_sum / len(latency_list) result.update({"avg_latency": avg_latency})