mirror of https://github.com/hashicorp/terraform
provider/azurerm: support importing of subnet resource (#9646)
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMSubnet -timeout 120m === RUN TestAccAzureRMSubnet_importBasic --- PASS: TestAccAzureRMSubnet_importBasic (165.04s) === RUN TestAccAzureRMSubnet_basic --- PASS: TestAccAzureRMSubnet_basic (165.39s) === RUN TestAccAzureRMSubnet_disappears --- PASS: TestAccAzureRMSubnet_disappears (170.02s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 500.533spull/9649/head
parent
1619a8138f
commit
d920105440
@ -0,0 +1,33 @@
|
||||
package azurerm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/acctest"
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
)
|
||||
|
||||
func TestAccAzureRMSubnet_importBasic(t *testing.T) {
|
||||
resourceName := "azurerm_subnet.test"
|
||||
|
||||
ri := acctest.RandInt()
|
||||
config := fmt.Sprintf(testAccAzureRMSubnet_basic, ri, ri, ri)
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testCheckAzureRMSubnetDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: config,
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
ResourceName: resourceName,
|
||||
ImportState: true,
|
||||
ImportStateVerify: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Loading…
Reference in new issue