Merge "Reduce the number of load balancers in PoolAPITest"
diff --git a/octavia_tempest_plugin/tests/api/v2/test_pool.py b/octavia_tempest_plugin/tests/api/v2/test_pool.py
index ba31a8e..13a2285 100644
--- a/octavia_tempest_plugin/tests/api/v2/test_pool.py
+++ b/octavia_tempest_plugin/tests/api/v2/test_pool.py
@@ -434,6 +434,11 @@
message = e.resp_body.get('faultstring', message)
raise testtools.TestCase.skipException(message)
+ self.addCleanup(
+ self.mem_pool_client.cleanup_pool,
+ pool[const.ID],
+ lb_client=self.mem_lb_client, lb_id=self.lb_id)
+
waiters.wait_for_status(
self.mem_lb_client.show_loadbalancer, self.lb_id,
const.PROVISIONING_STATUS, const.ACTIVE,
@@ -584,7 +589,6 @@
def _test_pool_list(self, pool_protocol, algorithm):
"""Tests pool list API and field filtering.
- * Create a clean loadbalancer.
* Create three pools.
* Validates that other accounts cannot list the pools.
* List the pools using the default sort order.
@@ -605,14 +609,7 @@
'Skipping this test as load balancing algorithm '
'SOURCE_IP_PORT requires API version 2.13 or newer.')
- lb_name = data_utils.rand_name("lb_member_lb2_pool-list")
- lb = self.mem_lb_client.create_loadbalancer(
- name=lb_name, provider=CONF.load_balancer.provider,
- vip_network_id=self.lb_member_vip_net[const.ID])
- lb_id = lb[const.ID]
- self.addCleanup(
- self.mem_lb_client.cleanup_loadbalancer,
- lb_id)
+ lb_id = self.lb_id
waiters.wait_for_status(self.mem_lb_client.show_loadbalancer,
lb_id,
@@ -1080,6 +1077,11 @@
message = e.resp_body.get('faultstring', message)
raise testtools.TestCase.skipException(message)
+ self.addCleanup(
+ self.mem_pool_client.cleanup_pool,
+ pool[const.ID],
+ lb_client=self.mem_lb_client, lb_id=self.lb_id)
+
waiters.wait_for_status(
self.mem_lb_client.show_loadbalancer, self.lb_id,
const.PROVISIONING_STATUS, const.ACTIVE,
@@ -1315,6 +1317,11 @@
message = e.resp_body.get('faultstring', message)
raise testtools.TestCase.skipException(message)
+ self.addCleanup(
+ self.mem_pool_client.cleanup_pool,
+ pool[const.ID],
+ lb_client=self.mem_lb_client, lb_id=self.lb_id)
+
waiters.wait_for_status(
self.mem_lb_client.show_loadbalancer, self.lb_id,
const.PROVISIONING_STATUS, const.ACTIVE,
@@ -1647,6 +1654,11 @@
message = e.resp_body.get('faultstring', message)
raise testtools.TestCase.skipException(message)
+ self.addCleanup(
+ self.mem_pool_client.cleanup_pool,
+ pool[const.ID],
+ lb_client=self.mem_lb_client, lb_id=self.lb_id)
+
waiters.wait_for_status(
self.mem_lb_client.show_loadbalancer,
self.lb_id, const.PROVISIONING_STATUS,