2016-06-29 17:10:56 +02:00
|
|
|
package digitalocean
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAccDigitalOceanDomain_importBasic(t *testing.T) {
|
|
|
|
resourceName := "digitalocean_domain.foobar"
|
|
|
|
domainName := fmt.Sprintf("foobar-test-terraform-%s.com", acctest.RandString(10))
|
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
Providers: testAccProviders,
|
|
|
|
CheckDestroy: testAccCheckDigitalOceanDomainDestroy,
|
|
|
|
Steps: []resource.TestStep{
|
2017-01-20 18:47:54 +01:00
|
|
|
{
|
2016-06-29 17:10:56 +02:00
|
|
|
Config: fmt.Sprintf(testAccCheckDigitalOceanDomainConfig_basic, domainName),
|
|
|
|
},
|
|
|
|
|
2017-01-20 18:47:54 +01:00
|
|
|
{
|
2016-06-29 17:10:56 +02:00
|
|
|
ResourceName: resourceName,
|
|
|
|
ImportState: true,
|
|
|
|
ImportStateVerify: true,
|
|
|
|
ImportStateVerifyIgnore: []string{
|
|
|
|
"ip_address"}, //we ignore the IP Address as we do not set to state
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|