summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-09-08 22:00:10 +0000
committerGerrit Code Review <review@openstack.org>2020-09-08 22:00:10 +0000
commite999631422a9431735853485ad522b4b153496ac (patch)
tree850b6ad47851edefcd6e3f4d10dd24915edc8e27
parent34245e8c8aba63534bcf73215aef1a96aca6331d (diff)
parentc8d61703c2e74c559b601cf23d1aa59366b32874 (diff)
downloadpython-neutronclient-e999631422a9431735853485ad522b4b153496ac.tar.gz
Merge "Add aggressive negotiation mode for ikepolicy"
-rw-r--r--neutronclient/osc/v2/vpnaas/ikepolicy.py2
-rw-r--r--neutronclient/tests/unit/osc/v2/vpnaas/test_ikepolicy.py20
-rw-r--r--releasenotes/notes/add-aggressive-negotiation-mode-5218b1baff930eb8.yaml5
3 files changed, 26 insertions, 1 deletions
diff --git a/neutronclient/osc/v2/vpnaas/ikepolicy.py b/neutronclient/osc/v2/vpnaas/ikepolicy.py
index eb598ea..73b6402 100644
--- a/neutronclient/osc/v2/vpnaas/ikepolicy.py
+++ b/neutronclient/osc/v2/vpnaas/ikepolicy.py
@@ -64,7 +64,7 @@ def _get_common_parser(parser):
help=_('Encryption algorithm'))
parser.add_argument(
'--phase1-negotiation-mode',
- choices=['main'],
+ choices=['main', 'aggressive'],
type=_convert_to_lowercase,
help=_('IKE Phase1 negotiation mode'))
parser.add_argument(
diff --git a/neutronclient/tests/unit/osc/v2/vpnaas/test_ikepolicy.py b/neutronclient/tests/unit/osc/v2/vpnaas/test_ikepolicy.py
index 0d2673a..cfe65a2 100644
--- a/neutronclient/tests/unit/osc/v2/vpnaas/test_ikepolicy.py
+++ b/neutronclient/tests/unit/osc/v2/vpnaas/test_ikepolicy.py
@@ -208,6 +208,10 @@ class TestCreateIKEPolicy(TestIKEPolicy, common.TestCreateVPNaaS):
def test_create_with_all_params_name(self):
self._test_create_with_all_params({'name': 'new_ikepolicy'})
+ def test_create_with_all_params_aggressive_mode(self):
+ self._test_create_with_all_params(
+ {'phase1_negotiation_mode': 'aggressive'})
+
class TestDeleteIKEPolicy(TestIKEPolicy, common.TestDeleteVPNaaS):
@@ -292,6 +296,22 @@ class TestSetIKEPolicy(TestIKEPolicy, common.TestSetVPNaaS):
target, {self.res: {'auth_algorithm': 'sha256'}})
self.assertIsNone(result)
+ def test_set_phase1_negotiation_mode_with_aggressive(self):
+ target = self.resource['id']
+ phase1_negotiation_mode = 'aggressive'
+ arglist = [target,
+ '--phase1-negotiation-mode', phase1_negotiation_mode]
+ verifylist = [
+ (self.res, target),
+ ('phase1_negotiation_mode', phase1_negotiation_mode),
+ ]
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+ result = self.cmd.take_action(parsed_args)
+
+ self.mocked.assert_called_once_with(
+ target, {self.res: {'phase1_negotiation_mode': 'aggressive'}})
+ self.assertIsNone(result)
+
class TestShowIKEPolicy(TestIKEPolicy, common.TestShowVPNaaS):
diff --git a/releasenotes/notes/add-aggressive-negotiation-mode-5218b1baff930eb8.yaml b/releasenotes/notes/add-aggressive-negotiation-mode-5218b1baff930eb8.yaml
new file mode 100644
index 0000000..ae1b667
--- /dev/null
+++ b/releasenotes/notes/add-aggressive-negotiation-mode-5218b1baff930eb8.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - |
+ The ``--phase1-negotiation-mode`` option supports ``aggressive`` mode
+ in VPNaaS ikepolicy commands.