Merge "Added 'direction' prop to QoSBandwidthLimitRule"

This commit is contained in:
Zuul 2019-04-22 19:14:08 +00:00 committed by Gerrit Code Review
commit f5a953b34b
2 changed files with 16 additions and 3 deletions

View File

@ -156,9 +156,9 @@ class QoSBandwidthLimitRule(QoSRule):
entity = 'bandwidth_limit_rule' entity = 'bandwidth_limit_rule'
PROPERTIES = ( PROPERTIES = (
MAX_BANDWIDTH, MAX_BURST_BANDWIDTH, MAX_BANDWIDTH, MAX_BURST_BANDWIDTH, DIRECTION
) = ( ) = (
'max_kbps', 'max_burst_kbps', 'max_kbps', 'max_burst_kbps', 'direction'
) )
properties_schema = { properties_schema = {
@ -179,6 +179,16 @@ class QoSBandwidthLimitRule(QoSRule):
constraints.Range(min=0) constraints.Range(min=0)
], ],
default=0 default=0
),
DIRECTION: properties.Schema(
properties.Schema.STRING,
_('Traffic direction from the point of view of the port.'),
update_allowed=True,
constraints=[
constraints.AllowedValues(['egress', 'ingress']),
],
default='egress',
support_status=support.SupportStatus(version='13.0.0')
) )
} }

View File

@ -207,12 +207,14 @@ class NeutronQoSBandwidthLimitRuleTest(common.HeatTestCase):
'id': 'cf0eab12-ef8b-4a62-98d0-70576583c17a', 'id': 'cf0eab12-ef8b-4a62-98d0-70576583c17a',
'max_kbps': 1000, 'max_kbps': 1000,
'max_burst_kbps': 1000, 'max_burst_kbps': 1000,
'direction': 'egress',
'tenant_id': 'd66c74c01d6c41b9846088c1ad9634d0' 'tenant_id': 'd66c74c01d6c41b9846088c1ad9634d0'
} }
} }
create_props = {'max_kbps': 1000, create_props = {'max_kbps': 1000,
'max_burst_kbps': 1000, 'max_burst_kbps': 1000,
'direction': 'egress',
'tenant_id': 'd66c74c01d6c41b9846088c1ad9634d0'} 'tenant_id': 'd66c74c01d6c41b9846088c1ad9634d0'}
self.neutronclient.create_bandwidth_limit_rule.return_value = rule self.neutronclient.create_bandwidth_limit_rule.return_value = rule
@ -260,7 +262,7 @@ class NeutronQoSBandwidthLimitRuleTest(common.HeatTestCase):
self.bandwidth_limit_rule.handle_update( self.bandwidth_limit_rule.handle_update(
json_snippet={}, json_snippet={},
tmpl_diff={}, tmpl_diff={},
prop_diff=prop_diff) prop_diff=prop_diff.copy())
self.neutronclient.update_bandwidth_limit_rule.assert_called_once_with( self.neutronclient.update_bandwidth_limit_rule.assert_called_once_with(
rule_id, rule_id,
@ -274,6 +276,7 @@ class NeutronQoSBandwidthLimitRuleTest(common.HeatTestCase):
'id': 'cf0eab12-ef8b-4a62-98d0-70576583c17a', 'id': 'cf0eab12-ef8b-4a62-98d0-70576583c17a',
'max_kbps': 1000, 'max_kbps': 1000,
'max_burst_kbps': 1000, 'max_burst_kbps': 1000,
'direction': 'egress',
'tenant_id': 'd66c74c01d6c41b9846088c1ad9634d0' 'tenant_id': 'd66c74c01d6c41b9846088c1ad9634d0'
} }
} }