Add support for tcp multiplexing in LB Pool config

This change support create/update LB pool with tcp multiplexing
enabled and tcp multiplexing number.

Change-Id: I3c39bc2b4b07f138a2ac3d3efbdccd80929cc3b2
This commit is contained in:
Erica Liu 2020-11-30 17:09:21 -08:00
parent 0323737ed1
commit 293c139b05
3 changed files with 18 additions and 2 deletions

View File

@ -1490,6 +1490,8 @@ class TestPolicyLBPoolApi(test_resources.NsxPolicyLibTestCase):
algorithm=algorithm,
member_group=member_group,
snat_translation=snat_translation,
tcp_multiplexing_enabled=True,
tcp_multiplexing_number=10,
tenant=TEST_TENANT)
expected_def = lb_defs.LBPoolDef(
lb_pool_id=obj_id,
@ -1500,6 +1502,8 @@ class TestPolicyLBPoolApi(test_resources.NsxPolicyLibTestCase):
algorithm=algorithm,
member_group=member_group,
snat_translation=snat_translation,
tcp_multiplexing_enabled=True,
tcp_multiplexing_number=10,
tenant=TEST_TENANT)
self.assert_called_with_def(api_call, expected_def)
self.assertEqual(obj_id, result)
@ -1635,6 +1639,8 @@ class TestPolicyLBPoolApi(test_resources.NsxPolicyLibTestCase):
algorithm=algorithm,
member_group=member_group,
snat_translation=snat_translation,
tcp_multiplexing_enabled=True,
tcp_multiplexing_number=10,
tenant=TEST_TENANT)
expected_def = lb_defs.LBPoolDef(
lb_pool_id=obj_id,
@ -1645,6 +1651,8 @@ class TestPolicyLBPoolApi(test_resources.NsxPolicyLibTestCase):
algorithm=algorithm,
member_group=member_group,
snat_translation=snat_translation,
tcp_multiplexing_enabled=True,
tcp_multiplexing_number=10,
tenant=TEST_TENANT)
self.assert_called_with_def(update_call, expected_def)

View File

@ -242,7 +242,8 @@ class LBPoolDef(ResourceDef):
body = super(LBPoolDef, self).get_obj_dict()
self._set_attrs_if_specified(
body, ['active_monitor_paths',
'algorithm', 'member_group', 'snat_translation'])
'algorithm', 'member_group', 'snat_translation',
'tcp_multiplexing_enabled', 'tcp_multiplexing_number'])
members = self.get_attr('members')
if members is None:
members = []

View File

@ -474,6 +474,8 @@ class NsxPolicyLoadBalancerPoolApi(NsxPolicyResourceBase):
tags=IGNORE, members=IGNORE, algorithm=IGNORE,
active_monitor_paths=IGNORE, member_group=IGNORE,
snat_translation=IGNORE,
tcp_multiplexing_enabled=IGNORE,
tcp_multiplexing_number=IGNORE,
tenant=constants.POLICY_INFRA_TENANT):
lb_pool_id = self._init_obj_uuid(lb_pool_id)
lb_pool_def = self._init_def(
@ -486,6 +488,8 @@ class NsxPolicyLoadBalancerPoolApi(NsxPolicyResourceBase):
algorithm=algorithm,
member_group=member_group,
snat_translation=snat_translation,
tcp_multiplexing_enabled=tcp_multiplexing_enabled,
tcp_multiplexing_number=tcp_multiplexing_number,
tenant=tenant)
self._create_or_store(lb_pool_def)
@ -510,7 +514,8 @@ class NsxPolicyLoadBalancerPoolApi(NsxPolicyResourceBase):
def update(self, lb_pool_id, name=IGNORE, description=IGNORE,
tags=IGNORE, members=IGNORE, algorithm=IGNORE,
active_monitor_paths=IGNORE, member_group=IGNORE,
snat_translation=IGNORE,
snat_translation=IGNORE, tcp_multiplexing_enabled=IGNORE,
tcp_multiplexing_number=IGNORE,
tenant=constants.POLICY_INFRA_TENANT,
allow_partial_updates=True):
self._update(
@ -523,6 +528,8 @@ class NsxPolicyLoadBalancerPoolApi(NsxPolicyResourceBase):
algorithm=algorithm,
member_group=member_group,
snat_translation=snat_translation,
tcp_multiplexing_enabled=tcp_multiplexing_enabled,
tcp_multiplexing_number=tcp_multiplexing_number,
tenant=tenant, allow_partial_updates=allow_partial_updates)
def add_monitor_to_pool(self, lb_pool_id, active_monitor_paths,