Merge "Skip prometheus listener tests in case of TungstenFabric" into mcp/epoxy
diff --git a/octavia_tempest_plugin/tests/act_stdby_scenario/v2/test_active_standby.py b/octavia_tempest_plugin/tests/act_stdby_scenario/v2/test_active_standby.py
index 66cb59b..678ed81 100644
--- a/octavia_tempest_plugin/tests/act_stdby_scenario/v2/test_active_standby.py
+++ b/octavia_tempest_plugin/tests/act_stdby_scenario/v2/test_active_standby.py
@@ -63,6 +63,16 @@
             cls.mem_lb_client.cleanup_loadbalancer,
             cls.lb_id)
 
+        # (gzimin): Add additional waiter in case of TungstenFabric
+        # because for correct assignment of Floating IP for loadbalancer
+        # we need to wait for amphora port
+        if config.is_tungstenfabric_backend_enabled():
+            waiters.wait_for_status(cls.mem_lb_client.show_loadbalancer,
+                                    cls.lb_id, const.PROVISIONING_STATUS,
+                                    const.ACTIVE,
+                                    CONF.load_balancer.lb_build_interval,
+                                    CONF.load_balancer.lb_build_timeout)
+
         if CONF.validation.connect_method == 'floating':
             port_id = lb[const.VIP_PORT_ID]
             result = cls.lb_mem_float_ip_client.create_floatingip(
diff --git a/octavia_tempest_plugin/tests/api/v2/test_amphora.py b/octavia_tempest_plugin/tests/api/v2/test_amphora.py
index 06f93ac..af0b33b 100644
--- a/octavia_tempest_plugin/tests/api/v2/test_amphora.py
+++ b/octavia_tempest_plugin/tests/api/v2/test_amphora.py
@@ -105,9 +105,9 @@
         # Test filtering by loadbalancer_id
         amphorae = self.lb_admin_amphora_client.list_amphorae(
             query_params='{loadbalancer_id}={lb_id}'.format(
-                loadbalancer_id=const.LOADBALANCER_ID, lb_id=self.lb_id))
+                loadbalancer_id=const.LOADBALANCER_ID, lb_id=lb_id))
         self.assertEqual(self._expected_amp_count(amphorae), len(amphorae))
-        self.assertEqual(self.lb_id, amphorae[0][const.LOADBALANCER_ID])
+        self.assertEqual(lb_id, amphorae[0][const.LOADBALANCER_ID])
 
         # Test RBAC for show amphora
         if expected_allowed:
@@ -218,6 +218,11 @@
 
         for new_amp in after_amphorae:
             self.assertNotEqual(amphora_1[const.ID], new_amp[const.ID])
+            waiters.wait_for_status(self.lb_admin_amphora_client.show_amphora,
+                                    new_amp[const.ID], const.STATUS,
+                                    const.STATUS_ALLOCATED,
+                                    CONF.load_balancer.build_interval,
+                                    CONF.load_balancer.build_timeout)
 
     @testtools.skipIf(CONF.load_balancer.test_with_noop,
                       'Log offload tests will not work in noop mode.')
diff --git a/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py b/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py
index 7938c31..2365517 100644
--- a/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py
+++ b/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py
@@ -301,6 +301,7 @@
             CONF.load_balancer.check_interval,
             CONF.load_balancer.check_timeout)
 
+    @decorators.attr(type='smoke')
     @decorators.idempotent_id('887ece26-0f7b-4933-89ab-5bb00b106ee0')
     def test_basic_tls_traffic(self):
 
diff --git a/octavia_tempest_plugin/tests/scenario/v2/test_traffic_ops.py b/octavia_tempest_plugin/tests/scenario/v2/test_traffic_ops.py
index a3f6313..c984f04 100644
--- a/octavia_tempest_plugin/tests/scenario/v2/test_traffic_ops.py
+++ b/octavia_tempest_plugin/tests/scenario/v2/test_traffic_ops.py
@@ -1482,6 +1482,8 @@
             number_of_retries=3),
             'Failed - all UDP retries to LB VIP has failed')
 
+    @testtools.skipIf(CONF.load_balancer.provider == 'tungstenfabric',
+                      "Not supported by TungstenFabric")
     @decorators.attr(type='slow')
     @decorators.idempotent_id('cd5aeefa-0e16-11eb-b8dc-74e5f9e2a801')
     def test_hm_op_status_changed_as_expected_on_update(self):
diff --git a/octavia_tempest_plugin/tests/waiters.py b/octavia_tempest_plugin/tests/waiters.py
index 820831a..7cd9fef 100644
--- a/octavia_tempest_plugin/tests/waiters.py
+++ b/octavia_tempest_plugin/tests/waiters.py
@@ -76,8 +76,8 @@
             if caller:
                 message = '({caller}) {message}'.format(caller=caller,
                                                         message=message)
-            raise exceptions.UnexpectedResponseCode(message)
-
+            if not error_ok:
+                raise exceptions.UnexpectedResponseCode(message)
         if int(time.time()) - start >= check_timeout:
             message = (
                 '{name} {field} failed to update to {expected_status} within '
@@ -165,7 +165,7 @@
             LOG.info('%s\'s status updated to DELETED.',
                      show_client.__name__)
             return
-        elif int(time.time()) - start >= check_timeout:
+        if int(time.time()) - start >= check_timeout:
             message = (
                 '{name} {field} failed to update to DELETED or become not '
                 'found (404) within the required time {timeout}. Current '