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

tests/ec2: Add ErrorCheck (Resources Part 2) #18154

Merged
merged 10 commits into from
Mar 18, 2021
1 change: 1 addition & 0 deletions aws/resource_aws_ebs_default_kms_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func TestAccAWSEBSDefaultKmsKey_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEbsDefaultKmsKeyDestroy,
Steps: []resource.TestStep{
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_ebs_encryption_by_default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func TestAccAWSEBSEncryptionByDefault_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEncryptionByDefaultDestroy,
Steps: []resource.TestStep{
Expand Down
6 changes: 6 additions & 0 deletions aws/resource_aws_ebs_snapshot_copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func TestAccAWSEbsSnapshotCopy_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEbsSnapshotCopyDestroy,
Steps: []resource.TestStep{
Expand All @@ -39,6 +40,7 @@ func TestAccAWSEbsSnapshotCopy_tags(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEbsSnapshotCopyDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -77,6 +79,7 @@ func TestAccAWSEbsSnapshotCopy_withDescription(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEbsSnapshotCopyDestroy,
Steps: []resource.TestStep{
Expand All @@ -101,6 +104,7 @@ func TestAccAWSEbsSnapshotCopy_withRegions(t *testing.T) {
testAccPreCheck(t)
testAccMultipleRegionPreCheck(t, 2)
},
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
CheckDestroy: testAccCheckEbsSnapshotCopyDestroy,
Steps: []resource.TestStep{
Expand All @@ -122,6 +126,7 @@ func TestAccAWSEbsSnapshotCopy_withKms(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEbsSnapshotCopyDestroy,
Steps: []resource.TestStep{
Expand All @@ -142,6 +147,7 @@ func TestAccAWSEbsSnapshotCopy_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEbsSnapshotCopyDestroy,
Steps: []resource.TestStep{
Expand Down
5 changes: 5 additions & 0 deletions aws/resource_aws_ebs_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestAccAWSEBSSnapshot_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEbsSnapshotDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -47,6 +48,7 @@ func TestAccAWSEBSSnapshot_tags(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEbsSnapshotDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -91,6 +93,7 @@ func TestAccAWSEBSSnapshot_withDescription(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEbsSnapshotDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -118,6 +121,7 @@ func TestAccAWSEBSSnapshot_withKms(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEbsSnapshotDestroy,
Steps: []resource.TestStep{
Expand All @@ -144,6 +148,7 @@ func TestAccAWSEBSSnapshot_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEbsSnapshotDestroy,
Steps: []resource.TestStep{
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_ec2_availability_zone_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestAccAWSEc2AvailabilityZoneGroup_OptInStatus(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2AvailabilityZoneGroup(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: nil,
Steps: []resource.TestStep{
Expand Down
11 changes: 11 additions & 0 deletions aws/resource_aws_ec2_capacity_reservation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func TestAccAWSEc2CapacityReservation_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEc2CapacityReservationDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -108,6 +109,7 @@ func TestAccAWSEc2CapacityReservation_ebsOptimized(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEc2CapacityReservationDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -135,6 +137,7 @@ func TestAccAWSEc2CapacityReservation_endDate(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEc2CapacityReservationDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -170,6 +173,7 @@ func TestAccAWSEc2CapacityReservation_endDateType(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEc2CapacityReservationDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -210,6 +214,7 @@ func TestAccAWSEc2CapacityReservation_ephemeralStorage(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEc2CapacityReservationDestroy,
Steps: []resource.TestStep{
Expand All @@ -235,6 +240,7 @@ func TestAccAWSEc2CapacityReservation_instanceCount(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEc2CapacityReservationDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -267,6 +273,7 @@ func TestAccAWSEc2CapacityReservation_instanceMatchCriteria(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEc2CapacityReservationDestroy,
Steps: []resource.TestStep{
Expand All @@ -292,6 +299,7 @@ func TestAccAWSEc2CapacityReservation_instanceType(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEc2CapacityReservationDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -324,6 +332,7 @@ func TestAccAWSEc2CapacityReservation_tags(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEc2CapacityReservationDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -367,6 +376,7 @@ func TestAccAWSEc2CapacityReservation_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEc2CapacityReservationDestroy,
Steps: []resource.TestStep{
Expand All @@ -390,6 +400,7 @@ func TestAccAWSEc2CapacityReservation_tenancy(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckEc2CapacityReservationDestroy,
Steps: []resource.TestStep{
Expand Down
4 changes: 4 additions & 0 deletions aws/resource_aws_ec2_client_vpn_authorization_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func testAccAwsEc2ClientVpnAuthorizationRule_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnAuthorizationRuleDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -65,6 +66,7 @@ func testAccAwsEc2ClientVpnAuthorizationRule_groups(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnAuthorizationRuleDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -135,6 +137,7 @@ func testAccAwsEc2ClientVpnAuthorizationRule_Subnets(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnAuthorizationRuleDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -177,6 +180,7 @@ func testAccAwsEc2ClientVpnAuthorizationRule_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnAuthorizationRuleDestroy,
Steps: []resource.TestStep{
Expand Down
9 changes: 9 additions & 0 deletions aws/resource_aws_ec2_client_vpn_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ func testAccAwsEc2ClientVpnEndpoint_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -165,6 +166,7 @@ func testAccAwsEc2ClientVpnEndpoint_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy,
Steps: []resource.TestStep{
Expand All @@ -187,6 +189,7 @@ func testAccAwsEc2ClientVpnEndpoint_msAD(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -214,6 +217,7 @@ func testAccAwsEc2ClientVpnEndpoint_mutualAuthAndMsAD(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -242,6 +246,7 @@ func testAccAwsEc2ClientVpnEndpoint_federated(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckClientVPNSyncronize(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -271,6 +276,7 @@ func testAccAwsEc2ClientVpnEndpoint_withLogGroup(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -306,6 +312,7 @@ func testAccAwsEc2ClientVpnEndpoint_withDNSServers(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy,
Steps: []resource.TestStep{
Expand All @@ -332,6 +339,7 @@ func testAccAwsEc2ClientVpnEndpoint_tags(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -374,6 +382,7 @@ func testAccAwsEc2ClientVpnEndpoint_splitTunnel(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy,
Steps: []resource.TestStep{
Expand Down
3 changes: 3 additions & 0 deletions aws/resource_aws_ec2_client_vpn_network_association_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func testAccAwsEc2ClientVpnNetworkAssociation_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnNetworkAssociationDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -138,6 +139,7 @@ func testAccAwsEc2ClientVpnNetworkAssociation_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnNetworkAssociationDestroy,
Steps: []resource.TestStep{
Expand All @@ -163,6 +165,7 @@ func testAccAwsEc2ClientVpnNetworkAssociation_securityGroups(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckClientVPNSyncronize(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsEc2ClientVpnNetworkAssociationDestroy,
Steps: []resource.TestStep{
Expand Down
Loading