mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-25 16:06:25 -06:00
70578d4e99
``` make testacc TEST=./builtin/providers/digitalocean TESTARGS='-run=TestAccDigitalOceanFloatingIP_' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /vendor/) TF_ACC=1 go test ./builtin/providers/digitalocean -v -run=TestAccDigitalOceanFloatingIP_ -timeout 120m === RUN TestAccDigitalOceanFloatingIP_importBasicRegion --- PASS: TestAccDigitalOceanFloatingIP_importBasicRegion (3.76s) === RUN TestAccDigitalOceanFloatingIP_importBasicDroplet --- PASS: TestAccDigitalOceanFloatingIP_importBasicDroplet (72.41s) === RUN TestAccDigitalOceanFloatingIP_Region --- PASS: TestAccDigitalOceanFloatingIP_Region (3.46s) === RUN TestAccDigitalOceanFloatingIP_Droplet --- PASS: TestAccDigitalOceanFloatingIP_Droplet (74.49s) PASS ok github.com/hashicorp/terraform/builtin/providers/digitalocean 154.128s ```
50 lines
1.2 KiB
Go
50 lines
1.2 KiB
Go
package digitalocean
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccDigitalOceanFloatingIP_importBasicRegion(t *testing.T) {
|
|
resourceName := "digitalocean_floating_ip.foobar"
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckDigitalOceanFloatingIPDestroy,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: testAccCheckDigitalOceanFloatingIPConfig_region,
|
|
},
|
|
|
|
resource.TestStep{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
func TestAccDigitalOceanFloatingIP_importBasicDroplet(t *testing.T) {
|
|
resourceName := "digitalocean_floating_ip.foobar"
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckDigitalOceanFloatingIPDestroy,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: testAccCheckDigitalOceanFloatingIPConfig_droplet,
|
|
},
|
|
|
|
resource.TestStep{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
},
|
|
},
|
|
})
|
|
}
|