Merge "[TF] Add support of tungstenfabric driver for octavia" into mcp/caracal
diff --git a/octavia_tempest_plugin/config.py b/octavia_tempest_plugin/config.py
index 9e259d3..58ddf13 100644
--- a/octavia_tempest_plugin/config.py
+++ b/octavia_tempest_plugin/config.py
@@ -294,6 +294,9 @@
"specified in the tempest configuration."),
cfg.BoolOpt('prometheus_listener_enabled', default=True,
help="Whether the PROMETHEUS listener tests will run."),
+ cfg.BoolOpt('force_cleanup_enabled',
+ default=False,
+ help="Whether to delete loadbalancers with force on cleanup."),
]
# Extending this enforce_scope group defined in tempest
diff --git a/octavia_tempest_plugin/services/load_balancer/v2/base_client.py b/octavia_tempest_plugin/services/load_balancer/v2/base_client.py
index bf08c5a..5e2298c 100644
--- a/octavia_tempest_plugin/services/load_balancer/v2/base_client.py
+++ b/octavia_tempest_plugin/services/load_balancer/v2/base_client.py
@@ -419,10 +419,18 @@
LOG.error("Cleanup encountered an unknown exception while waiting "
"for %s %s: %s", wait_client.root_tag, wait_id, e)
- if cascade:
- uri = '{0}/{1}?cascade=true'.format(uri, obj_id)
- else:
- uri = '{0}/{1}'.format(uri, obj_id)
+ uri = "{0}/{1}".format(uri, obj_id)
+ query_params = {"cascade": cascade}
+ if (
+ CONF.loadbalancer_feature_enabled.force_cleanup_enabled
+ and self.root_tag == const.LOADBALANCER
+ ):
+ query_params.update({"force": True, "cascade": True})
+ query_string = "&".join(
+ [f"{k}={v}" for k, v in query_params.items() if v]
+ )
+ if query_string:
+ uri += f"?{query_string}"
LOG.info("Cleaning up %s %s...", self.root_tag, obj_id)
return_status = test_utils.call_and_ignore_notfound_exc(
self.delete, uri)
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 45d125b..c03d7df 100644
--- a/octavia_tempest_plugin/tests/scenario/v2/test_traffic_ops.py
+++ b/octavia_tempest_plugin/tests/scenario/v2/test_traffic_ops.py
@@ -1123,17 +1123,17 @@
@decorators.idempotent_id('04399db0-04f0-4cb5-bb27-a12bf18bfe08')
def test_http_LC_listener_with_allowed_cidrs(self):
self._test_listener_with_allowed_cidrs(
- const.HTTP, 90, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ const.HTTP, 90, const.LB_ALGORITHM_LEAST_CONNECTIONS, delay=1)
@decorators.idempotent_id('3d8d95b6-55e8-4bb9-b474-4ac35abaff22')
def test_tcp_LC_listener_with_allowed_cidrs(self):
self._test_listener_with_allowed_cidrs(
- const.TCP, 91, const.LB_ALGORITHM_LEAST_CONNECTIONS, delay=0.2)
+ const.TCP, 91, const.LB_ALGORITHM_LEAST_CONNECTIONS, delay=1)
@decorators.idempotent_id('7456b558-9add-4e0e-988e-06803f8047f7')
def test_udp_LC_listener_with_allowed_cidrs(self):
self._test_listener_with_allowed_cidrs(
- const.UDP, 92, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ const.UDP, 92, const.LB_ALGORITHM_LEAST_CONNECTIONS, delay=1)
@decorators.idempotent_id('13b0f2de-9934-457b-8be0-f1bffc6915a0')
def test_http_RR_listener_with_allowed_cidrs(self):