Add config option for pool algorithms
There is at least one provider driver that does not currently support any other pool algorithm than round-robin. This patch adds a new option that allows one to toggle enablement of pool algorithms (default is True/enabled). Change-Id: I11e1569f91fe66a6bc735a1abd7b1545ca1490a0
This commit is contained in:
parent
1f0f4ef028
commit
e36262d197
|
@ -167,18 +167,22 @@ lb_feature_enabled_group = cfg.OptGroup(name='loadbalancer-feature-enabled',
|
|||
LBFeatureEnabledGroup = [
|
||||
cfg.BoolOpt('health_monitor_enabled',
|
||||
default=True,
|
||||
help="Whether Health Monitor is available with provider"
|
||||
" driver or not."),
|
||||
help="Whether Health Monitor is available with provider "
|
||||
"driver or not."),
|
||||
cfg.BoolOpt('terminated_tls_enabled',
|
||||
default=True,
|
||||
help="Whether TLS termination is available with provider "
|
||||
"driver or not."),
|
||||
cfg.BoolOpt('l7_protocol_enabled',
|
||||
default=True,
|
||||
help="Whether L7 Protocols are available with the provider"
|
||||
" driver or not."),
|
||||
help="Whether L7 Protocols are available with the provider "
|
||||
"driver or not."),
|
||||
cfg.BoolOpt('pool_algorithms_enabled',
|
||||
default=True,
|
||||
help="Whether pool algorithms are available with provider"
|
||||
"driver or not."),
|
||||
cfg.StrOpt('l4_protocol',
|
||||
default="TCP",
|
||||
help="The type of L4 Protocol which is supported with the"
|
||||
" provider driver."),
|
||||
help="The type of L4 Protocol which is supported with the "
|
||||
"provider driver."),
|
||||
]
|
||||
|
|
|
@ -51,9 +51,9 @@ class PoolScenarioTest(test_base.LoadBalancerBaseTest):
|
|||
CONF.load_balancer.lb_build_interval,
|
||||
CONF.load_balancer.lb_build_timeout)
|
||||
cls.protocol = const.HTTP
|
||||
lb_feature_enabled = CONF.loadbalancer_feature_enabled
|
||||
if not lb_feature_enabled.l7_protocol_enabled:
|
||||
cls.protocol = lb_feature_enabled.l4_protocol
|
||||
cls.lb_feature_enabled = CONF.loadbalancer_feature_enabled
|
||||
if not cls.lb_feature_enabled.l7_protocol_enabled:
|
||||
cls.protocol = cls.lb_feature_enabled.l4_protocol
|
||||
|
||||
listener_name = data_utils.rand_name("lb_member_listener1_pool")
|
||||
listener_kwargs = {
|
||||
|
@ -161,8 +161,12 @@ class PoolScenarioTest(test_base.LoadBalancerBaseTest):
|
|||
const.NAME: new_name,
|
||||
const.DESCRIPTION: new_description,
|
||||
const.ADMIN_STATE_UP: True,
|
||||
const.LB_ALGORITHM: const.LB_ALGORITHM_LEAST_CONNECTIONS,
|
||||
}
|
||||
|
||||
if self.lb_feature_enabled.pool_algorithms_enabled:
|
||||
pool_update_kwargs[const.LB_ALGORITHM] = \
|
||||
const.LB_ALGORITHM_LEAST_CONNECTIONS
|
||||
|
||||
if self.protocol == const.HTTP:
|
||||
pool_update_kwargs[const.SESSION_PERSISTENCE] = {
|
||||
const.TYPE: const.SESSION_PERSISTENCE_HTTP_COOKIE}
|
||||
|
@ -184,8 +188,9 @@ class PoolScenarioTest(test_base.LoadBalancerBaseTest):
|
|||
self.assertEqual(new_name, pool[const.NAME])
|
||||
self.assertEqual(new_description, pool[const.DESCRIPTION])
|
||||
self.assertTrue(pool[const.ADMIN_STATE_UP])
|
||||
self.assertEqual(const.LB_ALGORITHM_LEAST_CONNECTIONS,
|
||||
pool[const.LB_ALGORITHM])
|
||||
if self.lb_feature_enabled.pool_algorithms_enabled:
|
||||
self.assertEqual(const.LB_ALGORITHM_LEAST_CONNECTIONS,
|
||||
pool[const.LB_ALGORITHM])
|
||||
self.assertIsNotNone(pool.get(const.SESSION_PERSISTENCE))
|
||||
if self.protocol == const.HTTP:
|
||||
self.assertEqual(const.SESSION_PERSISTENCE_HTTP_COOKIE,
|
||||
|
|
Loading…
Reference in New Issue