Log amphora console if lb is failed reach ACTIVE
Try getting amphora's console logs if loadbalancer is not ACTIVE.
Related-PRODX: PRODX-54342
Change-Id: Ida3bd8222cccf56900a86d6b3821fc42e50d57f7
(cherry picked from commit 00d913e84aae66b9c59a3ad3226dca0a92d7aab9)
diff --git a/octavia_tempest_plugin/tests/test_base.py b/octavia_tempest_plugin/tests/test_base.py
index 872b9f9..6e0efa2 100644
--- a/octavia_tempest_plugin/tests/test_base.py
+++ b/octavia_tempest_plugin/tests/test_base.py
@@ -710,6 +710,36 @@
port = port + 1
return port
+ @classmethod
+ def wait_for_status(cls, show_client, id, status_key, status,
+ check_interval, check_timeout,
+ root_tag=None, error_ok=False,
+ **kwargs):
+ try:
+ return waiters.wait_for_status(
+ show_client, id, status_key, status,
+ check_interval, check_timeout,
+ root_tag=root_tag,
+ error_ok=error_ok, **kwargs)
+ except exceptions.TimeoutException:
+ amphoras = cls.lb_admin_amphora_client.list_amphorae(
+ query_params='{loadbalancer_id}={lb_id}'.format(
+ loadbalancer_id=const.LOADBALANCER_ID, lb_id=id))
+ servers = [{'id': amp[const.COMPUTE_ID]} for amp in amphoras]
+ if servers and not CONF.compute_feature_enabled.console_output:
+ LOG.debug('Console output not supported, cannot log')
+ raise
+ for server in servers:
+ try:
+ output = cls.os_admin_servers_client.get_console_output(
+ server['id'], **kwargs)['output']
+ LOG.debug('Console output for %s\nbody=\n%s',
+ server['id'], output)
+ except exceptions.NotFound:
+ LOG.debug("Server %s disappeared(deleted) while looking "
+ "for the console log", server['id'])
+ raise
+
class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest):
@classmethod