diff options
author | JingLu5 <lvjing5@huawei.com> | 2017-12-25 01:47:16 +0000 |
---|---|---|
committer | JingLu5 <lvjing5@huawei.com> | 2017-12-25 01:55:52 +0000 |
commit | 363185dfe9153a67892be8544fb4b5bf8709fbbc (patch) | |
tree | 13eaaa007a84a2c8afb02807050b30ab2143618f /yardstick/ssh.py | |
parent | 3984c976967e3d697473cd3bb85204577a838dcd (diff) |
Add get function in ssh.py
JIRA: YARDSTICK-904
This task is about to implement a get function in ssh.py to
fetch desired files/folder in a remote VM to a local path.
In some test cases, test tools will produce results in files.
We want retain the original result files and archive them in
Yardstick docker for future usage.
Change-Id: Ifd333eb044ce31cffa6f5b2a8f6a46648a8858d1
Signed-off-by: JingLu5 <lvjing5@huawei.com>
Diffstat (limited to 'yardstick/ssh.py')
-rw-r--r-- | yardstick/ssh.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/yardstick/ssh.py b/yardstick/ssh.py index e98ee98b7..6ddf327f2 100644 --- a/yardstick/ssh.py +++ b/yardstick/ssh.py @@ -379,6 +379,12 @@ class SSH(object): with SCPClient(client.get_transport()) as scp: scp.put(files, remote_path, recursive) + def get(self, remote_path, local_path='/tmp/', recursive=True): + client = self._get_client() + + with SCPClient(client.get_transport()) as scp: + scp.get(remote_path, local_path, recursive) + # keep shell running in the background, e.g. screen def send_command(self, command): client = self._get_client() |