Merge "Make properties updatable for IKE policy of VPNaaS"

This commit is contained in:
Zuul 2020-02-19 23:40:22 +00:00 committed by Gerrit Code Review
commit 7466e87d4b
3 changed files with 29 additions and 11 deletions

View File

@ -552,7 +552,8 @@ class IKEPolicy(neutron.NeutronResource):
constraints=[
constraints.AllowedValues(['3des', 'aes-128', 'aes-192',
'aes-256']),
]
],
update_allowed=True
),
PHASE1_NEGOTIATION_MODE: properties.Schema(
properties.Schema.STRING,
@ -565,6 +566,7 @@ class IKEPolicy(neutron.NeutronResource):
LIFETIME: properties.Schema(
properties.Schema.MAP,
_('Safety assessment lifetime configuration for the ike policy.'),
update_allowed=True,
schema={
LIFETIME_UNITS: properties.Schema(
properties.Schema.STRING,
@ -588,7 +590,8 @@ class IKEPolicy(neutron.NeutronResource):
default='group5',
constraints=[
constraints.AllowedValues(['group2', 'group5', 'group14']),
]
],
update_allowed=True
),
IKE_VERSION: properties.Schema(
properties.Schema.STRING,
@ -596,7 +599,8 @@ class IKEPolicy(neutron.NeutronResource):
default='v1',
constraints=[
constraints.AllowedValues(['v1', 'v2']),
]
],
update_allowed=True
),
}

View File

@ -737,21 +737,30 @@ class IKEPolicyTest(common.HeatTestCase):
rsrc = self.create_ikepolicy()
self.mockclient.update_ikepolicy.return_value = None
new_props = {
'name': 'New IKEPolicy',
'auth_algorithm': 'sha512',
'description': 'New description',
'encryption_algorithm': 'aes-256',
'lifetime': {
'units': 'seconds',
'value': 1800
},
'pfs': 'group2',
'ike_version': 'v2'
}
update_body = {
'ikepolicy': new_props
}
scheduler.TaskRunner(rsrc.create)()
props = dict(rsrc.properties)
props['name'] = 'New IKEPolicy'
props['auth_algorithm'] = 'sha512'
props.update(new_props)
update_template = rsrc.t.freeze(properties=props)
scheduler.TaskRunner(rsrc.update, update_template)()
self.mockclient.create_ikepolicy.assert_called_once_with(
self.IKE_POLICY_CONF)
update_body = {
'ikepolicy': {
'name': 'New IKEPolicy',
'auth_algorithm': 'sha512'
}
}
self.mockclient.update_ikepolicy.assert_called_once_with(
'ike123', update_body)

View File

@ -0,0 +1,5 @@
---
features:
- |
Properties of the VPNaaS ``OS::Neutron::IKEPolicy`` resource can now be
updated in place.