Skip to content

Commit

Permalink
move code to configure provider to common function
Browse files Browse the repository at this point in the history
  • Loading branch information
dmacvicar committed Oct 2, 2024
1 parent 42b43e7 commit 0248094
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libvirt/resource_libvirt_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ func testAccPreCheckSupportsLogicalPool(t *testing.T) {
XMLName xml.Name `xml:"storagepoolCapabilities"`
}

// we need the plugin configured before we can test for support for lvm pools.
diag := testAccProvider.Configure(context.Background(), terraform.NewResourceConfigRaw(nil))
if diag.HasError() {
t.Fatal("error configuring provider")
}

client := testAccProvider.Meta().(*Client)

respStr, err := client.libvirt.ConnectGetStoragePoolCapabilities(0)
Expand Down Expand Up @@ -220,12 +226,6 @@ func TestAccLibvirtPool_LVMBasic(t *testing.T) {
randomPoolResource := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
randomPoolName := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)

// we need the plugin configured before we can test for support for lvm pools.
diag := testAccProvider.Configure(context.Background(), terraform.NewResourceConfigRaw(nil))
if diag.HasError() {
t.Fatal("error configuring provider")
}

testAccPreCheckSupportsLogicalPool(t)

blockDev, err := testhelper.CreateTempLoopDevice(t, randomPoolName)
Expand Down

0 comments on commit 0248094

Please sign in to comment.