summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrexlee8776 <limingjiang@huawei.com>2016-07-06 04:09:24 +0000
committerrexlee8776 <limingjiang@huawei.com>2016-07-06 04:09:24 +0000
commitf3c77d013c0d2662316edcb671204a813aa40544 (patch)
tree90ba1c75b61306741fee1ea30fccfb1eee4dac81
parent12f7ee47f39091be7b139f9bc083dbc675099937 (diff)
fix the ssh bug when run tc043 in CI
Change-Id: I93ffe038ee128976db001e4f2ece79366aa3826c Signed-off-by: rexlee8776 <limingjiang@huawei.com>
-rw-r--r--yardstick/benchmark/scenarios/networking/ping.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/yardstick/benchmark/scenarios/networking/ping.py b/yardstick/benchmark/scenarios/networking/ping.py
index 3af354850..08755a08b 100644
--- a/yardstick/benchmark/scenarios/networking/ping.py
+++ b/yardstick/benchmark/scenarios/networking/ping.py
@@ -41,11 +41,17 @@ class Ping(base.Scenario):
user = host.get('user', 'ubuntu')
ip = host.get('ip', None)
key_filename = host.get('key_filename', '/root/.ssh/id_rsa')
- password = host.get('password', 'root')
+ password = host.get('password', None)
+
+ if password is not None:
+ LOG.info("Log in via pw, user:%s, host:%s, pw:%s",
+ user, ip, password)
+ self.connection = ssh.SSH(user, ip, password=password)
+ else:
+ LOG.info("Log in via key, user:%s, host:%s, key_filename:%s",
+ user, ip, key_filename)
+ self.connection = ssh.SSH(user, ip, key_filename=key_filename)
- LOG.info("user:%s, host:%s, key_filename:%s", user, ip, key_filename)
- self.connection = ssh.SSH(user, ip, key_filename=key_filename,
- password=password)
self.connection.wait()
def run(self, result):