github.com/mohanarpit/terraform@v0.6.16-0.20160909104007-291f29853544/builtin/providers/digitalocean/import_digitalocean_domain_test.go (about) 1 package digitalocean 2 3 import ( 4 "testing" 5 6 "fmt" 7 8 "github.com/hashicorp/terraform/helper/acctest" 9 "github.com/hashicorp/terraform/helper/resource" 10 ) 11 12 func TestAccDigitalOceanDomain_importBasic(t *testing.T) { 13 resourceName := "digitalocean_domain.foobar" 14 domainName := fmt.Sprintf("foobar-test-terraform-%s.com", acctest.RandString(10)) 15 16 resource.Test(t, resource.TestCase{ 17 PreCheck: func() { testAccPreCheck(t) }, 18 Providers: testAccProviders, 19 CheckDestroy: testAccCheckDigitalOceanDomainDestroy, 20 Steps: []resource.TestStep{ 21 resource.TestStep{ 22 Config: fmt.Sprintf(testAccCheckDigitalOceanDomainConfig_basic, domainName), 23 }, 24 25 resource.TestStep{ 26 ResourceName: resourceName, 27 ImportState: true, 28 ImportStateVerify: true, 29 ImportStateVerifyIgnore: []string{ 30 "ip_address"}, //we ignore the IP Address as we do not set to state 31 }, 32 }, 33 }) 34 }