mirror of https://github.com/hashicorp/terraform
The Id wasn't being set until after the Read func returned from the API. I needed to move that Id set up until just after the Create response returned The same Id's have been set - username ``` make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSUser_' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /vendor/) TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSUser_ -timeout 120m === RUN TestAccAWSUser_importBasic --- PASS: TestAccAWSUser_importBasic (14.24s) === RUN TestAccAWSUser_basic --- PASS: TestAccAWSUser_basic (24.99s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 39.261s ```pull/7290/head
parent
004cec60b3
commit
82529f8029
@ -0,0 +1,28 @@
|
||||
package aws
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
)
|
||||
|
||||
func TestAccAWSUser_importBasic(t *testing.T) {
|
||||
resourceName := "aws_iam_user.user"
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckAWSUserDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccAWSUserConfig,
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
ResourceName: resourceName,
|
||||
ImportState: true,
|
||||
ImportStateVerify: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Loading…
Reference in new issue