Add timeout to check_connectivity method
Especially for negative tests, when connectivity loss is expected,
allowing the definition of a lower SSH timeout is needed, since default
value of 300 seconds is too high
Change-Id: Ifc9bc6c60d5d44e5524f6e1338eb3ceeb0a900a9
diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py
index f7e7ec8..35e5c31 100644
--- a/neutron_tempest_plugin/scenario/base.py
+++ b/neutron_tempest_plugin/scenario/base.py
@@ -259,8 +259,10 @@
'server']['id'])['ports'][0]
self.fip = self.create_floatingip(port=self.port)
- def check_connectivity(self, host, ssh_user, ssh_key, servers=None):
- ssh_client = ssh.Client(host, ssh_user, pkey=ssh_key)
+ def check_connectivity(self, host, ssh_user, ssh_key,
+ servers=None, ssh_timeout=None):
+ ssh_client = ssh.Client(host, ssh_user,
+ pkey=ssh_key, timeout=ssh_timeout)
try:
ssh_client.test_connection_auth()
except lib_exc.SSHTimeout as ssh_e: