@@ -18,35 +18,23 @@ var (
1818 generateResourceFromRepresentationMap ("oci_core_image" , "test_image" , Required , Create , imageRepresentation )
1919
2020 imageDataSourceRepresentation = map [string ]interface {}{
21- "compartment_id" : Representation {repType : Required , create : `${var.compartment_id}` },
22- "display_name" : Representation {repType : Optional , create : `MyCustomImage` , update : `displayName2` },
23- "operating_system" : Representation {repType : Optional , create : `operatingSystem` },
24- "operating_system_version" : Representation {repType : Optional , create : `operatingSystemVersion` },
25- "shape" : Representation {repType : Optional , create : `shape` },
26- "state" : Representation {repType : Optional , create : `AVAILABLE` },
27- "filter" : RepresentationGroup {Required , imageDataSourceFilterRepresentation }}
21+ "compartment_id" : Representation {repType : Required , create : `${var.compartment_id}` },
22+ "display_name" : Representation {repType : Optional , create : `MyCustomImage` , update : `displayName2` },
23+ "state" : Representation {repType : Optional , create : `AVAILABLE` },
24+ "filter" : RepresentationGroup {Required , imageDataSourceFilterRepresentation }}
2825 imageDataSourceFilterRepresentation = map [string ]interface {}{
2926 "name" : Representation {repType : Required , create : `id` },
3027 "values" : Representation {repType : Required , create : []string {`${oci_core_image.test_image.id}` }},
3128 }
3229
3330 imageRepresentation = map [string ]interface {}{
34- "compartment_id" : Representation {repType : Required , create : `${var.compartment_id}` },
35- "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")}` },
36- "display_name" : Representation {repType : Optional , create : `MyCustomImage` , update : `displayName2` },
37- "freeform_tags" : Representation {repType : Optional , create : map [string ]string {"Department" : "Finance" }, update : map [string ]string {"Department" : "Accounting" }},
38- "image_source_details" : RepresentationGroup {Optional , imageImageSourceDetailsRepresentation },
39- "instance_id" : Representation {repType : Required , create : `${oci_core_instance.test_instance.id}` },
40- "launch_mode" : Representation {repType : Optional , create : `NATIVE` },
41- "timeouts" : RepresentationGroup {Required , timeoutsRepresentation },
42- }
43- imageImageSourceDetailsRepresentation = map [string ]interface {}{
44- "source_type" : Representation {repType : Required , create : `objectStorageTuple` },
45- "bucket_name" : Representation {repType : Optional , create : `MyBucket` },
46- "namespace_name" : Representation {repType : Optional , create : `MyNamespace` },
47- "object_name" : Representation {repType : Optional , create : `image-to-import.qcow2` },
48- "source_image_type" : Representation {repType : Optional , create : `QCOW2` },
49- "source_uri" : Representation {repType : Optional , create : `https://objectstorage.us-phoenix-1.oraclecloud.com/n/MyNamespace/b/MyBucket/o/image-to-import.qcow2` },
31+ "compartment_id" : Representation {repType : Required , create : `${var.compartment_id}` },
32+ "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")}` },
33+ "display_name" : Representation {repType : Optional , create : `MyCustomImage` , update : `displayName2` },
34+ "freeform_tags" : Representation {repType : Optional , create : map [string ]string {"Department" : "Finance" }, update : map [string ]string {"Department" : "Accounting" }},
35+ "instance_id" : Representation {repType : Required , create : `${oci_core_instance.test_instance.id}` },
36+ "launch_mode" : Representation {repType : Optional , create : `NATIVE` },
37+ "timeouts" : RepresentationGroup {Required , timeoutsRepresentation },
5038 }
5139
5240 timeoutsRepresentation = map [string ]interface {}{
5745)
5846
5947func TestCoreImageResource_basic (t * testing.T ) {
60- t .Skip ("Long running test" )
6148 provider := testAccProvider
6249 config := testProviderConfig ()
6350
@@ -106,9 +93,7 @@ func TestCoreImageResource_basic(t *testing.T) {
10693 resource .TestCheckResourceAttr (resourceName , "display_name" , "MyCustomImage" ),
10794 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
10895 resource .TestCheckResourceAttrSet (resourceName , "id" ),
109- resource .TestCheckResourceAttr (resourceName , "image_source_details.#" , "1" ),
110- resource .TestCheckResourceAttr (resourceName , "image_source_details.0.source_image_type" , "QCOW2" ),
111- resource .TestCheckResourceAttr (resourceName , "image_source_details.0.source_type" , "objectStorageTuple" ),
96+ resource .TestCheckResourceAttrSet (resourceName , "instance_id" ),
11297 resource .TestCheckResourceAttr (resourceName , "launch_mode" , "NATIVE" ),
11398 resource .TestCheckResourceAttrSet (resourceName , "operating_system" ),
11499 resource .TestCheckResourceAttrSet (resourceName , "operating_system_version" ),
@@ -133,9 +118,7 @@ func TestCoreImageResource_basic(t *testing.T) {
133118 resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName2" ),
134119 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
135120 resource .TestCheckResourceAttrSet (resourceName , "id" ),
136- resource .TestCheckResourceAttr (resourceName , "image_source_details.#" , "1" ),
137- resource .TestCheckResourceAttr (resourceName , "image_source_details.0.source_image_type" , "QCOW2" ),
138- resource .TestCheckResourceAttr (resourceName , "image_source_details.0.source_type" , "objectStorageTuple" ),
121+ resource .TestCheckResourceAttrSet (resourceName , "instance_id" ),
139122 resource .TestCheckResourceAttr (resourceName , "launch_mode" , "NATIVE" ),
140123 resource .TestCheckResourceAttrSet (resourceName , "operating_system" ),
141124 resource .TestCheckResourceAttrSet (resourceName , "operating_system_version" ),
0 commit comments