mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-28 17:34:24 -06:00
ff60fa3aa1
``` % make testacc TEST=./builtin/providers/digitalocean % TESTARGS='-run=TestAccDigitalOceanDroplet_importBasic' % 2 ↵ ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2016/10/25 11:39:26 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/digitalocean -v -run=TestAccDigitalOceanDroplet_importBasic -timeout 120m === RUN TestAccDigitalOceanDroplet_importBasic --- PASS: TestAccDigitalOceanDroplet_importBasic (56.04s) PASS ok github.com/hashicorp/terraform/builtin/providers/digitalocean56.049s ```
31 lines
791 B
Go
31 lines
791 B
Go
package digitalocean
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccDigitalOceanDroplet_importBasic(t *testing.T) {
|
|
resourceName := "digitalocean_droplet.foobar"
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckDigitalOceanDropletDestroy,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: testAccCheckDigitalOceanDropletConfig_basic,
|
|
},
|
|
|
|
resource.TestStep{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
ImportStateVerifyIgnore: []string{
|
|
"ssh_keys", "user_data", "resize_disk"}, //we ignore the ssh_keys, resize_disk and user_data as we do not set to state
|
|
},
|
|
},
|
|
})
|
|
}
|