Patch to fix test_amphora_update using the unique load balancer
The test `test_amphora_update` got amphorae of the load balancer that
was created by the class-based resource setup, but they wouldn't be in
ALLOCATED state after the destructive test 'test_amphora_failover'.
So I've decided to use the function-based load balancer and its amphorae.
Related-prod: PRODX-17935
Change-Id: I58fc8add761d79af1377bb5b0e964697d78ab36a
(cherry picked from commit a18615a98c95a62205383cae5c7d58e8c52913bc)
diff --git a/octavia_tempest_plugin/tests/api/v2/test_amphora.py b/octavia_tempest_plugin/tests/api/v2/test_amphora.py
index 67e2565..65d4fe5 100644
--- a/octavia_tempest_plugin/tests/api/v2/test_amphora.py
+++ b/octavia_tempest_plugin/tests/api/v2/test_amphora.py
@@ -172,9 +172,23 @@
raise self.skipException('Amphora update is only available on '
'Octavia API version 2.7 or newer.')
+ lb_name = data_utils.rand_name("lb_member_lb2_amphora-update")
+ 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)
+
+ waiters.wait_for_status(self.mem_lb_client.show_loadbalancer,
+ lb_id,
+ const.PROVISIONING_STATUS,
+ const.ACTIVE,
+ CONF.load_balancer.lb_build_interval,
+ CONF.load_balancer.lb_build_timeout)
+
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))
amphora_1 = amphorae[0]
# Test RBAC for update an amphora