diff options
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 24663d6..fd621fd 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. |