terraform/builtin/providers/digitalocean/import_digitalocean_volume_...

33 lines
736 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{
{
Config: fmt.Sprintf(testAccCheckDigitalOceanVolumeConfig_basic, volumeName),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}