[VPNaaS] Add support for sha2-384 and sha2-512

Commit I87b257ee6500c424fc273955a6d89d972a2823e9 had supported
sha2-384 and sha2-512 in VPNaaS side, this patch add those support
in CLI side.

Change-Id: Ie1842acd830e9b8c624cf099491ed5ff46304b8d
Closes-Bug: #1639990
This commit is contained in:
Dongcan Ye 2016-11-08 10:04:18 +08:00
parent 3a64a7a166
commit 42d995bf9d
4 changed files with 22 additions and 0 deletions

View File

@ -30,6 +30,7 @@ def add_common_args(parser, is_create=True):
'--auth-algorithm',
type=utils.convert_to_lowercase,
default='sha1' if is_create else argparse.SUPPRESS,
choices=['sha1', 'sha256', 'sha384', 'sha512'],
help=_('Authentication algorithm, default:sha1.'))
parser.add_argument(
'--encryption-algorithm',

View File

@ -27,6 +27,7 @@ def add_common_args(parser, is_create=True):
'--auth-algorithm',
default='sha1' if is_create else argparse.SUPPRESS,
type=utils.convert_to_lowercase,
choices=['sha1', 'sha256', 'sha384', 'sha512'],
help=_('Authentication algorithm for IPsec policy, default:sha1.'))
parser.add_argument(
'--description',

View File

@ -86,6 +86,16 @@ class CLITestV20VpnIkePolicyJSON(test_cli20.CLITestV20Base):
def test_create_ikepolicy_auth_sha256(self):
self._test_create_ikepolicy_all_params(auth='sha256')
def test_create_ikepolicy_auth_sha384(self):
self._test_create_ikepolicy_all_params(auth='sha384')
def test_create_ikepolicy_auth_sha512(self):
self._test_create_ikepolicy_all_params(auth='sha512')
def test_create_ikepolicy_invalid_auth(self):
self._test_create_ikepolicy_all_params(auth='invalid',
expected_exc=SystemExit)
def test_create_ikepolicy_with_limited_params(self):
# vpn-ikepolicy-create with limited params.
resource = 'ikepolicy'

View File

@ -85,6 +85,16 @@ class CLITestV20VpnIpsecPolicyJSON(test_cli20.CLITestV20Base):
def test_create_ipsecpolicy_auth_sha256(self):
self._test_create_ipsecpolicy_all_params(auth='sha256')
def test_create_ipsecpolicy_auth_sha384(self):
self._test_create_ipsecpolicy_all_params(auth='sha384')
def test_create_ipsecpolicy_auth_sha512(self):
self._test_create_ipsecpolicy_all_params(auth='sha512')
def test_create_ipsecpolicy_invalid_auth(self):
self._test_create_ipsecpolicy_all_params(auth='invalid',
expected_exc=SystemExit)
def test_create_ipsecpolicy_with_limited_params(self):
# vpn-ipsecpolicy-create with limited params.
resource = 'ipsecpolicy'