Skip to content

Commit

Permalink
provider/aws: use random cert name in ELB test
Browse files Browse the repository at this point in the history
  • Loading branch information
phinze committed Jan 11, 2016
1 parent 6d1d46c commit 771fba4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions builtin/providers/aws/resource_aws_elb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/elb"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
)
Expand Down Expand Up @@ -185,7 +186,8 @@ func TestAccAWSELB_iam_server_cert(t *testing.T) {
CheckDestroy: testAccCheckAWSELBDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccELBIAMServerCertConfig,
Config: testAccELBIAMServerCertConfig(
fmt.Sprintf("tf-acctest-%s", acctest.RandString(10))),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSELBExists("aws_elb.bar", &conf),
testCheck,
Expand Down Expand Up @@ -994,9 +996,10 @@ resource "aws_security_group" "bar" {

// This IAM Server config is lifted from
// builtin/providers/aws/resource_aws_iam_server_certificate_test.go
var testAccELBIAMServerCertConfig = `
func testAccELBIAMServerCertConfig(certName string) string {
return fmt.Sprintf(`
resource "aws_iam_server_certificate" "test_cert" {
name = "terraform-test-cert-elb"
name = "%s"
certificate_body = <<EOF
-----BEGIN CERTIFICATE-----
MIIDCDCCAfACAQEwDQYJKoZIhvcNAQELBQAwgY4xCzAJBgNVBAYTAlVTMREwDwYD
Expand Down Expand Up @@ -1083,4 +1086,5 @@ resource "aws_elb" "bar" {
cross_zone_load_balancing = true
}
`
`, certName)
}

0 comments on commit 771fba4

Please sign in to comment.