opentofu/builtin/providers/digitalocean/import_digitalocean_volume_test.go
Antoine Grondin 3d6fe76b52 provider/digitalocean: adds a volume resource (#7560)
* provider/digitalocean: add support for volumes

* provider/digitalocean: add documentation for volume resource
2016-07-13 15:36:37 +01:00

33 lines
770 B
Go

package digitalocean
import (
"testing"
"fmt"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccDigitalOceanVolume_importBasic(t *testing.T) {
resourceName := "digitalocean_volume.foobar"
volumeName := fmt.Sprintf("volume-%s", acctest.RandString(10))
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckDigitalOceanVolumeDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: fmt.Sprintf(testAccCheckDigitalOceanVolumeConfig_basic, volumeName),
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}