Define new test_endpoints_object_removal config option

There are some old kuryr-kubernetes versions that don't
support LB pool members removal upon endpoint deletion.
For such cases, and in order to be able to run the test
test_service_without_selector for all the versions, a
new configuration option test_endpoints_object_removal
is defined.

It's expected to set test_endpoints_object_removal to
False in those environments where the removal is not
supported, and keep it to the default True value in
the rest of them.

Change-Id: I8c2d6e8e66d707fcf22311456c0584a6167acea1
This commit is contained in:
Jon Uriarte 2022-01-13 12:29:19 +00:00
parent d9a93bcba9
commit 635cf80fc5
2 changed files with 9 additions and 5 deletions

View File

@ -96,6 +96,9 @@ kuryr_k8s_opts = [
cfg.BoolOpt("test_services_without_selector", default=False,
help="Whether or not service without selector tests will be "
"running"),
cfg.BoolOpt("test_endpoints_object_removal", default=True,
help="Whether to check that LB members are deleted upon "
"endpoints object removal or not"),
cfg.BoolOpt("test_configurable_listener_timeouts", default=False,
help="Whether or not listener timeout values are "
"configurable"),

View File

@ -156,12 +156,13 @@ class TestServiceWithoutSelectorScenario(base.BaseKuryrScenarioTest):
pool_query = "loadbalancer_id=%s" % klb_crd_id
pool = self.wait_for_status(timeout, 15, self.pool_client.list_pools,
query_params=pool_query)
pool_id = pool[0].get('id')
# Check that there no pool members after endpoint deletion
self.delete_endpoint(ep_name=self.endpoint.metadata.name,
namespace=ns_name)
self.check_lb_members(pool_id, 0)
if CONF.kuryr_kubernetes.test_endpoints_object_removal:
# Check that there are no pool members after endpoint deletion
pool_id = pool[0].get('id')
self.delete_endpoint(ep_name=self.endpoint.metadata.name,
namespace=ns_name)
self.check_lb_members(pool_id, 0)
class TestSCTPServiceScenario(base.BaseKuryrScenarioTest):