diff options
author | Thomas Hipp <thipp@suse.de> | 2017-04-06 15:22:20 +0200 |
---|---|---|
committer | Thomas Hipp <thipp@suse.de> | 2017-06-16 16:40:10 +0200 |
commit | bfe8ef8af82bd722e4a879cfe0111ee4614bafa5 (patch) | |
tree | 59cedf9df6418eae34c5d46da13d1891e6d493fb /libvirt/resource_libvirt_volume_test.go | |
parent | 919ee121eb8230f479d72ebd1fe527f532c1de48 (diff) | |
download | terraform-provider-libvirt-bfe8ef8af82bd722e4a879cfe0111ee4614bafa5.tar terraform-provider-libvirt-bfe8ef8af82bd722e4a879cfe0111ee4614bafa5.tar.gz |
use official libvirt-go bindings
Signed-off-by: Thomas Hipp <thipp@suse.de>
Diffstat (limited to 'libvirt/resource_libvirt_volume_test.go')
-rw-r--r-- | libvirt/resource_libvirt_volume_test.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libvirt/resource_libvirt_volume_test.go b/libvirt/resource_libvirt_volume_test.go index 03be51a4..99fc9608 100644 --- a/libvirt/resource_libvirt_volume_test.go +++ b/libvirt/resource_libvirt_volume_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - libvirt "github.com/dmacvicar/libvirt-go" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" + libvirt "github.com/libvirt/libvirt-go" ) func testAccCheckLibvirtVolumeDestroy(s *terraform.State) error { @@ -28,7 +28,7 @@ func testAccCheckLibvirtVolumeDestroy(s *terraform.State) error { return nil } -func testAccCheckLibvirtVolumeExists(n string, volume *libvirt.VirStorageVol) resource.TestCheckFunc { +func testAccCheckLibvirtVolumeExists(n string, volume *libvirt.StorageVol) resource.TestCheckFunc { return func(s *terraform.State) error { virConn := testAccProvider.Meta().(*Client).libvirt @@ -56,13 +56,13 @@ func testAccCheckLibvirtVolumeExists(n string, volume *libvirt.VirStorageVol) re return fmt.Errorf("Resource ID and volume key does not match") } - *volume = retrievedVol + *volume = *retrievedVol return nil } } -func testAccCheckLibvirtVolumeDoesNotExists(n string, volume *libvirt.VirStorageVol) resource.TestCheckFunc { +func testAccCheckLibvirtVolumeDoesNotExists(n string, volume *libvirt.StorageVol) resource.TestCheckFunc { return func(s *terraform.State) error { virConn := testAccProvider.Meta().(*Client).libvirt @@ -72,10 +72,9 @@ func testAccCheckLibvirtVolumeDoesNotExists(n string, volume *libvirt.VirStorage } vol, err := virConn.LookupStorageVolByKey(key) - defer vol.Free() if err == nil { + vol.Free() return fmt.Errorf("Volume '%s' still exists", key) - } return nil @@ -83,7 +82,7 @@ func testAccCheckLibvirtVolumeDoesNotExists(n string, volume *libvirt.VirStorage } func TestAccLibvirtVolume_Basic(t *testing.T) { - var volume libvirt.VirStorageVol + var volume libvirt.StorageVol const testAccCheckLibvirtVolumeConfig_basic = ` resource "libvirt_volume" "terraform-acceptance-test-1" { @@ -111,7 +110,7 @@ func TestAccLibvirtVolume_Basic(t *testing.T) { } func TestAccLibvirtVolume_DownloadFromSource(t *testing.T) { - var volume libvirt.VirStorageVol + var volume libvirt.StorageVol fws := fileWebServer{} if err := fws.Start(); err != nil { |