Add iptables and listening sockets to debug info
The method "_log_local_network_status", used to print the system
information in case of error, is improved with new information:
- The local namespace iptables
- The local namespace listening sockets
This information could provide the needed info to investigate the
problem, related in the referred bug, when a VM cannot retrieve
the metadata information.
Change-Id: Id56743a07267b4b6c03e7b9b295f919668ac07ab
Related-Bug: #1923633
diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py
index 334d543..b96eac4 100644
--- a/neutron_tempest_plugin/scenario/base.py
+++ b/neutron_tempest_plugin/scenario/base.py
@@ -325,7 +325,9 @@
try:
local_ips = ip_utils.IPCommand(namespace=ns_name).list_addresses()
local_routes = ip_utils.IPCommand(namespace=ns_name).list_routes()
- arp_table = ip_utils.arp_table()
+ arp_table = ip_utils.arp_table(namespace=ns_name)
+ iptables = ip_utils.list_iptables(namespace=ns_name)
+ lsockets = ip_utils.list_listening_sockets(namespace=ns_name)
except exceptions.ShellCommandFailed:
LOG.debug('Namespace %s has been deleted synchronously during the '
'host network collection process', ns_name)
@@ -337,6 +339,8 @@
ns_name, '\n'.join(str(r) for r in local_routes))
LOG.debug('Namespace %s; Local ARP table:\n%s',
ns_name, '\n'.join(str(r) for r in arp_table))
+ LOG.debug('Namespace %s; Local iptables:\n%s', ns_name, iptables)
+ LOG.debug('Namespace %s; Listening sockets:\n%s', ns_name, lsockets)
def _check_remote_connectivity(self, source, dest, count,
should_succeed=True,