Skip to content

Commit d223bf4

Browse files
committed
fixes ec test
1 parent 5cc767f commit d223bf4

2 files changed

Lines changed: 5 additions & 20 deletions

File tree

tests/test_env.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
CLOUD_URL = environ.get('CLOUD_URL')
3131
CLOUD_APIKEY = environ.get('CLOUD_APIKEY')
3232
CLOUD_ZONE = environ.get('CLOUD_ZONE')
33+
VAAS_ZONE_ONLY_EC = environ.get('VAAS_ZONE_ONLY_EC')
3334
CLOUD_TEAM = environ.get('CLOUD_TEAM')
3435

3536
TPP_PM_ROOT = environ.get('TPP_PM_ROOT')

tests/test_vaas.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePrivateKey
2626
from cryptography.x509.oid import NameOID
2727

28-
from test_env import CLOUD_ZONE, CLOUD_APIKEY, CLOUD_URL, RANDOM_DOMAIN
28+
from test_env import CLOUD_ZONE, CLOUD_APIKEY, CLOUD_URL, RANDOM_DOMAIN, VAAS_ZONE_ONLY_EC
2929
from test_pm import get_policy_obj, get_defaults_obj
3030
from test_utils import random_word, enroll, renew, renew_by_thumbprint, renew_without_key_reuse, simple_enroll, \
3131
get_vaas_zone
@@ -39,6 +39,7 @@
3939
class TestVaaSMethods(unittest.TestCase):
4040
def __init__(self, *args, **kwargs):
4141
self.cloud_zone = CLOUD_ZONE
42+
self.vaas_zone_ec = VAAS_ZONE_ONLY_EC
4243
self.cloud_conn = CloudConnection(token=CLOUD_APIKEY, url=CLOUD_URL)
4344
super(TestVaaSMethods, self).__init__(*args, **kwargs)
4445

@@ -171,29 +172,12 @@ def test_cloud_enroll_service_generated_csr(self):
171172
log.info(f"PKCS12 created successfully for certificate with CN: {cn}")
172173

173174
def test_enroll_ec_key_certificate(self):
174-
policy = get_policy_obj()
175-
kp = KeyPair(
176-
key_types=['EC'],
177-
elliptic_curves=['P521', 'P384'],
178-
reuse_allowed=False)
179-
policy.key_pair = kp
175+
zone = self.vaas_zone_ec
180176

181-
defaults = get_defaults_obj()
182-
defaults.key_pair = DefaultKeyPair(
183-
key_type='EC',
184-
elliptic_curve='P521')
185-
186-
policy_spec = PolicySpecification()
187-
policy_spec.policy = policy
188-
policy_spec.defaults = defaults
189-
190-
zone = self.get_vaas_zone()
191-
192-
self.cloud_conn.set_policy(zone, policy_spec)
193177
password = 'FooBarPass123'
194178

195179
request = CertificateRequest(
196-
common_name=f"{random_word(10)}.venafi.example",
180+
common_name=f"{random_word(10)}.vfidev.com",
197181
key_type=KeyType(
198182
key_type="ec",
199183
option="P384"

0 commit comments

Comments
 (0)