2016-06-29 21:28:47 +02:00
|
|
|
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{
|
2017-01-20 18:47:54 +01:00
|
|
|
{
|
2016-06-29 21:28:47 +02:00
|
|
|
Config: testAccCheckDigitalOceanDropletConfig_basic,
|
|
|
|
},
|
|
|
|
|
2017-01-20 18:47:54 +01:00
|
|
|
{
|
2016-06-29 21:28:47 +02:00
|
|
|
ResourceName: resourceName,
|
|
|
|
ImportState: true,
|
|
|
|
ImportStateVerify: true,
|
|
|
|
ImportStateVerifyIgnore: []string{
|
2016-10-25 12:40:56 +02:00
|
|
|
"ssh_keys", "user_data", "resize_disk"}, //we ignore the ssh_keys, resize_disk and user_data as we do not set to state
|
2016-06-29 21:28:47 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|