Add debugging information in case of SSH connection error
In case of SSH error, new debugging information is added to the log:
- The local routing table
- The local ARP table
Change-Id: Ibe83390402675bb7e7d3cc4909a8097de4b0f836
Related-Bug: #1858642
diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py
index 5a29aa1..7204a0b 100644
--- a/neutron_tempest_plugin/scenario/base.py
+++ b/neutron_tempest_plugin/scenario/base.py
@@ -26,6 +26,7 @@
from tempest.lib import exceptions as lib_exc
from neutron_tempest_plugin.api import base as base_api
+from neutron_tempest_plugin.common import ip as ip_utils
from neutron_tempest_plugin.common import shell
from neutron_tempest_plugin.common import ssh
from neutron_tempest_plugin import config
@@ -219,6 +220,7 @@
except lib_exc.SSHTimeout as ssh_e:
LOG.debug(ssh_e)
self._log_console_output(servers)
+ self._log_local_network_status()
raise
def _log_console_output(self, servers=None):
@@ -239,6 +241,12 @@
LOG.debug("Server %s disappeared(deleted) while looking "
"for the console log", server['id'])
+ def _log_local_network_status(self):
+ local_routes = ip_utils.IPCommand().list_routes()
+ LOG.debug('Local routes:\n%s', '\n'.join(str(r) for r in local_routes))
+ arp_table = ip_utils.arp_table()
+ LOG.debug('Local ARP table:\n%s', '\n'.join(str(r) for r in arp_table))
+
def _check_remote_connectivity(self, source, dest, count,
should_succeed=True,
nic=None, mtu=None, fragmentation=True,