Allow protocol numbers in policy classfiers
Change-Id: Ic09bd459edae1c455d804239584ee9b5d8814a43 Partial-bug: 1499916
This commit is contained in:
parent
834b816ca9
commit
ab1adfc70d
@ -675,8 +675,8 @@ class CreatePolicyClassifier(neutronV20.CreateCommand):
|
|||||||
help=_('A description for the policy classifier'))
|
help=_('A description for the policy classifier'))
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--protocol',
|
'--protocol',
|
||||||
choices=['tcp', 'udp', 'icmp', ''],
|
help=_('A protocol value: tcp, udp, icmp or a protocol number '
|
||||||
help=_('A protocol value. When not set, all protocols are '
|
'between 0 and 255. When not set, all protocols are '
|
||||||
'matched'))
|
'matched'))
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--port-range',
|
'--port-range',
|
||||||
@ -726,8 +726,8 @@ class UpdatePolicyClassifier(neutronV20.UpdateCommand):
|
|||||||
help=_('New description for the policy classifier'))
|
help=_('New description for the policy classifier'))
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--protocol',
|
'--protocol',
|
||||||
choices=['tcp', 'udp', 'icmp', ''],
|
help=_('New protocol value: tcp, udp, icmp or a protocol number '
|
||||||
help=_('New protocol value '
|
'between 0 and 255 '
|
||||||
'(use empty string \'\' to unset and match all protocols)'))
|
'(use empty string \'\' to unset and match all protocols)'))
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--port-range',
|
'--port-range',
|
||||||
|
@ -45,26 +45,26 @@ class CLITestV20PolicyClassifierJSON(test_cli20.CLITestV20Base):
|
|||||||
tenant_id = 'my-tenant'
|
tenant_id = 'my-tenant'
|
||||||
description = 'My PolicyClassifier'
|
description = 'My PolicyClassifier'
|
||||||
my_id = 'my-id'
|
my_id = 'my-id'
|
||||||
protocol = 'tcp'
|
|
||||||
port_range = '10-80'
|
port_range = '10-80'
|
||||||
direction = 'in'
|
direction = 'in'
|
||||||
shared = 'true'
|
shared = 'true'
|
||||||
args = ['--tenant-id', tenant_id,
|
for protocol in ['tcp', 'icmp', 'udp', '50']:
|
||||||
'--description', description,
|
args = ['--tenant-id', tenant_id,
|
||||||
'--protocol', protocol,
|
'--description', description,
|
||||||
'--port-range', port_range,
|
'--protocol', protocol,
|
||||||
'--direction', direction,
|
'--port-range', port_range,
|
||||||
'--shared', shared,
|
'--direction', direction,
|
||||||
name]
|
'--shared', shared,
|
||||||
position_names = ['name', ]
|
name]
|
||||||
position_values = [name, ]
|
position_names = ['name', ]
|
||||||
self._test_create_resource(resource, cmd, name, my_id, args,
|
position_values = [name, ]
|
||||||
position_names, position_values,
|
self._test_create_resource(resource, cmd, name, my_id, args,
|
||||||
tenant_id=tenant_id,
|
position_names, position_values,
|
||||||
description=description,
|
tenant_id=tenant_id,
|
||||||
protocol=protocol,
|
description=description,
|
||||||
port_range=port_range,
|
protocol=protocol,
|
||||||
direction=direction, shared=shared)
|
port_range=port_range,
|
||||||
|
direction=direction, shared=shared)
|
||||||
|
|
||||||
def test_list_policy_classifiers(self):
|
def test_list_policy_classifiers(self):
|
||||||
"""grouppolicy-policy-classifier-list."""
|
"""grouppolicy-policy-classifier-list."""
|
||||||
@ -121,24 +121,24 @@ class CLITestV20PolicyClassifierJSON(test_cli20.CLITestV20Base):
|
|||||||
|
|
||||||
def test_update_policy_classifier_with_allparams(self):
|
def test_update_policy_classifier_with_allparams(self):
|
||||||
resource = 'policy_classifier'
|
resource = 'policy_classifier'
|
||||||
protocol = 'tcp'
|
|
||||||
port_range = '10-80'
|
port_range = '10-80'
|
||||||
direction = 'in'
|
direction = 'in'
|
||||||
cmd = gbp.UpdatePolicyClassifier(test_cli20.MyApp(sys.stdout), None)
|
cmd = gbp.UpdatePolicyClassifier(test_cli20.MyApp(sys.stdout), None)
|
||||||
my_id = 'someid'
|
my_id = 'someid'
|
||||||
shared = 'true'
|
shared = 'true'
|
||||||
body = {
|
for protocol in ['tcp', 'icmp', 'udp', '50']:
|
||||||
'protocol': protocol,
|
body = {
|
||||||
'port_range': port_range,
|
'protocol': protocol,
|
||||||
'direction': direction,
|
'port_range': port_range,
|
||||||
'shared': shared
|
'direction': direction,
|
||||||
}
|
'shared': shared
|
||||||
args = [my_id,
|
}
|
||||||
'--protocol', protocol,
|
args = [my_id,
|
||||||
'--port-range', port_range,
|
'--protocol', protocol,
|
||||||
'--direction', direction,
|
'--port-range', port_range,
|
||||||
'--shared', shared, ]
|
'--direction', direction,
|
||||||
self._test_update_resource(resource, cmd, my_id, args, body)
|
'--shared', shared, ]
|
||||||
|
self._test_update_resource(resource, cmd, my_id, args, body)
|
||||||
|
|
||||||
def test_delete_policy_classifier(self):
|
def test_delete_policy_classifier(self):
|
||||||
"""grouppolicy-policy-classifier-delete my-id."""
|
"""grouppolicy-policy-classifier-delete my-id."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user