1- // Copyright (c) 2017, 2023 , Oracle and/or its affiliates. All rights reserved.
1+ // Copyright (c) 2017, 2024 , Oracle and/or its affiliates. All rights reserved.
22// Licensed under the Mozilla Public License v2.0
33
44package integrationtest
@@ -25,6 +25,8 @@ import (
2525)
2626
2727var (
28+ randString = utils .RandomString (10 , utils .CharsetWithoutDigits )
29+ randString2 = utils .RandomString (10 , utils .CharsetWithoutDigits )
2830 ExaccDatabaseAutonomousDatabaseSoftwareImageRequiredOnlyResource = ExaccDatabaseAutonomousDatabaseSoftwareImageResourceDependencies +
2931 acctest .GenerateResourceFromRepresentationMap ("oci_database_autonomous_database_software_image" , "test_autonomous_database_software_image" , acctest .Required , acctest .Create , ExaccDatabaseAutonomousDatabaseSoftwareImageRepresentation )
3032
4850 DatabaseAutonomousDatabaseSoftwareImageDataSourceRepresentation = map [string ]interface {}{
4951 "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id}` },
5052 "image_shape_family" : acctest.Representation {RepType : acctest .Required , Create : `EXADATA_SHAPE` },
51- "display_name" : acctest.Representation {RepType : acctest .Optional , Create : `image1` },
53+ "display_name" : acctest.Representation {RepType : acctest .Optional , Create : `image1` + randString },
5254 "state" : acctest.Representation {RepType : acctest .Optional , Create : `AVAILABLE` },
5355 "filter" : acctest.RepresentationGroup {RepType : acctest .Required , Group : DatabaseAutonomousDatabaseSoftwareImageDataSourceFilterRepresentation }}
5456
6062 ExaccDatabaseAutonomousDatabaseSoftwareImageDataSourceRepresentation = map [string ]interface {}{
6163 "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id}` },
6264 "image_shape_family" : acctest.Representation {RepType : acctest .Required , Create : `EXACC_SHAPE` },
63- "display_name" : acctest.Representation {RepType : acctest .Optional , Create : `image1` },
65+ "display_name" : acctest.Representation {RepType : acctest .Optional , Create : `image1` + randString },
6466 "state" : acctest.Representation {RepType : acctest .Optional , Create : `AVAILABLE` },
6567 "filter" : acctest.RepresentationGroup {RepType : acctest .Required , Group : ExaccDatabaseAutonomousDatabaseSoftwareImageDataSourceFilterRepresentation }}
6668
7173
7274 DatabaseAutonomousDatabaseSoftwareImageRepresentation = map [string ]interface {}{
7375 "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id}` },
74- "display_name" : acctest.Representation {RepType : acctest .Required , Create : `image1` },
76+ "display_name" : acctest.Representation {RepType : acctest .Required , Create : `image1` + randString },
7577 "image_shape_family" : acctest.Representation {RepType : acctest .Required , Create : `EXADATA_SHAPE` },
7678 "source_cdb_id" : acctest.Representation {RepType : acctest .Required , Create : `${oci_database_autonomous_container_database.test_autonomous_container_database.id}` },
7779 "defined_tags" : acctest.Representation {RepType : acctest .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")}` },
8082
8183 ExaccDatabaseAutonomousDatabaseSoftwareImageRepresentation = map [string ]interface {}{
8284 "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id}` },
83- "display_name" : acctest.Representation {RepType : acctest .Required , Create : `image1` },
85+ "display_name" : acctest.Representation {RepType : acctest .Required , Create : `image1` + randString },
8486 "image_shape_family" : acctest.Representation {RepType : acctest .Required , Create : `EXACC_SHAPE` },
8587 "source_cdb_id" : acctest.Representation {RepType : acctest .Required , Create : `${oci_database_autonomous_container_database.test_autonomous_container_database.id}` },
8688 "defined_tags" : acctest.Representation {RepType : acctest .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")}` },
@@ -125,7 +127,7 @@ func TestDatabaseExaccAutonomousDatabaseSoftwareImageResource_basic(t *testing.T
125127 acctest .GenerateResourceFromRepresentationMap ("oci_database_autonomous_database_software_image" , "test_autonomous_database_software_image" , acctest .Required , acctest .Create , ExaccDatabaseAutonomousDatabaseSoftwareImageRepresentation ),
126128 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
127129 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
128- resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" ),
130+ resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" + randString ),
129131 resource .TestCheckResourceAttr (resourceName , "image_shape_family" , "EXACC_SHAPE" ),
130132 resource .TestCheckResourceAttrSet (resourceName , "source_cdb_id" ),
131133
@@ -147,7 +149,7 @@ func TestDatabaseExaccAutonomousDatabaseSoftwareImageResource_basic(t *testing.T
147149 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
148150 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
149151 resource .TestCheckResourceAttrSet (resourceName , "database_version" ),
150- resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" ),
152+ resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" + randString ),
151153 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
152154 resource .TestCheckResourceAttrSet (resourceName , "id" ),
153155 resource .TestCheckResourceAttr (resourceName , "image_shape_family" , "EXACC_SHAPE" ),
@@ -178,7 +180,7 @@ func TestDatabaseExaccAutonomousDatabaseSoftwareImageResource_basic(t *testing.T
178180 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
179181 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentIdU ),
180182 resource .TestCheckResourceAttrSet (resourceName , "database_version" ),
181- resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" ),
183+ resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" + randString ),
182184 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
183185 resource .TestCheckResourceAttrSet (resourceName , "id" ),
184186 resource .TestCheckResourceAttr (resourceName , "image_shape_family" , "EXACC_SHAPE" ),
@@ -204,7 +206,7 @@ func TestDatabaseExaccAutonomousDatabaseSoftwareImageResource_basic(t *testing.T
204206 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
205207 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
206208 resource .TestCheckResourceAttrSet (resourceName , "database_version" ),
207- resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" ),
209+ resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" + randString ),
208210 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
209211 resource .TestCheckResourceAttrSet (resourceName , "id" ),
210212 resource .TestCheckResourceAttr (resourceName , "image_shape_family" , "EXACC_SHAPE" ),
@@ -230,7 +232,7 @@ func TestDatabaseExaccAutonomousDatabaseSoftwareImageResource_basic(t *testing.T
230232 acctest .GenerateResourceFromRepresentationMap ("oci_database_autonomous_database_software_image" , "test_autonomous_database_software_image" , acctest .Optional , acctest .Update , ExaccDatabaseAutonomousDatabaseSoftwareImageRepresentation ),
231233 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
232234 resource .TestCheckResourceAttr (datasourceName , "compartment_id" , compartmentId ),
233- resource .TestCheckResourceAttr (datasourceName , "display_name" , "image1" ),
235+ resource .TestCheckResourceAttr (datasourceName , "display_name" , "image1" + randString ),
234236 resource .TestCheckResourceAttr (datasourceName , "image_shape_family" , "EXACC_SHAPE" ),
235237 resource .TestCheckResourceAttr (datasourceName , "state" , "AVAILABLE" ),
236238
@@ -249,7 +251,7 @@ func TestDatabaseExaccAutonomousDatabaseSoftwareImageResource_basic(t *testing.T
249251 resource .TestCheckResourceAttr (singularDatasourceName , "autonomous_dsi_one_off_patches.#" , "0" ),
250252 resource .TestCheckResourceAttr (singularDatasourceName , "compartment_id" , compartmentId ),
251253 resource .TestCheckResourceAttrSet (singularDatasourceName , "database_version" ),
252- resource .TestCheckResourceAttr (singularDatasourceName , "display_name" , "image1" ),
254+ resource .TestCheckResourceAttr (singularDatasourceName , "display_name" , "image1" + randString ),
253255 resource .TestCheckResourceAttr (singularDatasourceName , "freeform_tags.%" , "1" ),
254256 resource .TestCheckResourceAttrSet (singularDatasourceName , "id" ),
255257 resource .TestCheckResourceAttr (singularDatasourceName , "image_shape_family" , "EXACC_SHAPE" ),
@@ -299,7 +301,7 @@ func TestDatabaseAutonomousDatabaseSoftwareImageResource_basic(t *testing.T) {
299301 acctest .GenerateResourceFromRepresentationMap ("oci_database_autonomous_database_software_image" , "test_autonomous_database_software_image" , acctest .Required , acctest .Create , DatabaseAutonomousDatabaseSoftwareImageRepresentation ),
300302 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
301303 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
302- resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" ),
304+ resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" + randString ),
303305 resource .TestCheckResourceAttr (resourceName , "image_shape_family" , "EXADATA_SHAPE" ),
304306 resource .TestCheckResourceAttrSet (resourceName , "source_cdb_id" ),
305307
@@ -321,7 +323,7 @@ func TestDatabaseAutonomousDatabaseSoftwareImageResource_basic(t *testing.T) {
321323 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
322324 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
323325 resource .TestCheckResourceAttrSet (resourceName , "database_version" ),
324- resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" ),
326+ resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" + randString ),
325327 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
326328 resource .TestCheckResourceAttrSet (resourceName , "id" ),
327329 resource .TestCheckResourceAttr (resourceName , "image_shape_family" , "EXADATA_SHAPE" ),
@@ -352,7 +354,7 @@ func TestDatabaseAutonomousDatabaseSoftwareImageResource_basic(t *testing.T) {
352354 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
353355 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentIdU ),
354356 resource .TestCheckResourceAttrSet (resourceName , "database_version" ),
355- resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" ),
357+ resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" + randString ),
356358 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
357359 resource .TestCheckResourceAttrSet (resourceName , "id" ),
358360 resource .TestCheckResourceAttr (resourceName , "image_shape_family" , "EXADATA_SHAPE" ),
@@ -378,7 +380,7 @@ func TestDatabaseAutonomousDatabaseSoftwareImageResource_basic(t *testing.T) {
378380 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
379381 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
380382 resource .TestCheckResourceAttrSet (resourceName , "database_version" ),
381- resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" ),
383+ resource .TestCheckResourceAttr (resourceName , "display_name" , "image1" + randString ),
382384 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
383385 resource .TestCheckResourceAttrSet (resourceName , "id" ),
384386 resource .TestCheckResourceAttr (resourceName , "image_shape_family" , "EXADATA_SHAPE" ),
@@ -404,7 +406,7 @@ func TestDatabaseAutonomousDatabaseSoftwareImageResource_basic(t *testing.T) {
404406 acctest .GenerateResourceFromRepresentationMap ("oci_database_autonomous_database_software_image" , "test_autonomous_database_software_image" , acctest .Optional , acctest .Update , DatabaseAutonomousDatabaseSoftwareImageRepresentation ),
405407 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
406408 resource .TestCheckResourceAttr (datasourceName , "compartment_id" , compartmentId ),
407- resource .TestCheckResourceAttr (datasourceName , "display_name" , "image1" ),
409+ resource .TestCheckResourceAttr (datasourceName , "display_name" , "image1" + randString ),
408410 resource .TestCheckResourceAttr (datasourceName , "image_shape_family" , "EXADATA_SHAPE" ),
409411 resource .TestCheckResourceAttr (datasourceName , "state" , "AVAILABLE" ),
410412
@@ -423,7 +425,7 @@ func TestDatabaseAutonomousDatabaseSoftwareImageResource_basic(t *testing.T) {
423425 resource .TestCheckResourceAttr (singularDatasourceName , "autonomous_dsi_one_off_patches.#" , "0" ),
424426 resource .TestCheckResourceAttr (singularDatasourceName , "compartment_id" , compartmentId ),
425427 resource .TestCheckResourceAttrSet (singularDatasourceName , "database_version" ),
426- resource .TestCheckResourceAttr (singularDatasourceName , "display_name" , "image1" ),
428+ resource .TestCheckResourceAttr (singularDatasourceName , "display_name" , "image1" + randString ),
427429 resource .TestCheckResourceAttr (singularDatasourceName , "freeform_tags.%" , "1" ),
428430 resource .TestCheckResourceAttrSet (singularDatasourceName , "id" ),
429431 resource .TestCheckResourceAttr (singularDatasourceName , "image_shape_family" , "EXADATA_SHAPE" ),
0 commit comments