Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data/tls_certificate: Updating real world testing for new www.terraform.io certificate results #523

Closed
1 task done
bflad opened this issue May 28, 2024 · 0 comments · Fixed by #524
Closed
1 task done

Comments

@bflad
Copy link
Contributor

bflad commented May 28, 2024

Terraform CLI and Provider Versions

N/A

Terraform Configuration

data "tls_certificate" "test" {
  url = "https://www.terraform.io/"
}

Expected Behavior

Existing acceptance testing passes.

Actual Behavior

Existing acceptance testing is failing, presumably because the terraform.io certificates rolled.

=== RUN   TestAccDataSourceCertificate_TerraformIO
    data_source_certificate_test.go:125: Step 1/1 error: Check failed: Check 1/13 error: data.tls_certificate.test: Attribute 'certificates.#' expected "2", got "3"
        Check 2/13 error: data.tls_certificate.test: Attribute 'certificates.0.issuer' expected "CN=ISRG Root X1,O=Internet Security Research Group,C=US", got "CN=DST Root CA X3,O=Digital Signature Trust Co."
        Check 3/13 error: data.tls_certificate.test: Attribute 'certificates.0.subject' expected "CN=R3,O=Let's Encrypt,C=US", got "CN=ISRG Root X1,O=Internet Security Research Group,C=US"
        Check 7/13 error: data.tls_certificate.test: Attribute 'certificates.0.sha1_fingerprint' expected "a053375bfe84e8b748782c7cee[15](https://github.com/hashicorp/terraform-provider-tls/actions/runs/9274693692/job/25517663483#step:5:16)827a6af5a405", got "933c6ddee95c9c41a40f9f50493d82be03ad87bf"
        Check 8/13 error: data.tls_certificate.test: Attribute 'certificates.1.issuer' expected "CN=R3,O=Let's Encrypt,C=US", got "CN=ISRG Root X1,O=Internet Security Research Group,C=US"
        Check 10/13 error: data.tls_certificate.test: Attribute 'certificates.1.subject' expected "CN=www.terraform.io", got "CN=R3,O=Let's Encrypt,C=US"
        Check 13/13 error: data.tls_certificate.test: Attribute 'certificates.1.is_ca' expected "false", got "true"
--- FAIL: TestAccDataSourceCertificate_TerraformIO (0.33s)

=== RUN   TestDataSourceCertificate_UnknownComputedCertificatesUntilApplied
    data_source_certificate_test.go:632: Step 1/1 error: Check failed: Check 1/6 error: data.tls_certificate.test: Attribute 'certificates.#' expected "2", got "3"
        Check 2/6 error: data.tls_certificate.test: Attribute 'certificates.0.issuer' expected "CN=ISRG Root X1,O=Internet Security Research Group,C=US", got "CN=DST Root CA X3,O=Digital Signature Trust Co."
        Check 3/6 error: data.tls_certificate.test: Attribute 'certificates.0.subject' expected "CN=R3,O=Let's Encrypt,C=US", got "CN=ISRG Root X1,O=Internet Security Research Group,C=US"
        Check 4/6 error: data.tls_certificate.test: Attribute 'certificates.1.issuer' expected "CN=R3,O=Let's Encrypt,C=US", got "CN=ISRG Root X1,O=Internet Security Research Group,C=US"
        Check 6/6 error: data.tls_certificate.test: Attribute 'certificates.1.subject' expected "CN=www.terraform.io", got "CN=R3,O=Let's Encrypt,C=US"
--- FAIL: TestDataSourceCertificate_UnknownComputedCertificatesUntilApplied (0.50s)

Steps to Reproduce

  1. terraform apply

How much impact is this issue causing?

Low

Logs

No response

Additional Information

Similar to #516, except we likely want to keep these tests as-is (since real world testing is important for this provider) and just update the value checks. We could potentially loosen those checks slightly to allow for SSL certificate updates without failing these acceptance tests.

Code of Conduct

  • I agree to follow this project's Code of Conduct
bflad added a commit that referenced this issue May 28, 2024
…ficate change

Reference: #523

This change updates the value testing of www.terraform.io certificates to match the updated certificate chain. This testing is important for verifying the behavior of the data source with real world information, such as ensuring Go version or dependency upgrades do not introduce unexpected regressions.
bflad added a commit that referenced this issue May 28, 2024
…ficate change (#524)

Reference: #523

This change updates the value testing of www.terraform.io certificates to match the updated certificate chain. This testing is important for verifying the behavior of the data source with real world information, such as ensuring Go version or dependency upgrades do not introduce unexpected regressions.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant