provider/aws: removal of the duplicate import aws_iam_instance_profile test

This commit is contained in:
stack72 2016-12-01 16:55:53 +02:00
parent a4dba89553
commit 4e0ebfde3f
No known key found for this signature in database
GPG Key ID: 8619A619B085CB16
2 changed files with 0 additions and 58 deletions

View File

@ -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,
},
},
})
}

View File

@ -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]