SSH connection related cleanups
Catching only the SSHException the AuthenticationException is
a subclass of the SSHException in the ssh.py.
test_connection_auth method changed to exception raiser method, in order
to avid unwanted catch-and-raise-new-exception code from the
RemoteClient.
Use similar ssh connectivity check with the test_network_basic_ops,
as with all other test cases, so using the implicit
connection validation of the RemoteClient.
Improve ssh connection logging by logging the reason of the connection
failure.
Change-Id: Ia2599f7f2c2fdc6fcbf7ad3337d82adcc50e4d16
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 5552d0b..e009888 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -67,7 +67,7 @@
# Verify that the user can authenticate with the new password
resp, server = self.client.get_server(self.server_id)
linux_client = RemoteClient(server, self.ssh_user, new_password)
- self.assertTrue(linux_client.can_authenticate())
+ linux_client.validate_authentication()
@attr(type='smoke')
def test_reboot_server_hard(self):
@@ -141,7 +141,7 @@
if self.run_ssh:
# Verify that the user can authenticate with the provided password
linux_client = RemoteClient(server, self.ssh_user, password)
- self.assertTrue(linux_client.can_authenticate())
+ linux_client.validate_authentication()
@attr(type='gate')
def test_rebuild_server_in_stop_state(self):