Extend network debug infos on network failures

After the https://review.openstack.org/#/c/76640/ is merge tempest will
be allowed to dump the ovs db.

The ovs db dump can help in identifying trunk/access port miss configuration
issues.

Change-Id: Ia751dc5046ce07369b9044eda3b20c63d38bac99
This commit is contained in:
Attila Fazekas 2014-02-26 21:25:53 +01:00
parent 131338e334
commit 6bfd6497c4
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

@ -199,7 +199,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):
@ -231,7 +231,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

@ -366,7 +366,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):