From 3cfa1259f82baa76900df0cc5e78bdaabb3a5bae Mon Sep 17 00:00:00 2001 From: Krzysztof Klimonda Date: Thu, 10 Oct 2024 16:51:11 +0200 Subject: [PATCH] Fix acceptance tests that no longer compiled --- .../terraform/test/resource_address_group_test.go | 6 +++--- .../test/resource_ethernet_interface_test.go | 5 ++--- .../test/resource_panorama_template_test.go | 4 ++-- .../resource_panorama_template_variable_test.go | 13 ++++++------- .../terraform/test/resource_virtual_router_test.go | 6 +++--- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/assets/terraform/test/resource_address_group_test.go b/assets/terraform/test/resource_address_group_test.go index 5044a14..dc7bf4a 100644 --- a/assets/terraform/test/resource_address_group_test.go +++ b/assets/terraform/test/resource_address_group_test.go @@ -101,7 +101,7 @@ func makeAddressGroupConfig(label string) string { default = false } - resource "panos_address_objects" "google_dns_servers" { + resource "panos_addresses" "google_dns_servers" { location = { shared = true } @@ -120,7 +120,7 @@ func makeAddressGroupConfig(label string) string { } name = "${var.address_group_name}-base-${var.name_suffix}" - static = [for name, data in resource.panos_address_objects.google_dns_servers.addresses : name] + static = [for name, data in resource.panos_addresses.google_dns_servers.addresses : name] } resource "panos_address_group" "%s" { @@ -133,7 +133,7 @@ func makeAddressGroupConfig(label string) string { static = var.from_address_group ? ( [panos_address_group.%s_base[0].name] ) : ( - [for name, data in resource.panos_address_objects.google_dns_servers.addresses : name] + [for name, data in resource.panos_addresses.google_dns_servers.addresses : name] ) } ` diff --git a/assets/terraform/test/resource_ethernet_interface_test.go b/assets/terraform/test/resource_ethernet_interface_test.go index 2755b04..a0cf309 100644 --- a/assets/terraform/test/resource_ethernet_interface_test.go +++ b/assets/terraform/test/resource_ethernet_interface_test.go @@ -70,7 +70,7 @@ func makePanosEthernetInterface_Layer3(label string) string { variable "ip_addr_netmask" { type = string } variable "template_name" { type = string } - resource "panos_panorama_template" "acc_codegen_template" { + resource "panos_template" "acc_codegen_template" { name = "${var.template_name}-${var.name_suffix}" location = { @@ -84,7 +84,7 @@ func makePanosEthernetInterface_Layer3(label string) string { location = { template = { vsys = "vsys1" - name = panos_panorama_template.acc_codegen_template.name + name = panos_template.acc_codegen_template.name } } @@ -141,4 +141,3 @@ func testAccCheckPanosEthernetInterfaceDestroy(entryName, templateName string) f return nil } } - diff --git a/assets/terraform/test/resource_panorama_template_test.go b/assets/terraform/test/resource_panorama_template_test.go index 38f43f3..635cd3f 100644 --- a/assets/terraform/test/resource_panorama_template_test.go +++ b/assets/terraform/test/resource_panorama_template_test.go @@ -36,7 +36,7 @@ func TestAccPanosTemplate_RequiredInputs(t *testing.T) { }, ConfigStateChecks: []statecheck.StateCheck{ statecheck.ExpectKnownValue( - "panos_panorama_template."+resourceName, + "panos_template."+resourceName, tfjsonpath.New("name"), knownvalue.StringExact(templateName), ), @@ -50,7 +50,7 @@ func makePanosTemplateConfig(label string) string { configTpl := ` variable "template_name" { type = string } - resource "panos_panorama_template" "%s" { + resource "panos_template" "%s" { name = var.template_name location = { diff --git a/assets/terraform/test/resource_panorama_template_variable_test.go b/assets/terraform/test/resource_panorama_template_variable_test.go index 6f568fa..9e5dbd4 100644 --- a/assets/terraform/test/resource_panorama_template_variable_test.go +++ b/assets/terraform/test/resource_panorama_template_variable_test.go @@ -56,17 +56,17 @@ func TestAccPanosPanoramaTemplateVariable(t *testing.T) { }, ConfigStateChecks: []statecheck.StateCheck{ statecheck.ExpectKnownValue( - "panos_panorama_template_variable."+resourceName, + "panos_template_variable."+resourceName, tfjsonpath.New("type").AtMapKey(testEntry.variableType), knownvalue.StringExact(testEntry.value), ), statecheck.ExpectKnownValue( - "panos_panorama_template_variable."+resourceName, + "panos_template_variable."+resourceName, tfjsonpath.New("name"), knownvalue.StringExact("$tempvar-"+nameSuffix), ), compareValuesDiffer.AddStateValue( - "panos_panorama_template_variable."+resourceName, + "panos_template_variable."+resourceName, tfjsonpath.New("type"), ), }, @@ -92,7 +92,7 @@ func makePanoramaTemplateVariableConfig(label string) string { variable "templ_var_value" { type = string } variable "templ_name" { type = string } - resource "panos_panorama_template" "%s" { + resource "panos_template" "%s" { name = "${var.templ_name}_${var.name_suffix}" location = { @@ -102,10 +102,10 @@ func makePanoramaTemplateVariableConfig(label string) string { } } - resource "panos_panorama_template_variable" "%s" { + resource "panos_template_variable" "%s" { location = { template = { - name = panos_panorama_template.%s.name + name = panos_template.%s.name } } @@ -142,4 +142,3 @@ func testAccPanosPanoramaTemplateVariableDestroy(entryName, templateName string) return nil } } - diff --git a/assets/terraform/test/resource_virtual_router_test.go b/assets/terraform/test/resource_virtual_router_test.go index 2c4d250..09f447d 100644 --- a/assets/terraform/test/resource_virtual_router_test.go +++ b/assets/terraform/test/resource_virtual_router_test.go @@ -118,7 +118,7 @@ func makePanosVirtualRouterConfig(label string) string { default = "ethernet1/40" } - resource "panos_panorama_template" "template" { + resource "panos_template" "template" { name = "${var.template_name}-${var.name_suffix}" location = { @@ -133,7 +133,7 @@ func makePanosVirtualRouterConfig(label string) string { location = { template = { vsys = "vsys1" - name = panos_panorama_template.template.name + name = panos_template.template.name } } @@ -166,7 +166,7 @@ func makePanosVirtualRouterConfig(label string) string { resource "panos_virtual_router" "%s" { location = { template = { - name = panos_panorama_template.template.name + name = panos_template.template.name } }