diff --git a/gen/templates/resource_test.go.tmpl b/gen/templates/resource_test.go.tmpl index 63cafb029..6a79a532e 100644 --- a/gen/templates/resource_test.go.tmpl +++ b/gen/templates/resource_test.go.tmpl @@ -861,6 +861,20 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } }, CheckDestroy: testCheckResourceDestroy, }) + {{- if $.legacy_attributes}} + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, "apic", "1.0(1e)-") }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + // Create with legacy attribute config + { + Config: testConfig{{$.resourceClassName}}LegacyAttributesWith{{capitalize .class_name}}{{if $.version_mismatch}} + testConfigDataSourceSystem{{end}}, + ExpectNonEmptyPlan: false, + }, + }, + CheckDestroy: testCheckResourceDestroy, + }) + {{- end}} } {{- end}} {{- else}} func TestAccResource{{.resourceClassName}}(t *testing.T) { diff --git a/internal/provider/resource_aci_application_epg_test.go b/internal/provider/resource_aci_application_epg_test.go index 389c217a6..c3c756100 100644 --- a/internal/provider/resource_aci_application_epg_test.go +++ b/internal/provider/resource_aci_application_epg_test.go @@ -1129,6 +1129,18 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { }, CheckDestroy: testCheckResourceDestroy, }) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, "apic", "1.0(1e)-") }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + // Create with legacy attribute config + { + Config: testConfigFvAEPgLegacyAttributesWithFvAp + testConfigDataSourceSystem, + ExpectNonEmptyPlan: false, + }, + }, + CheckDestroy: testCheckResourceDestroy, + }) } const testChildDependencyConfigFvAEPg = ` diff --git a/internal/provider/resource_aci_bridge_domain_test.go b/internal/provider/resource_aci_bridge_domain_test.go index bb91beaf0..92ebe53d5 100644 --- a/internal/provider/resource_aci_bridge_domain_test.go +++ b/internal/provider/resource_aci_bridge_domain_test.go @@ -936,6 +936,18 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { }, CheckDestroy: testCheckResourceDestroy, }) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, "apic", "1.0(1e)-") }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + // Create with legacy attribute config + { + Config: testConfigFvBDLegacyAttributesWithFvTenant + testConfigDataSourceSystem, + ExpectNonEmptyPlan: false, + }, + }, + CheckDestroy: testCheckResourceDestroy, + }) } const testChildDependencyConfigFvBD = ` diff --git a/internal/provider/resource_aci_endpoint_security_group_test.go b/internal/provider/resource_aci_endpoint_security_group_test.go index 115df9b79..9a78a82c7 100644 --- a/internal/provider/resource_aci_endpoint_security_group_test.go +++ b/internal/provider/resource_aci_endpoint_security_group_test.go @@ -508,6 +508,18 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { }, CheckDestroy: testCheckResourceDestroy, }) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, "apic", "1.0(1e)-") }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + // Create with legacy attribute config + { + Config: testConfigFvESgLegacyAttributesWithFvAp + testConfigDataSourceSystem, + ExpectNonEmptyPlan: false, + }, + }, + CheckDestroy: testCheckResourceDestroy, + }) } const testChildDependencyConfigFvESg = `