github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/opc/import_acl_test.go (about) 1 package opc 2 3 import ( 4 "fmt" 5 "testing" 6 7 "github.com/hashicorp/terraform/helper/acctest" 8 "github.com/hashicorp/terraform/helper/resource" 9 ) 10 11 func TestAccOPCACL_importBasic(t *testing.T) { 12 resourceName := "opc_compute_acl.test" 13 14 ri := acctest.RandInt() 15 config := fmt.Sprintf(testAccACLBasic, ri) 16 17 resource.Test(t, resource.TestCase{ 18 PreCheck: func() { 19 testAccPreCheck(t) 20 }, 21 Providers: testAccProviders, 22 CheckDestroy: testAccCheckACLDestroy, 23 Steps: []resource.TestStep{ 24 { 25 Config: config, 26 }, 27 { 28 ResourceName: resourceName, 29 ImportState: true, 30 ImportStateVerify: true, 31 }, 32 }, 33 }) 34 } 35 func TestAccOPCACL_importDisabled(t *testing.T) { 36 resourceName := "opc_compute_acl.test" 37 38 ri := acctest.RandInt() 39 config := fmt.Sprintf(testAccACLDisabled, ri) 40 41 resource.Test(t, resource.TestCase{ 42 PreCheck: func() { 43 testAccPreCheck(t) 44 }, 45 Providers: testAccProviders, 46 CheckDestroy: testAccCheckACLDestroy, 47 Steps: []resource.TestStep{ 48 { 49 Config: config, 50 }, 51 { 52 ResourceName: resourceName, 53 ImportState: true, 54 ImportStateVerify: true, 55 }, 56 }, 57 }) 58 }