mirror of https://github.com/hashicorp/terraform
provider/digitalocean: Support Import `digitalocean_ssh_key` (#7345)
``` make testacc TEST=./builtin/providers/digitalocean TESTARGS='-run=TestAccDigitalOceanSSHKey_' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /vendor/) TF_ACC=1 go test ./builtin/providers/digitalocean -v -run=TestAccDigitalOceanSSHKey_ -timeout 120m === RUN TestAccDigitalOceanSSHKey_importBasic --- PASS: TestAccDigitalOceanSSHKey_importBasic (2.13s) === RUN TestAccDigitalOceanSSHKey_Basic --- PASS: TestAccDigitalOceanSSHKey_Basic (1.52s) PASS ok github.com/hashicorp/terraform/builtin/providers/digitalocean 3.665s ```pull/7343/head
parent
7a1b78593b
commit
ae2bd7a0ff
@ -0,0 +1,28 @@
|
||||
package digitalocean
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
)
|
||||
|
||||
func TestAccDigitalOceanSSHKey_importBasic(t *testing.T) {
|
||||
resourceName := "digitalocean_ssh_key.foobar"
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckDigitalOceanSSHKeyDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccCheckDigitalOceanSSHKeyConfig_basic,
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
ResourceName: resourceName,
|
||||
ImportState: true,
|
||||
ImportStateVerify: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Loading…
Reference in new issue