mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-07 22:53:08 -06:00
f78f0434cd
``` % make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMAvailabilitySet_' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) TF_ACC=1 go test ./builtin/providers/azurerm -v -run=TestAccAzureRMAvailabilitySet_ -timeout 120m === RUN TestAccAzureRMAvailabilitySet_importBasic --- PASS: TestAccAzureRMAvailabilitySet_importBasic (150.75s) === RUN TestAccAzureRMAvailabilitySet_basic --- PASS: TestAccAzureRMAvailabilitySet_basic (103.37s) === RUN TestAccAzureRMAvailabilitySet_withTags --- PASS: TestAccAzureRMAvailabilitySet_withTags (137.65s) === RUN TestAccAzureRMAvailabilitySet_withDomainCounts --- PASS: TestAccAzureRMAvailabilitySet_withDomainCounts (88.78s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 480.564s ```
37 lines
863 B
Go
37 lines
863 B
Go
package azurerm
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"fmt"
|
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccAzureRMAvailabilitySet_importBasic(t *testing.T) {
|
|
resourceName := "azurerm_availability_set.test"
|
|
|
|
ri := acctest.RandInt()
|
|
config := fmt.Sprintf(testAccAzureRMVAvailabilitySet_basic, ri, ri)
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testCheckAzureRMAvailabilitySetDestroy,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: config,
|
|
},
|
|
|
|
resource.TestStep{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
ImportStateVerifyIgnore: []string{"resource_group_name"},
|
|
//this isn't returned from the API!
|
|
},
|
|
},
|
|
})
|
|
}
|