diff --git a/gen/definitions/fabric_authentication_profile.yaml b/gen/definitions/fabric_authentication_profile.yaml index de36512..b174fbe 100644 --- a/gen/definitions/fabric_authentication_profile.yaml +++ b/gen/definitions/fabric_authentication_profile.yaml @@ -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 @@ -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" @@ -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" - } \ No newline at end of file + site_id = catalystcenter_area.test.id + authentication_profile_name = "No Authentication" + pub_sub_enabled = false + } diff --git a/gen/definitions/virtual_network_ip_pool.yaml b/gen/definitions/virtual_network_ip_pool.yaml index 980a0c2..01ca0dc 100644 --- a/gen/definitions/virtual_network_ip_pool.yaml +++ b/gen/definitions/virtual_network_ip_pool.yaml @@ -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" diff --git a/gen/definitions/virtual_network_to_fabric_site.yaml b/gen/definitions/virtual_network_to_fabric_site.yaml index e90180d..5d53b45 100644 --- a/gen/definitions/virtual_network_to_fabric_site.yaml +++ b/gen/definitions/virtual_network_to_fabric_site.yaml @@ -14,22 +14,23 @@ 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] } @@ -37,5 +38,7 @@ test_prerequisites: | virtual_network_name = "SDA_VN1" is_guest = false sg_names = ["Employees"] + + depends_on = [catalystcenter_fabric_site.test] } diff --git a/internal/provider/data_source_catalystcenter_fabric_authentication_profile_test.go b/internal/provider/data_source_catalystcenter_fabric_authentication_profile_test.go index 1ed33b7..e10d6a5 100644 --- a/internal/provider/data_source_catalystcenter_fabric_authentication_profile_test.go +++ b/internal/provider/data_source_catalystcenter_fabric_authentication_profile_test.go @@ -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" @@ -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{ @@ -50,10 +54,13 @@ 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 @@ -61,7 +68,7 @@ resource "catalystcenter_fabric_site" "test" { // 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" diff --git a/internal/provider/resource_catalystcenter_fabric_authentication_profile_test.go b/internal/provider/resource_catalystcenter_fabric_authentication_profile_test.go index b9ee984..d88749e 100644 --- a/internal/provider/resource_catalystcenter_fabric_authentication_profile_test.go +++ b/internal/provider/resource_catalystcenter_fabric_authentication_profile_test.go @@ -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" @@ -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")) @@ -56,10 +60,13 @@ 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 @@ -67,7 +74,7 @@ resource "catalystcenter_fabric_site" "test" { // 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 @@ -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 diff --git a/internal/provider/resource_catalystcenter_virtual_network_ip_pool_test.go b/internal/provider/resource_catalystcenter_virtual_network_ip_pool_test.go index f7c96b9..8e2c251 100644 --- a/internal/provider/resource_catalystcenter_virtual_network_ip_pool_test.go +++ b/internal/provider/resource_catalystcenter_virtual_network_ip_pool_test.go @@ -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" diff --git a/internal/provider/resource_catalystcenter_virtual_network_to_fabric_site_test.go b/internal/provider/resource_catalystcenter_virtual_network_to_fabric_site_test.go index f4a54f7..1d5341a 100644 --- a/internal/provider/resource_catalystcenter_virtual_network_to_fabric_site_test.go +++ b/internal/provider/resource_catalystcenter_virtual_network_to_fabric_site_test.go @@ -52,8 +52,9 @@ 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] } @@ -61,6 +62,8 @@ resource "catalystcenter_fabric_virtual_network" "test" { virtual_network_name = "SDA_VN1" is_guest = false sg_names = ["Employees"] + + depends_on = [catalystcenter_fabric_site.test] } ` @@ -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 } @@ -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 }