|
25 | 25 | from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePrivateKey |
26 | 26 | from cryptography.x509.oid import NameOID |
27 | 27 |
|
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 |
29 | 29 | from test_pm import get_policy_obj, get_defaults_obj |
30 | 30 | from test_utils import random_word, enroll, renew, renew_by_thumbprint, renew_without_key_reuse, simple_enroll, \ |
31 | 31 | get_vaas_zone |
|
39 | 39 | class TestVaaSMethods(unittest.TestCase): |
40 | 40 | def __init__(self, *args, **kwargs): |
41 | 41 | self.cloud_zone = CLOUD_ZONE |
| 42 | + self.vaas_zone_ec = VAAS_ZONE_ONLY_EC |
42 | 43 | self.cloud_conn = CloudConnection(token=CLOUD_APIKEY, url=CLOUD_URL) |
43 | 44 | super(TestVaaSMethods, self).__init__(*args, **kwargs) |
44 | 45 |
|
@@ -171,29 +172,12 @@ def test_cloud_enroll_service_generated_csr(self): |
171 | 172 | log.info(f"PKCS12 created successfully for certificate with CN: {cn}") |
172 | 173 |
|
173 | 174 | 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 |
180 | 176 |
|
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) |
193 | 177 | password = 'FooBarPass123' |
194 | 178 |
|
195 | 179 | request = CertificateRequest( |
196 | | - common_name=f"{random_word(10)}.venafi.example", |
| 180 | + common_name=f"{random_word(10)}.vfidev.com", |
197 | 181 | key_type=KeyType( |
198 | 182 | key_type="ec", |
199 | 183 | option="P384" |
|
0 commit comments