Merge "Reduce the number of load balancers in PoolAPITest"

This commit is contained in:
Zuul 2023-03-03 13:13:20 +00:00 committed by Gerrit Code Review
commit 5b73479a4d
1 changed files with 21 additions and 9 deletions

View File

@ -434,6 +434,11 @@ class PoolAPITest(test_base.LoadBalancerBaseTest):
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 @@ class PoolAPITest(test_base.LoadBalancerBaseTest):
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 @@ class PoolAPITest(test_base.LoadBalancerBaseTest):
'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 @@ class PoolAPITest(test_base.LoadBalancerBaseTest):
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 @@ class PoolAPITest(test_base.LoadBalancerBaseTest):
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 @@ class PoolAPITest(test_base.LoadBalancerBaseTest):
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,