X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=yardstick%2Fbenchmark%2Fscenarios%2Fnetworking%2Fpktgen.py;h=e6aa7e5fb04be76ff8461be793aaf9efe1ec0bf7;hb=07249e010dd9837d63f3090f1eac0fc6763b968f;hp=b61337a70fad1154e61fc5d54862021c26ba4336;hpb=61c9612197d9a204cc7efa0a324a2b136886506f;p=yardstick.git diff --git a/yardstick/benchmark/scenarios/networking/pktgen.py b/yardstick/benchmark/scenarios/networking/pktgen.py index b61337a70..e6aa7e5fb 100644 --- a/yardstick/benchmark/scenarios/networking/pktgen.py +++ b/yardstick/benchmark/scenarios/networking/pktgen.py @@ -52,26 +52,14 @@ class Pktgen(base.Scenario): 'yardstick.benchmark.scenarios.networking', Pktgen.TARGET_SCRIPT) host = self.context_cfg['host'] - host_user = host.get('user', 'ubuntu') - host_ssh_port = host.get('ssh_port', ssh.DEFAULT_PORT) - host_ip = host.get('ip', None) - host_key_filename = host.get('key_filename', '~/.ssh/id_rsa') target = self.context_cfg['target'] - target_user = target.get('user', 'ubuntu') - target_ssh_port = target.get('ssh_port', ssh.DEFAULT_PORT) - target_ip = target.get('ip', None) - target_key_filename = target.get('key_filename', '~/.ssh/id_rsa') - - LOG.info("user:%s, target:%s", target_user, target_ip) - self.server = ssh.SSH(target_user, target_ip, - key_filename=target_key_filename, - port=target_ssh_port) + + LOG.info("user:%s, target:%s", target['user'], target['ip']) + self.server = ssh.SSH.from_node(target, defaults={"user": "ubuntu"}) self.server.wait(timeout=600) - LOG.info("user:%s, host:%s", host_user, host_ip) - self.client = ssh.SSH(host_user, host_ip, - key_filename=host_key_filename, - port=host_ssh_port) + LOG.info("user:%s, host:%s", host['user'], host['ip']) + self.client = ssh.SSH.from_node(host, defaults={"user": "ubuntu"}) self.client.wait(timeout=600) # copy script to host @@ -137,6 +125,7 @@ class Pktgen(base.Scenario): result.update(jsonutils.loads(stdout)) result['packets_received'] = self._iptables_get_result() + result['packetsize'] = packetsize if "sla" in self.scenario_cfg: sent = result['packets_sent']