11import pytest
2- from botocore .exceptions import ClientError
32from localstack_snapshot .snapshots .transformer import SortingTransformer
43from moto import settings as moto_settings
54
65from localstack .testing .aws .util import is_aws_cloud
76from localstack .testing .pytest import markers
87from localstack .utils .crypto import generate_ssl_cert
98from localstack .utils .strings import short_uid
10- from localstack .utils .sync import retry , wait_until
9+ from localstack .utils .sync import retry
1110
1211
1312class TestACM :
@@ -28,7 +27,7 @@ class TestACM:
2827 ]
2928 )
3029 def test_import_certificate (self , tmp_path , aws_client , cleanups , snapshot ):
31- with pytest .raises (ClientError ) as exc_info :
30+ with pytest .raises (Exception ) as exc_info :
3231 aws_client .acm .import_certificate (Certificate = b"CERT123" , PrivateKey = b"KEY123" )
3332 assert exc_info .value .response ["Error" ]["Code" ] == "ValidationException"
3433
@@ -73,15 +72,6 @@ def test_domain_validation(self, acm_request_certificate, aws_client, snapshot):
7372 snapshot .add_transformer (snapshot .transform .key_value ("SignatureAlgorithm" ))
7473
7574 certificate_arn = acm_request_certificate ()["CertificateArn" ]
76-
77- # we are manually waiting for some fields to be returned, as they are missing soon after creating the cert
78- def _cert_has_required_fields () -> bool :
79- _resp = aws_client .acm .describe_certificate (CertificateArn = certificate_arn )
80- return "DomainName" in _resp ["Certificate" ]
81-
82- if is_aws_cloud ():
83- wait_until (_cert_has_required_fields , wait = 2 , max_retries = 20 )
84-
8575 result = aws_client .acm .describe_certificate (CertificateArn = certificate_arn )
8676 snapshot .match ("describe-certificate" , result )
8777
@@ -94,17 +84,8 @@ def test_boto_wait_for_certificate_validation(
9484 waiter = aws_client .acm .get_waiter ("certificate_validated" )
9585 waiter .wait (CertificateArn = certificate_arn , WaiterConfig = {"Delay" : 0.5 , "MaxAttempts" : 3 })
9686
97- @markers .aws .manual_setup_required
98- # this test requires manual input to our DNS provider
99- @markers .snapshot .skip_snapshot_verify (
100- paths = [
101- "$..Certificate.SignatureAlgorithm" ,
102- # those should also be returned by AWS, but regenerating the snapshots needs manual input
103- # skipped for now, validated by other tests
104- "$..Certificate.Options.Export" ,
105- "$..Exported" ,
106- ]
107- )
87+ @markers .aws .validated
88+ @markers .snapshot .skip_snapshot_verify (paths = ["$..Certificate.SignatureAlgorithm" ])
10889 def test_certificate_for_subdomain_wildcard (
10990 self , acm_request_certificate , aws_client , snapshot , monkeypatch
11091 ):
@@ -142,7 +123,7 @@ def _get_cert_with_records():
142123 if is_aws_cloud ():
143124 # Wait until DNS entry has been added (needs to be done manually!)
144125 # Note: When running parity tests against AWS, we need to add the CNAME record to our DNS
145- # server (currently with Route53 ), to enable validation of the certificate.
126+ # server (currently with gandi.net ), to enable validation of the certificate.
146127 prompt = (
147128 f"Please add the following CNAME entry to the LocalStack DNS server, then hit [ENTER] once "
148129 f"the certificate has been validated in AWS: { dns_options ['Name' ]} = { dns_options ['Value' ]} "
@@ -180,7 +161,6 @@ def _get_cert_issued():
180161 "$..ResourceRecord" ,
181162 "$..SignatureAlgorithm" ,
182163 "$..Serial" ,
183- "$..ExportOption" ,
184164 ]
185165 )
186166 def test_create_certificate_for_multiple_alternative_domains (
0 commit comments