def _transfer_ping_script(self, ssh):
"""
Transfert vping script to VM.
Uses SCP to copy the ping script via the SSH client
:param ssh: the SSH client
:return:
"""
self.logger.info("Trying to transfer ping.sh")
scp = SCPClient(ssh.get_transport())
ping_script = pkg_resources.resource_filename(
'functest.opnfv_tests.openstack.vping', 'ping.sh')
try:
scp.put(ping_script, "~/")
except Exception: # pylint: disable=broad-except
self.logger.error("Cannot SCP the file '%s'", ping_script)
return False
cmd = 'chmod 755 ~/ping.sh'
# pylint: disable=unused-variable
(stdin, stdout, stderr) = ssh.exec_command(cmd)
for line in stdout.readlines():
print line
return True
评论列表
文章目录