Log VM console output in remote_connectivity_check
If remote connectivity check fails because of SSH issue or
becasuse of assertion error, console output from instances used
for test will now be logged as it is useful for debugging such
failed tests.
It is similar to what was already done in check_connectivity() method.
Change-Id: I0fb95efd09881492b8e39d5e114b42c1bd944e57
diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py
index 2bb6344..0a2fa14 100644
--- a/neutron_tempest_plugin/scenario/base.py
+++ b/neutron_tempest_plugin/scenario/base.py
@@ -302,9 +302,18 @@
1)
def check_remote_connectivity(self, source, dest, should_succeed=True,
- nic=None, mtu=None, fragmentation=True):
- self.assertTrue(self._check_remote_connectivity(
- source, dest, should_succeed, nic, mtu, fragmentation))
+ nic=None, mtu=None, fragmentation=True,
+ servers=None):
+ try:
+ self.assertTrue(self._check_remote_connectivity(
+ source, dest, should_succeed, nic, mtu, fragmentation))
+ except lib_exc.SSHTimeout as ssh_e:
+ LOG.debug(ssh_e)
+ self._log_console_output(servers)
+ raise
+ except AssertionError:
+ self._log_console_output(servers)
+ raise
def ping_ip_address(self, ip_address, should_succeed=True,
ping_timeout=None, mtu=None):