mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-06 14:13:16 -06:00
d60b9ab018
cdn_profile resource was using `Profiles` instead of `profiles` to gather the name in the read and delete methods, added importing capability with test to confirm read now works as expected. ``` TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMCdnProfile -timeout 120m === RUN TestAccAzureRMCdnProfile_importWithTags --- PASS: TestAccAzureRMCdnProfile_importWithTags (170.00s) === RUN TestAccAzureRMCdnProfile_basic --- PASS: TestAccAzureRMCdnProfile_basic (166.33s) === RUN TestAccAzureRMCdnProfile_withTags --- PASS: TestAccAzureRMCdnProfile_withTags (185.94s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 522.333s ```
34 lines
727 B
Go
34 lines
727 B
Go
package azurerm
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccAzureRMCdnProfile_importWithTags(t *testing.T) {
|
|
resourceName := "azurerm_cdn_profile.test"
|
|
|
|
ri := acctest.RandInt()
|
|
config := fmt.Sprintf(testAccAzureRMCdnProfile_withTags, ri, ri)
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testCheckAzureRMCdnProfileDestroy,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: config,
|
|
},
|
|
|
|
resource.TestStep{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
},
|
|
},
|
|
})
|
|
}
|