Add missing correlation type "mpls" to port pair

Add missing correlation type "mpls" to Port Pair create
command's help (PortPairCreate).

The merged Port Pair command was still using the older help
description, before MPLS correlation support was merged to
networking-sfc.

Also add unit test coverage for correlation type "mpls".

Closes-Bug: #1708968
Change-Id: I708345b25b600ca94504725f1559988ae29413b8
(cherry picked from commit ff86783fd4)
This commit is contained in:
Igor Duarte Cardoso
2017-07-27 12:46:22 +00:00
parent 171febb51e
commit 69e97e204d
2 changed files with 14 additions and 6 deletions

View File

@@ -58,8 +58,8 @@ class CreateSfcPortPair(command.ShowOne):
action=parseractions.MultiKeyValueAction,
optional_keys=['correlation', 'weight'],
help=_('Dictionary of service function parameters. '
'Currently, only correlation=None and weight '
'is supported. Weight is an integer that influences '
'Currently, correlation=(None|mpls) and weight '
'are supported. Weight is an integer that influences '
'the selection of a port pair within a port pair group '
'for a flow. The higher the weight, the more flows will '
'hash to the port pair. The default weight is 1.'))

View File

@@ -81,16 +81,17 @@ class TestCreateSfcPortPair(fakes.TestNeutronClientOSCV2):
self.assertEqual(self.columns, columns)
self.assertEqual(self.data, data)
def test_create_port_pair_all_options(self):
def _test_create_port_pair_all_options(self, correlation):
arglist = [
"--description", self._port_pair['description'],
"--egress", self._port_pair['egress'],
"--ingress", self._port_pair['ingress'],
self._port_pair['name'],
"--service-function-parameters", 'correlation=None,weight=1',
"--service-function-parameters",
'correlation=%s,weight=1' % correlation,
]
sfp = [{'correlation': 'None', 'weight': '1'}]
sfp = [{'correlation': correlation, 'weight': '1'}]
verifylist = [
('ingress', self._port_pair['ingress']),
@@ -109,12 +110,19 @@ class TestCreateSfcPortPair(fakes.TestNeutronClientOSCV2):
'egress': self._port_pair['egress'],
'description': self._port_pair['description'],
'service_function_parameters':
[{'correlation': 'None', 'weight': '1'}],
[{'correlation': correlation, 'weight':
'1'}],
}
})
self.assertEqual(self.columns, columns)
self.assertEqual(self.data, data)
def test_create_port_pair_all_options(self):
self._test_create_port_pair_all_options('None')
def test_create_port_pair_all_options_mpls(self):
self._test_create_port_pair_all_options('mpls')
class TestDeleteSfcPortPair(fakes.TestNeutronClientOSCV2):