Browse Source

Merge "Fix UDP pool transform in LVS driver"

changes/90/724890/2
Zuul 1 week ago
committed by Gerrit Code Review
parent
commit
ec2f89830d
3 changed files with 14 additions and 4 deletions
  1. +2
    -2
      octavia/common/jinja/lvs/jinja_cfg.py
  2. +9
    -0
      octavia/tests/unit/common/jinja/lvs/test_lvs_jinja_cfg.py
  3. +3
    -2
      octavia/tests/unit/common/sample_configs/sample_configs_combined.py

+ 2
- 2
octavia/common/jinja/lvs/jinja_cfg.py View File

@@ -136,8 +136,8 @@ class LvsJinjaTemplater(object):
ret_value = {
'id': pool.id,
'protocol': PROTOCOL_MAP[pool.protocol],
'lb_algorithm': BALANCE_MAP.get(pool.lb_algorithm,
'roundrobin'),
'lb_algorithm': (BALANCE_MAP.get(pool.lb_algorithm) or
BALANCE_MAP[constants.LB_ALGORITHM_ROUND_ROBIN]),
'members': [],
'health_monitor': '',
'session_persistence': '',


+ 9
- 0
octavia/tests/unit/common/jinja/lvs/test_lvs_jinja_cfg.py View File

@@ -265,6 +265,15 @@ class TestLvsCfg(base.TestCase):
ret = self.udp_jinja_cfg._transform_pool(in_pool)
self.assertEqual(sample_configs_combined.RET_UDP_POOL, ret)

in_pool = sample_configs_combined.sample_pool_tuple(
proto=constants.PROTOCOL_UDP,
persistence_type=constants.SESSION_PERSISTENCE_SOURCE_IP,
persistence_timeout=33, persistence_granularity='255.0.0.0',
lb_algorithm=None,
)
ret = self.udp_jinja_cfg._transform_pool(in_pool)
self.assertEqual(sample_configs_combined.RET_UDP_POOL, ret)

in_pool = sample_configs_combined.sample_pool_tuple(
proto=constants.PROTOCOL_UDP,
persistence_type=constants.SESSION_PERSISTENCE_SOURCE_IP,


+ 3
- 2
octavia/tests/unit/common/sample_configs/sample_configs_combined.py View File

@@ -788,7 +788,8 @@ def sample_pool_tuple(listener_id=None, proto=None, monitor=True,
hm_host_http_check=False,
provisioning_status=constants.ACTIVE,
tls_ciphers=constants.CIPHERS_OWASP_SUITE_B,
tls_versions=constants.TLS_VERSIONS_OWASP_SUITE_B):
tls_versions=constants.TLS_VERSIONS_OWASP_SUITE_B,
lb_algorithm=constants.LB_ALGORITHM_ROUND_ROBIN):
proto = 'HTTP' if proto is None else proto
if not tls_enabled:
tls_ciphers = None
@@ -836,7 +837,7 @@ def sample_pool_tuple(listener_id=None, proto=None, monitor=True,
return in_pool(
id=id,
protocol=proto,
lb_algorithm='ROUND_ROBIN',
lb_algorithm=lb_algorithm,
members=members,
health_monitor=mon,
session_persistence=persis if persistence is True else None,


Loading…
Cancel
Save