mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-27 08:56:25 -06:00
e905aa2840
``` ake testacc TEST=./builtin/providers/digitalocean TESTARGS='-run=TestAccDigitalOceanDroplet_' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /vendor/) TF_ACC=1 go test ./builtin/providers/digitalocean -v -run=TestAccDigitalOceanDroplet_ -timeout 120m === RUN TestAccDigitalOceanDroplet_importBasic --- PASS: TestAccDigitalOceanDroplet_importBasic (39.42s) === RUN TestAccDigitalOceanDroplet_Basic --- PASS: TestAccDigitalOceanDroplet_Basic (38.46s) === RUN TestAccDigitalOceanDroplet_Update --- PASS: TestAccDigitalOceanDroplet_Update (244.82s) === RUN TestAccDigitalOceanDroplet_UpdateUserData --- PASS: TestAccDigitalOceanDroplet_UpdateUserData (73.05s) === RUN TestAccDigitalOceanDroplet_PrivateNetworkingIpv6 --- PASS: TestAccDigitalOceanDroplet_PrivateNetworkingIpv6 (67.24s) PASS ```
31 lines
763 B
Go
31 lines
763 B
Go
package digitalocean
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccDigitalOceanDroplet_importBasic(t *testing.T) {
|
|
resourceName := "digitalocean_droplet.foobar"
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckDigitalOceanDropletDestroy,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: testAccCheckDigitalOceanDropletConfig_basic,
|
|
},
|
|
|
|
resource.TestStep{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
ImportStateVerifyIgnore: []string{
|
|
"ssh_keys", "user_data"}, //we ignore the ssh_keys and user_data as we do not set to state
|
|
},
|
|
},
|
|
})
|
|
}
|