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