Skip to content

Commit

Permalink
r/aws_security_group: Add 'TestAccEC2SecurityGroup_disappears' (hashi…
Browse files Browse the repository at this point in the history
…corp#13527).

% make testacc TESTARGS='-run=TestAccEC2SecurityGroup_disappears' PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20  -run=TestAccEC2SecurityGroup_basic -timeout 180m
=== RUN   TestAccEC2SecurityGroup_basic
=== PAUSE TestAccEC2SecurityGroup_basic
=== CONT  TestAccEC2SecurityGroup_basic
--- PASS: TestAccEC2SecurityGroup_basic (27.72s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	31.672s
  • Loading branch information
ewbankkit committed Jan 18, 2022
1 parent 25c4af4 commit f45ee16
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions internal/service/ec2/security_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,28 @@ func TestAccEC2SecurityGroup_basic(t *testing.T) {
})
}

func TestAccEC2SecurityGroup_disappears(t *testing.T) {
var group ec2.SecurityGroup
resourceName := "aws_security_group.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID),
Providers: acctest.Providers,
CheckDestroy: testAccCheckSecurityGroupDestroy,
Steps: []resource.TestStep{
{
Config: testAccSecurityGroupConfig,
Check: resource.ComposeTestCheckFunc(
testAccCheckSecurityGroupExists(resourceName, &group),
acctest.CheckResourceDisappears(acctest.Provider, tfec2.ResourceSecurityGroup(), resourceName),
),
ExpectNonEmptyPlan: true,
},
},
})
}

func TestAccEC2SecurityGroup_egressMode(t *testing.T) {
var securityGroup1, securityGroup2, securityGroup3 ec2.SecurityGroup
resourceName := "aws_security_group.test"
Expand Down

0 comments on commit f45ee16

Please sign in to comment.