aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/test_ssh.py
diff options
context:
space:
mode:
authorJingLu5 <lvjing5@huawei.com>2017-12-25 01:47:16 +0000
committerJingLu5 <lvjing5@huawei.com>2017-12-25 01:55:52 +0000
commit363185dfe9153a67892be8544fb4b5bf8709fbbc (patch)
tree13eaaa007a84a2c8afb02807050b30ab2143618f /tests/unit/test_ssh.py
parent3984c976967e3d697473cd3bb85204577a838dcd (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 'tests/unit/test_ssh.py')
-rw-r--r--tests/unit/test_ssh.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/unit/test_ssh.py b/tests/unit/test_ssh.py
index b298c745b..88699fd85 100644
--- a/tests/unit/test_ssh.py
+++ b/tests/unit/test_ssh.py
@@ -546,6 +546,15 @@ class TestAutoConnectSSH(unittest.TestCase):
with mock_scp_client_type() as mock_scp_client:
self.assertEqual(mock_scp_client.put.call_count, 1)
+ @mock.patch('yardstick.ssh.SCPClient')
+ def test_get(self, mock_scp_client_type):
+ auto_connect_ssh = AutoConnectSSH('user1', 'host1')
+ auto_connect_ssh._client = mock.Mock()
+
+ auto_connect_ssh.get('a', 'z')
+ with mock_scp_client_type() as mock_scp_client:
+ self.assertEqual(mock_scp_client.get.call_count, 1)
+
def test_put_file(self):
auto_connect_ssh = AutoConnectSSH('user1', 'host1')
auto_connect_ssh._client = mock.Mock()