ssh fix, always wait 75/41875/3
authorRoss Brattain <ross.b.brattain@intel.com>
Wed, 13 Sep 2017 20:59:40 +0000 (13:59 -0700)
committerRoss Brattain <ross.b.brattain@intel.com>
Wed, 13 Sep 2017 23:18:29 +0000 (16:18 -0700)
Change-Id: I1c529eeb0ef47752ed15e3e7941f57f7793ebfd4
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py
tests/unit/test_ssh.py
yardstick/ssh.py

index 0264fac..478c6ec 100644 (file)
@@ -186,6 +186,7 @@ class TestVnfSshHelper(unittest.TestCase):
     @mock.patch('yardstick.ssh.paramiko')
     def test_upload_config_file(self, mock_paramiko):
         ssh_helper = VnfSshHelper(self.VNFD_0['mgmt-interface'], 'my/bin/path')
+        ssh_helper._run = mock.MagicMock()
 
         self.assertFalse(ssh_helper.is_connected)
         cfg_file = ssh_helper.upload_config_file('my/prefix', 'my content')
@@ -227,6 +228,7 @@ class TestVnfSshHelper(unittest.TestCase):
     @mock.patch('yardstick.ssh.provision_tool')
     def test_provision_tool(self, mock_provision_tool, mock_paramiko):
         ssh_helper = VnfSshHelper(self.VNFD_0['mgmt-interface'], 'my/bin/path')
+        ssh_helper._run = mock.MagicMock()
 
         self.assertFalse(ssh_helper.is_connected)
         ssh_helper.provision_tool()
index 27ed68c..b298c74 100644 (file)
@@ -527,7 +527,7 @@ class TestAutoConnectSSH(unittest.TestCase):
             'key_filename': None,
             'password': None,
             'name': None,
-            'wait': False,
+            'wait': True,
         }
         result = auto_connect_ssh._make_dict()
         self.assertDictEqual(result, expected)
index a024cf6..bb715e4 100644 (file)
@@ -432,8 +432,9 @@ class SSH(object):
 
 class AutoConnectSSH(SSH):
 
+    # always wait or we will get OpenStack SSH errors
     def __init__(self, user, host, port=None, pkey=None,
-                 key_filename=None, password=None, name=None, wait=False):
+                 key_filename=None, password=None, name=None, wait=True):
         super(AutoConnectSSH, self).__init__(user, host, port, pkey, key_filename, password, name)
         self._wait = wait