add metadata test and acc test
parent
d498ee9973
commit
ed405dfbcd
|
@ -0,0 +1,30 @@
|
|||
package azurerm_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/cloudskiff/driftctl/test"
|
||||
"github.com/cloudskiff/driftctl/test/acceptance"
|
||||
)
|
||||
|
||||
func TestAcc_Azure_PrivateDNSCNAMERecord(t *testing.T) {
|
||||
acceptance.Run(t, acceptance.AccTestCase{
|
||||
TerraformVersion: "0.15.5",
|
||||
Paths: []string{"./testdata/acc/azurerm_private_dns_cname_record"},
|
||||
Args: []string{
|
||||
"scan",
|
||||
"--to", "azure+tf", "--deep",
|
||||
},
|
||||
Checks: []acceptance.AccCheck{
|
||||
{
|
||||
Check: func(result *test.ScanResult, stdout string, err error) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
result.AssertInfrastructureIsInSync()
|
||||
result.AssertManagedCount(2)
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
|
@ -11,25 +11,26 @@ import (
|
|||
|
||||
func TestAzureMetadata_Flags(t *testing.T) {
|
||||
testcases := map[string][]resource.Flags{
|
||||
AzureContainerRegistryResourceType: {},
|
||||
AzureFirewallResourceType: {},
|
||||
AzurePostgresqlServerResourceType: {},
|
||||
AzurePostgresqlDatabaseResourceType: {},
|
||||
AzurePublicIPResourceType: {},
|
||||
AzureResourceGroupResourceType: {},
|
||||
AzureRouteResourceType: {},
|
||||
AzureRouteTableResourceType: {},
|
||||
AzureStorageAccountResourceType: {},
|
||||
AzureStorageContainerResourceType: {},
|
||||
AzureSubnetResourceType: {},
|
||||
AzureVirtualNetworkResourceType: {},
|
||||
AzureNetworkSecurityGroupResourceType: {resource.FlagDeepMode},
|
||||
AzureLoadBalancerResourceType: {},
|
||||
AzurePrivateDNSZoneResourceType: {resource.FlagDeepMode},
|
||||
AzurePrivateDNSARecordResourceType: {resource.FlagDeepMode},
|
||||
AzurePrivateDNSAAAARecordResourceType: {resource.FlagDeepMode},
|
||||
AzureImageResourceType: {},
|
||||
AzureSSHPublicKeyResourceType: {resource.FlagDeepMode},
|
||||
AzureContainerRegistryResourceType: {},
|
||||
AzureFirewallResourceType: {},
|
||||
AzurePostgresqlServerResourceType: {},
|
||||
AzurePostgresqlDatabaseResourceType: {},
|
||||
AzurePublicIPResourceType: {},
|
||||
AzureResourceGroupResourceType: {},
|
||||
AzureRouteResourceType: {},
|
||||
AzureRouteTableResourceType: {},
|
||||
AzureStorageAccountResourceType: {},
|
||||
AzureStorageContainerResourceType: {},
|
||||
AzureSubnetResourceType: {},
|
||||
AzureVirtualNetworkResourceType: {},
|
||||
AzureNetworkSecurityGroupResourceType: {resource.FlagDeepMode},
|
||||
AzureLoadBalancerResourceType: {},
|
||||
AzurePrivateDNSZoneResourceType: {resource.FlagDeepMode},
|
||||
AzurePrivateDNSARecordResourceType: {resource.FlagDeepMode},
|
||||
AzurePrivateDNSAAAARecordResourceType: {resource.FlagDeepMode},
|
||||
AzurePrivateDNSCNameRecordResourceType: {resource.FlagDeepMode},
|
||||
AzureImageResourceType: {},
|
||||
AzureSSHPublicKeyResourceType: {resource.FlagDeepMode},
|
||||
}
|
||||
|
||||
schemaRepository := testresource.InitFakeSchemaRepository(tf.AZURE, "2.71.0")
|
||||
|
|
2
pkg/resource/azurerm/testdata/acc/azurerm_private_dns_cname_record/.driftignore
vendored
Normal file
2
pkg/resource/azurerm/testdata/acc/azurerm_private_dns_cname_record/.driftignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!azurerm_private_dns_cname_record
|
36
pkg/resource/azurerm/testdata/acc/azurerm_private_dns_cname_record/terraform.tf
vendored
Normal file
36
pkg/resource/azurerm/testdata/acc/azurerm_private_dns_cname_record/terraform.tf
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
azurerm = {
|
||||
source = "hashicorp/azurerm"
|
||||
version = "~> 2.71.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "azurerm" {
|
||||
features {}
|
||||
}
|
||||
|
||||
data "azurerm_resource_group" "example" {
|
||||
name = "driftctl-qa-1"
|
||||
}
|
||||
|
||||
resource "azurerm_private_dns_zone" "testzone" {
|
||||
name = "this-zone-is-a-test-for-driftctl.com"
|
||||
resource_group_name = data.azurerm_resource_group.example.name
|
||||
}
|
||||
|
||||
resource "azurerm_private_dns_cname_record" "othertestcname" {
|
||||
name = "othertest"
|
||||
zone_name = azurerm_private_dns_zone.testzone.name
|
||||
resource_group_name = data.azurerm_resource_group.example.name
|
||||
ttl = 300
|
||||
record = "othertest.com"
|
||||
}
|
||||
resource "azurerm_private_dns_cname_record" "testcname" {
|
||||
name = "test"
|
||||
zone_name = azurerm_private_dns_zone.testzone.name
|
||||
resource_group_name = data.azurerm_resource_group.example.name
|
||||
ttl = 300
|
||||
record = "test.com"
|
||||
}
|
Loading…
Reference in New Issue