Skip to content

Commit

Permalink
provider/acme: Remove CSR subject test function
Browse files Browse the repository at this point in the history
Won't need this as previously mentioned (LE/boulder does not write
subject info to certs), so it's just wasting LOC.
  • Loading branch information
Chris Marchesi committed Jun 9, 2016
1 parent 35b0e3b commit f9d0c75
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions builtin/providers/acme/resource_acme_certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,36 +112,6 @@ func testAccCheckACMECertificateValid(n, cn, san string) resource.TestCheckFunc
}
}

func testAccCheckACMECertificateCSRSubject(n string) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
if !ok {
return fmt.Errorf("Can't find ACME certificate: %s", n)
}

if rs.Primary.ID == "" {
return fmt.Errorf("ACME certificate ID not set")
}

cert := rs.Primary.Attributes["certificate_pem"]

x509Certs, err := parsePEMBundle([]byte(cert))
if err != nil {
return err
}
x509Cert := x509Certs[0]

expectedOrg := []string{"ACME Examples, Inc"}
actualOrg := x509Cert.Subject.Organization

if reflect.DeepEqual(expectedOrg, actualOrg) != true {
return fmt.Errorf("Expected org to be %#v, got %#v", expectedOrg, actualOrg)
}

return nil
}
}

func testAccCheckACMECertificateDestroy(s *terraform.State) error {
for _, rs := range s.RootModule().Resources {
if rs.Type != "acme_certificate" {
Expand Down

0 comments on commit f9d0c75

Please sign in to comment.