Browse Source

Add SCTP support

Listener, pool and health-monitor objects now support SCTP protocol.

Depends-On: https://review.opendev.org/#/c/738381/

Story: 2007884
Task: 40257

Change-Id: Ib92c9896b6bd397c7fda2658a0e710f1014877fb
tags/2.2.0^0
Gregory Thiemonge 1 month ago
committed by Michael Johnson
parent
commit
78c08edf3d
6 changed files with 20 additions and 14 deletions
  1. +1
    -1
      octaviaclient/osc/v2/health_monitor.py
  2. +1
    -1
      octaviaclient/osc/v2/listener.py
  3. +1
    -1
      octaviaclient/osc/v2/pool.py
  4. +6
    -4
      octaviaclient/osc/v2/validate.py
  5. +7
    -7
      octaviaclient/tests/unit/osc/v2/test_validations.py
  6. +4
    -0
      releasenotes/notes/add-support-for-sctp-protocol-f23b58db8522cc4b.yaml

+ 1
- 1
octaviaclient/osc/v2/health_monitor.py View File

@@ -30,7 +30,7 @@ HTTP_METHODS = ['GET', 'POST', 'DELETE', 'PUT', 'HEAD', 'OPTIONS', 'PATCH',
'CONNECT', 'TRACE']
HTTP_VERSIONS = [1.0, 1.1]
TYPE_CHOICES = ['PING', 'HTTP', 'TCP', 'HTTPS', 'TLS-HELLO',
'UDP-CONNECT']
'UDP-CONNECT', 'SCTP']


class CreateHealthMonitor(command.ShowOne):


+ 1
- 1
octaviaclient/osc/v2/listener.py View File

@@ -25,7 +25,7 @@ from octaviaclient.osc.v2 import constants as const
from octaviaclient.osc.v2 import utils as v2_utils
from octaviaclient.osc.v2 import validate

PROTOCOL_CHOICES = ['TCP', 'HTTP', 'HTTPS', 'TERMINATED_HTTPS', 'UDP']
PROTOCOL_CHOICES = ['TCP', 'HTTP', 'HTTPS', 'TERMINATED_HTTPS', 'UDP', 'SCTP']
CLIENT_AUTH_CHOICES = ['NONE', 'OPTIONAL', 'MANDATORY']




+ 1
- 1
octaviaclient/osc/v2/pool.py View File

@@ -25,7 +25,7 @@ from octaviaclient.osc.v2 import constants as const
from octaviaclient.osc.v2 import utils as v2_utils

PROTOCOL_CHOICES = ['TCP', 'HTTP', 'HTTPS', 'TERMINATED_HTTPS', 'PROXY',
'UDP']
'UDP', 'SCTP']
ALGORITHM_CHOICES = ['SOURCE_IP', 'ROUND_ROBIN', 'LEAST_CONNECTIONS',
'SOURCE_IP_PORT']



+ 6
- 4
octaviaclient/osc/v2/validate.py View File

@@ -45,7 +45,7 @@ def check_l7rule_attrs(attrs):

# Handling these range validations here instead of "choices" as "choices" will
# output every possible option in the error message.
def _validate_TCPUDP_port_range(port_number, parameter_name):
def _validate_TCP_UDP_SCTP_port_range(port_number, parameter_name):
if (port_number < constants.MIN_PORT_NUMBER or
port_number > constants.MAX_PORT_NUMBER):
msg = ("Invalid input for field/attribute '{name}', Value: "
@@ -58,15 +58,17 @@ def _validate_TCPUDP_port_range(port_number, parameter_name):

def check_listener_attrs(attrs):
if 'protocol_port' in attrs:
_validate_TCPUDP_port_range(attrs['protocol_port'], 'protocol-port')
_validate_TCP_UDP_SCTP_port_range(attrs['protocol_port'],
'protocol-port')


def check_member_attrs(attrs):
if 'protocol_port' in attrs:
_validate_TCPUDP_port_range(attrs['protocol_port'], 'protocol-port')
_validate_TCP_UDP_SCTP_port_range(attrs['protocol_port'],
'protocol-port')

if 'member_port' in attrs:
_validate_TCPUDP_port_range(attrs['member_port'], 'member-port')
_validate_TCP_UDP_SCTP_port_range(attrs['member_port'], 'member-port')

if 'weight' in attrs:
if(attrs['weight'] < constants.MIN_WEIGHT or


+ 7
- 7
octaviaclient/tests/unit/osc/v2/test_validations.py View File

@@ -75,19 +75,19 @@ class TestValidations(utils.TestCommand):
exceptions.CommandError,
validate.check_l7rule_attrs, attrs_dict)

def test_validate_TCPUDP_port_range(self):
def test_validate_TCP_UDP_SCTP_port_range(self):
# Positive tests, should not raise
validate._validate_TCPUDP_port_range(constants.MIN_PORT_NUMBER,
"fake-parameter")
validate._validate_TCPUDP_port_range(constants.MAX_PORT_NUMBER,
"fake-parameter")
validate._validate_TCP_UDP_SCTP_port_range(constants.MIN_PORT_NUMBER,
"fake-parameter")
validate._validate_TCP_UDP_SCTP_port_range(constants.MAX_PORT_NUMBER,
"fake-parameter")

# Negative tests, should raise
self.assertRaises(exceptions.InvalidValue,
validate._validate_TCPUDP_port_range,
validate._validate_TCP_UDP_SCTP_port_range,
constants.MIN_PORT_NUMBER - 1, "fake-parameter")
self.assertRaises(exceptions.InvalidValue,
validate._validate_TCPUDP_port_range,
validate._validate_TCP_UDP_SCTP_port_range,
constants.MAX_PORT_NUMBER + 1, "fake-parameter")

def test_check_listener_attrs(self):


+ 4
- 0
releasenotes/notes/add-support-for-sctp-protocol-f23b58db8522cc4b.yaml View File

@@ -0,0 +1,4 @@
---
features:
- |
Add support for SCTP protocol in listener, pool and health-monitor objects.

Loading…
Cancel
Save