Log port details when FloatingIP port details test fails

In case when port status is not transitioned to DOWN in
test_floatingip.FloatingIPPortDetailsTest tests, log of
all port info can be useful for further debugging.

Change-Id: I0ba1efea68e6e53bd7df9bf84ecb3d73e95925ca
Related-bug: #1815585
This commit is contained in:
Slawek Kaplonski 2019-02-25 12:02:49 +01:00
parent 7eb6725c80
commit 7451ad7fe0
1 changed files with 4 additions and 2 deletions

View File

@ -310,10 +310,12 @@ class FloatingIPPortDetailsTest(FloatingIpTestCasesMixin,
timed_out = int(time.time()) - start >= timeout
if status != lib_constants.PORT_STATUS_DOWN and timed_out:
port_id = fip.get("port_id")
port = self.os_admin.network_client.show_port(port_id)['port']
message = ('Floating IP %s attached port status failed to '
'transition to DOWN (current status %s) within '
'the required time (%s s).' %
(fip_id, status, timeout))
'the required time (%s s). Port details: %s' %
(fip_id, status, timeout, port))
raise exceptions.TimeoutException(message)
return fip