Skip to content

Commit

Permalink
Fix pipeline errors after rebuilding fabric_site resource (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-mazurkiewicz authored Aug 2, 2024
1 parent 79b2087 commit 4a4ba3d
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 27 deletions.
11 changes: 7 additions & 4 deletions gen/definitions/fabric_authentication_profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ id_query_param: siteNameHierarchy
delete_id_query_param: siteNameHierarchy
no_update: true
skip_minimum_test: true
test_tags: [FABRIC]
doc_category: SDA
attributes:
- model_name: siteNameHierarchy
Expand All @@ -15,7 +16,7 @@ attributes:
id: true
description: Path of SDA Fabric Site
example: Global/Site1
test_value: 'catalystcenter_fabric_site.test.site_name_hierarchy'
test_value: '"${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"'
- model_name: authenticateTemplateName
tf_name: authentication_template_name
data_path: "0"
Expand All @@ -35,7 +36,9 @@ test_prerequisites: |
name = "Area1"
parent_name = "Global"
}
resource "catalystcenter_fabric_site" "test" {
site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"
fabric_type = "FABRIC_SITE"
}
site_id = catalystcenter_area.test.id
authentication_profile_name = "No Authentication"
pub_sub_enabled = false
}
6 changes: 3 additions & 3 deletions gen/definitions/virtual_network_ip_pool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ test_prerequisites: |
depends_on = [catalystcenter_ip_pool.test]
}
resource "catalystcenter_fabric_site" "test" {
site_name_hierarchy = "Global/Area1"
fabric_type = "FABRIC_SITE"
depends_on = [catalystcenter_area.test]
site_id = catalystcenter_area.test.id
authentication_profile_name = "No Authentication"
pub_sub_enabled = false
}
resource "catalystcenter_fabric_virtual_network" "test" {
virtual_network_name = "SDA_VN1"
Expand Down
11 changes: 7 additions & 4 deletions gen/definitions/virtual_network_to_fabric_site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,31 @@ attributes:
data_source_query: true
description: Virtual Network Name, that is created at Global level
example: SDA_VN1
test_value: catalystcenter_fabric_virtual_network.test.virtual_network_name
test_value: catalystcenter_fabric_virtual_network.test.id
- model_name: siteNameHierarchy
mandatory: true
data_source_query: true
type: String
description: Path of SDA Fabric Site, e.g. `Global/Area1
example: "Global/Area1"
test_value: catalystcenter_fabric_site.test.site_name_hierarchy
test_value: '"${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"'
test_prerequisites: |
resource "catalystcenter_area" "test" {
name = "Area1"
parent_name = "Global"
}
resource "catalystcenter_fabric_site" "test" {
site_name_hierarchy = "Global/Area1"
fabric_type = "FABRIC_SITE"
site_id = catalystcenter_area.test.id
authentication_profile_name = "No Authentication"
pub_sub_enabled = false
depends_on = [catalystcenter_area.test]
}
resource "catalystcenter_fabric_virtual_network" "test" {
virtual_network_name = "SDA_VN1"
is_guest = false
sg_names = ["Employees"]
depends_on = [catalystcenter_fabric_site.test]
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package provider

// Section below is generated&owned by "gen/generator.go". //template:begin imports
import (
"os"
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
Expand All @@ -28,6 +29,9 @@ import (

// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource
func TestAccDataSourceCcFabricAuthenticationProfile(t *testing.T) {
if os.Getenv("FABRIC") == "" {
t.Skip("skipping test, set environment variable FABRIC")
}
var checks []resource.TestCheckFunc
checks = append(checks, resource.TestCheckResourceAttr("data.catalystcenter_fabric_authentication_profile.test", "authentication_template_name", "No Authentication"))
resource.Test(t, resource.TestCase{
Expand All @@ -50,18 +54,21 @@ resource "catalystcenter_area" "test" {
name = "Area1"
parent_name = "Global"
}
resource "catalystcenter_fabric_site" "test" {
site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"
fabric_type = "FABRIC_SITE"
site_id = catalystcenter_area.test.id
authentication_profile_name = "No Authentication"
pub_sub_enabled = false
}
`

// End of section. //template:end testPrerequisites

// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
func testAccDataSourceCcFabricAuthenticationProfileConfig() string {
config := `resource "catalystcenter_fabric_authentication_profile" "test" {` + "\n"
config += ` site_name_hierarchy = catalystcenter_fabric_site.test.site_name_hierarchy` + "\n"
config += ` site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"` + "\n"
config += ` authentication_template_name = "No Authentication"` + "\n"
config += `}` + "\n"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package provider

// Section below is generated&owned by "gen/generator.go". //template:begin imports
import (
"os"
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
Expand All @@ -28,6 +29,9 @@ import (

// Section below is generated&owned by "gen/generator.go". //template:begin testAcc
func TestAccCcFabricAuthenticationProfile(t *testing.T) {
if os.Getenv("FABRIC") == "" {
t.Skip("skipping test, set environment variable FABRIC")
}
var checks []resource.TestCheckFunc
checks = append(checks, resource.TestCheckResourceAttr("catalystcenter_fabric_authentication_profile.test", "authentication_template_name", "No Authentication"))

Expand Down Expand Up @@ -56,18 +60,21 @@ resource "catalystcenter_area" "test" {
name = "Area1"
parent_name = "Global"
}
resource "catalystcenter_fabric_site" "test" {
site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"
fabric_type = "FABRIC_SITE"
site_id = catalystcenter_area.test.id
authentication_profile_name = "No Authentication"
pub_sub_enabled = false
}
`

// End of section. //template:end testPrerequisites

// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimal
func testAccCcFabricAuthenticationProfileConfig_minimum() string {
config := `resource "catalystcenter_fabric_authentication_profile" "test" {` + "\n"
config += ` site_name_hierarchy = catalystcenter_fabric_site.test.site_name_hierarchy` + "\n"
config += ` site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"` + "\n"
config += ` authentication_template_name = "No Authentication"` + "\n"
config += `}` + "\n"
return config
Expand All @@ -78,7 +85,7 @@ func testAccCcFabricAuthenticationProfileConfig_minimum() string {
// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
func testAccCcFabricAuthenticationProfileConfig_all() string {
config := `resource "catalystcenter_fabric_authentication_profile" "test" {` + "\n"
config += ` site_name_hierarchy = catalystcenter_fabric_site.test.site_name_hierarchy` + "\n"
config += ` site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"` + "\n"
config += ` authentication_template_name = "No Authentication"` + "\n"
config += `}` + "\n"
return config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ resource "catalystcenter_ip_pool_reservation" "test" {
depends_on = [catalystcenter_ip_pool.test]
}
resource "catalystcenter_fabric_site" "test" {
site_name_hierarchy = "Global/Area1"
fabric_type = "FABRIC_SITE"
depends_on = [catalystcenter_area.test]
site_id = catalystcenter_area.test.id
authentication_profile_name = "No Authentication"
pub_sub_enabled = false
}
resource "catalystcenter_fabric_virtual_network" "test" {
virtual_network_name = "SDA_VN1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@ resource "catalystcenter_area" "test" {
parent_name = "Global"
}
resource "catalystcenter_fabric_site" "test" {
site_name_hierarchy = "Global/Area1"
fabric_type = "FABRIC_SITE"
site_id = catalystcenter_area.test.id
authentication_profile_name = "No Authentication"
pub_sub_enabled = false
depends_on = [catalystcenter_area.test]
}
resource "catalystcenter_fabric_virtual_network" "test" {
virtual_network_name = "SDA_VN1"
is_guest = false
sg_names = ["Employees"]
depends_on = [catalystcenter_fabric_site.test]
}
`
Expand All @@ -70,8 +73,8 @@ resource "catalystcenter_fabric_virtual_network" "test" {
// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimal
func testAccCcVirtualNetworkToFabricSiteConfig_minimum() string {
config := `resource "catalystcenter_virtual_network_to_fabric_site" "test" {` + "\n"
config += ` virtual_network_name = catalystcenter_fabric_virtual_network.test.virtual_network_name` + "\n"
config += ` site_name_hierarchy = catalystcenter_fabric_site.test.site_name_hierarchy` + "\n"
config += ` virtual_network_name = catalystcenter_fabric_virtual_network.test.id` + "\n"
config += ` site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"` + "\n"
config += `}` + "\n"
return config
}
Expand All @@ -81,8 +84,8 @@ func testAccCcVirtualNetworkToFabricSiteConfig_minimum() string {
// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
func testAccCcVirtualNetworkToFabricSiteConfig_all() string {
config := `resource "catalystcenter_virtual_network_to_fabric_site" "test" {` + "\n"
config += ` virtual_network_name = catalystcenter_fabric_virtual_network.test.virtual_network_name` + "\n"
config += ` site_name_hierarchy = catalystcenter_fabric_site.test.site_name_hierarchy` + "\n"
config += ` virtual_network_name = catalystcenter_fabric_virtual_network.test.id` + "\n"
config += ` site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"` + "\n"
config += `}` + "\n"
return config
}
Expand Down

0 comments on commit 4a4ba3d

Please sign in to comment.