Fix RemoteClient usage in scenario tests
Some scenario tests use the following patter to work with RemoteClient:
client = self.get_remote_client(ip,
private_key=keypair.private_key)
return client.ssh_client
ssh_client is directly accessed because exec_command method
is not directly available in RemoteClient
In order to preserve encapsulation, RemoteClient should be improved to
expose that method.
Change-Id: I054762d769d002b5fb45c871d85a8ca8ff294695
Closes-Bug: #1285539
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 9a250d7..9803664 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -101,14 +101,13 @@
ip = server.networks[network_name_for_ssh][0]
try:
- client = self.get_remote_client(
+ return self.get_remote_client(
ip,
private_key=keypair.private_key)
except Exception:
LOG.exception('ssh to server failed')
self._log_console_output()
raise
- return client.ssh_client
def _get_content(self, ssh_client):
return ssh_client.exec_command('cat /tmp/text')