From 4e0ebfde3fda8a624b9cbfe0c89b8f2575211a07 Mon Sep 17 00:00:00 2001 From: stack72 Date: Thu, 1 Dec 2016 16:55:53 +0200 Subject: [PATCH] provider/aws: removal of the duplicate import aws_iam_instance_profile test --- .../import_aws_iam_instance_profile_test.go | 28 ----------------- .../aws/resource_aws_iam_policy_test.go | 30 ------------------- 2 files changed, 58 deletions(-) delete mode 100644 builtin/providers/aws/import_aws_iam_instance_profile_test.go diff --git a/builtin/providers/aws/import_aws_iam_instance_profile_test.go b/builtin/providers/aws/import_aws_iam_instance_profile_test.go deleted file mode 100644 index 191f9ac85..000000000 --- a/builtin/providers/aws/import_aws_iam_instance_profile_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package aws - -import ( - "testing" - - "github.com/hashicorp/terraform/helper/resource" -) - -func TestAccAWSIAMInstanceProfile_importBasic(t *testing.T) { - resourceName := "aws_iam_instance_profile.test" - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSInstanceProfileDestroy, - Steps: []resource.TestStep{ - resource.TestStep{ - Config: testAccAwsIamInstanceProfileConfig, - }, - - resource.TestStep{ - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} diff --git a/builtin/providers/aws/resource_aws_iam_policy_test.go b/builtin/providers/aws/resource_aws_iam_policy_test.go index cc6333748..ce52d5067 100644 --- a/builtin/providers/aws/resource_aws_iam_policy_test.go +++ b/builtin/providers/aws/resource_aws_iam_policy_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" @@ -32,35 +31,6 @@ func TestAWSPolicy_namePrefix(t *testing.T) { }) } -func testAccCheckAWSPolicyDestroy(s *terraform.State) error { - iamconn := testAccProvider.Meta().(*AWSClient).iamconn - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_iam_policy" { - continue - } - - // Try to get policy - _, err := iamconn.GetPolicy(&iam.GetPolicyInput{ - PolicyArn: aws.String(rs.Primary.Attributes["arn"]), - }) - if err == nil { - return fmt.Errorf("still exist.") - } - - // Verify the error is what we want - ec2err, ok := err.(awserr.Error) - if !ok { - return err - } - if ec2err.Code() != "NoSuchEntity" { - return err - } - } - - return nil -} - func testAccCheckAWSPolicyExists(resource string, res *iam.GetPolicyOutput) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[resource]