Merge "Extend network debug infos on network failures"

This commit is contained in:
Jenkins 2014-03-13 15:15:10 +00:00 committed by Gerrit Code Review
commit 0748dcace8
5 changed files with 20 additions and 4 deletions

View File

@ -73,3 +73,7 @@ def ip_ns_route(ns):
def iptables_ns(ns, table):
return ip_ns_exec(ns, "iptables -v -S -t " + table)
def ovs_db_dump():
return sudo_cmd_call("ovsdb-client dump")

View File

@ -38,3 +38,15 @@ def log_ip_ns():
for table in ['filter', 'nat', 'mangle']:
LOG.info('ns(%s) table(%s):\n%s', ns, table,
commands.iptables_ns(ns, table))
def log_ovs_db():
if not CONF.debug.enable or not CONF.service_available.neutron:
return
db_dump = commands.ovs_db_dump()
LOG.info("OVS DB:\n" + db_dump)
def log_net_debug():
log_ip_ns()
log_ovs_db()

View File

@ -97,7 +97,7 @@ class TestMinimumBasicScenario(manager.OfficialClientTest):
except Exception:
LOG.exception('ssh to server failed')
self._log_console_output()
debug.log_ip_ns()
debug.log_net_debug()
raise
def check_partitions(self):

View File

@ -172,7 +172,7 @@ class TestNetworkBasicOps(manager.NetworkScenarioTest):
except Exception:
LOG.exception('Tenant connectivity check failed')
self._log_console_output(servers=self.servers.keys())
debug.log_ip_ns()
debug.log_net_debug()
raise
def _create_and_associate_floating_ips(self):
@ -204,7 +204,7 @@ class TestNetworkBasicOps(manager.NetworkScenarioTest):
ex_msg += ": " + msg
LOG.exception(ex_msg)
self._log_console_output(servers=self.servers.keys())
debug.log_ip_ns()
debug.log_net_debug()
raise
def _disassociate_floating_ips(self):

View File

@ -343,7 +343,7 @@ class TestSecurityGroupsBasicOps(manager.NetworkScenarioTest):
should_succeed),
msg)
except Exception:
debug.log_ip_ns()
debug.log_net_debug()
raise
def _test_in_tenant_block(self, tenant):