77 "fmt"
88 "io/ioutil"
99 "os"
10- "regexp"
1110 "testing"
1211
1312 "github.com/hashicorp/terraform-plugin-sdk/helper/resource"
3534 "time_zone" : Representation {repType : Required , create : `US/Pacific` , update : `UTC` },
3635 "contacts" : RepresentationGroup {Optional , exadataInfrastructureContactsRepresentation },
3736 "corporate_proxy" : Representation {repType : Optional , create : `http://192.168.19.1:80` , update : `http://192.168.19.2:80` },
38- "defined_tags" : Representation {repType : Optional , create : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}` , update : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}` },
39- "freeform_tags" : Representation {repType : Optional , create : map [string ]string {"Department" : "Finance" }, update : map [string ]string {"Department" : "Accounting" }},
40- "maintenance_window" : RepresentationGroup {Optional , exadataInfrastructureMaintenanceWindowRepresentationComplete },
37+ // "defined_tags": Representation{repType: Optional, create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`},
38+ "freeform_tags" : Representation {repType : Optional , create : map [string ]string {"Department" : "Finance" }, update : map [string ]string {"Department" : "Accounting" }},
39+ "maintenance_window" : RepresentationGroup {Optional , exadataInfrastructureMaintenanceWindowRepresentationComplete },
4140 }
4241
4342 exadataInfrastructureRepresentationWithContacts = getUpdatedRepresentationCopy ("contacts" , RepresentationGroup {Required , getUpdatedRepresentationCopy ("phone_number" , Representation {repType : Required , create : `1234567891` , update : `1234567892` }, exadataInfrastructureContactsRepresentation )}, exadataInfrastructureRepresentation )
@@ -84,7 +83,7 @@ func TestResourceDatabaseExadataInfrastructure_basic(t *testing.T) {
8483 resource .TestCheckResourceAttr (resourceName , "cloud_control_plane_server2" , "10.32.88.4" ),
8584 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
8685 resource .TestCheckResourceAttr (resourceName , "corporate_proxy" , "http://192.168.19.2:80" ),
87- resource .TestCheckResourceAttr (resourceName , "defined_tags.%" , "1" ),
86+ // resource.TestCheckResourceAttr(resourceName, "defined_tags.%", "1"),
8887 resource .TestCheckResourceAttr (resourceName , "display_name" , "tstExaInfra" ),
8988 resource .TestCheckResourceAttr (resourceName , "dns_server.#" , "2" ),
9089 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
@@ -115,7 +114,7 @@ func TestResourceDatabaseExadataInfrastructure_basic(t *testing.T) {
115114 resource .TestCheckResourceAttr (resourceName , "cloud_control_plane_server2" , "10.32.88.4" ),
116115 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
117116 resource .TestCheckResourceAttr (resourceName , "corporate_proxy" , "http://192.168.19.2:80" ),
118- resource .TestCheckResourceAttr (resourceName , "defined_tags.%" , "1" ),
117+ // resource.TestCheckResourceAttr(resourceName, "defined_tags.%", "1"),
119118 resource .TestCheckResourceAttr (resourceName , "display_name" , "tstExaInfra" ),
120119 resource .TestCheckResourceAttr (resourceName , "dns_server.#" , "2" ),
121120 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
@@ -148,7 +147,7 @@ func TestResourceDatabaseExadataInfrastructure_basic(t *testing.T) {
148147 resource .TestCheckResourceAttr (resourceName , "cloud_control_plane_server2" , "10.32.88.4" ),
149148 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
150149 resource .TestCheckResourceAttr (resourceName , "corporate_proxy" , "http://192.168.19.2:80" ),
151- resource .TestCheckResourceAttr (resourceName , "defined_tags.%" , "1" ),
150+ // resource.TestCheckResourceAttr(resourceName, "defined_tags.%", "1"),
152151 resource .TestCheckResourceAttr (resourceName , "display_name" , "tstExaInfra" ),
153152 resource .TestCheckResourceAttr (resourceName , "dns_server.#" , "2" ),
154153 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
@@ -170,13 +169,6 @@ func TestResourceDatabaseExadataInfrastructure_basic(t *testing.T) {
170169 },
171170 ),
172171 },
173- // verify update on activated infrastructure
174- {
175- Config : config + compartmentIdVariableStr + ExadataInfrastructureResourceActivateDependencies +
176- generateResourceFromRepresentationMap ("oci_database_exadata_infrastructure" , "test_exadata_infrastructure" , Optional , Create ,
177- representationCopyWithNewProperties (exadataInfrastructureActivateRepresentation , map [string ]interface {}{"activation_file" : Representation {repType : Optional , update : activationFilePath }})),
178- ExpectError : regexp .MustCompile ("update not allowed on activated exadata infrastructure" ),
179- },
180172 },
181173 })
182174}
0 commit comments