mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-07 22:53:08 -06:00
874ec8b5cf
* Fixing the indentation * Adding the Container Registry SDK * Implementing the container registry * Enabling the provider / registering the Resource Provider * Acceptance Tests * Documentation for Container Registry * Fixing the name validation * Validation for the Container Registry Name * Added Import support for Containr Registry * Storage Account is no longer optional * Updating the docs * Forcing a re-run in Travis
62 lines
1.5 KiB
Go
62 lines
1.5 KiB
Go
package azurerm
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccAzureRMContainerRegistry_importBasic(t *testing.T) {
|
|
resourceName := "azurerm_container_registry.test"
|
|
|
|
ri := acctest.RandInt()
|
|
rs := acctest.RandString(4)
|
|
config := fmt.Sprintf(testAccAzureRMContainerRegistry_basic, ri, rs, ri)
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testCheckAzureRMContainerRegistryDestroy,
|
|
Steps: []resource.TestStep{
|
|
{
|
|
Config: config,
|
|
},
|
|
|
|
{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
ImportStateVerifyIgnore: []string{"storage_account"},
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
func TestAccAzureRMContainerRegistry_importComplete(t *testing.T) {
|
|
resourceName := "azurerm_container_registry.test"
|
|
|
|
ri := acctest.RandInt()
|
|
rs := acctest.RandString(4)
|
|
config := fmt.Sprintf(testAccAzureRMContainerRegistry_complete, ri, rs, ri)
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testCheckAzureRMContainerRegistryDestroy,
|
|
Steps: []resource.TestStep{
|
|
{
|
|
Config: config,
|
|
},
|
|
|
|
{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
ImportStateVerifyIgnore: []string{"storage_account"},
|
|
},
|
|
},
|
|
})
|
|
}
|