Decoupling prepare_env.sh and load_images.sh
[yardstick.git] / tests / unit / test_ssh.py
index 4260b39..a270524 100644 (file)
@@ -108,7 +108,9 @@ class SSHTestCase(unittest.TestCase):
             mock.call.set_missing_host_key_policy("autoadd"),
             mock.call.connect("example.net", username="admin",
                               port=22, pkey="key", key_filename=None,
-                              password=None, timeout=1),
+                              password=None,
+                              allow_agent=False, look_for_keys=False,
+                              timeout=1),
         ]
         self.assertEqual(client_calls, client.mock_calls)
 
@@ -156,6 +158,15 @@ class SSHTestCase(unittest.TestCase):
         self.assertEqual([mock.call("uname")] * 3,
                          self.test_client.execute.mock_calls)
 
+    @mock.patch("yardstick.ssh.paramiko")
+    def test_send_command(self, mock_paramiko):
+        paramiko_sshclient = self.test_client._get_client()
+        with mock.patch.object(paramiko_sshclient, "exec_command") \
+            as mock_paramiko_exec_command:
+            self.test_client.send_command('cmd')
+        mock_paramiko_exec_command.assert_called_once_with('cmd',
+                                                            get_pty=True)
+
 
 class SSHRunTestCase(unittest.TestCase):
     """Test SSH.run method in different aspects.