mirror of https://github.com/hashicorp/terraform
Also included the randomizing of the storage account and resource group names ``` % make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMStorageAccount_' ==> 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=TestAccAzureRMStorageAccount_ -timeout 120m === RUN TestAccAzureRMStorageAccount_importBasic --- PASS: TestAccAzureRMStorageAccount_importBasic (141.66s) === RUN TestAccAzureRMStorageAccount_basic --- PASS: TestAccAzureRMStorageAccount_basic (160.18s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 301.852s ```pull/7621/head
parent
9018e073fb
commit
ddf8cde450
@ -0,0 +1,36 @@
|
||||
package azurerm
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/acctest"
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
)
|
||||
|
||||
func TestAccAzureRMStorageAccount_importBasic(t *testing.T) {
|
||||
resourceName := "azurerm_storage_account.testsa"
|
||||
|
||||
ri := acctest.RandInt()
|
||||
rs := acctest.RandString(4)
|
||||
config := fmt.Sprintf(testAccAzureRMStorageAccount_basic, ri, rs)
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testCheckAzureRMStorageAccountDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: config,
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
ResourceName: resourceName,
|
||||
ImportState: true,
|
||||
ImportStateVerify: true,
|
||||
ImportStateVerifyIgnore: []string{"resource_group_name"},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Loading…
Reference in new issue