@@ -12,8 +12,7 @@ import (
1212
1313const (
1414 ShapeResourceConfig = ShapeResourceDependencies + `
15- resource "oci_core_shape" "test_shape" {
16- }
15+
1716`
1817 ShapePropertyVariables = `
1918variable "shape_availability_domain" { default = "availabilityDomain" }
@@ -24,58 +23,19 @@ variable "shape_image_id" { default = "imageId" }
2423)
2524
2625func TestCoreShapeResource_basic (t * testing.T ) {
27- t .Skip ("Creating shape resource is not supported. Data source test is covered by legacy test. Need to enable data source only tests in generator. https://jira.aka.lgl.grungy.us/browse/ORCH-708" )
2826 provider := testAccProvider
2927 config := testProviderConfig ()
3028
31- compartmentId := getRequiredEnvSetting ("compartment_id_for_create" )
32- compartmentIdVariableStr := fmt .Sprintf ("variable \" compartment_id\" { default = \" %s\" }\n " , compartmentId )
3329 compartmentId2 := getRequiredEnvSetting ("compartment_id_for_update" )
3430 compartmentIdVariableStr2 := fmt .Sprintf ("variable \" compartment_id\" { default = \" %s\" }\n " , compartmentId2 )
3531
36- resourceName := "oci_core_shape.test_shape"
3732 datasourceName := "data.oci_core_shapes.test_shapes"
3833
39- var resId , resId2 string
40-
4134 resource .Test (t , resource.TestCase {
4235 Providers : map [string ]terraform.ResourceProvider {
4336 "oci" : provider ,
4437 },
4538 Steps : []resource.TestStep {
46- // verify create
47- {
48- ImportState : true ,
49- ImportStateVerify : true ,
50- Config : config + ShapePropertyVariables + compartmentIdVariableStr + ShapeResourceConfig ,
51- Check : resource .ComposeAggregateTestCheckFunc (
52-
53- func (s * terraform.State ) (err error ) {
54- resId , err = fromInstanceState (s , resourceName , "id" )
55- return err
56- },
57- ),
58- },
59-
60- // verify updates to Force New parameters.
61- {
62- Config : config + `
63- variable "shape_availability_domain" { default = "availabilityDomain2" }
64- variable "shape_image_id" { default = "imageId2" }
65-
66- ` + compartmentIdVariableStr2 + ShapeResourceConfig ,
67- Check : resource .ComposeAggregateTestCheckFunc (
68- resource .TestCheckResourceAttrSet (resourceName , "name" ),
69-
70- func (s * terraform.State ) (err error ) {
71- resId2 , err = fromInstanceState (s , resourceName , "id" )
72- if resId == resId2 {
73- return fmt .Errorf ("Resource was expected to be recreated but it wasn't." )
74- }
75- return err
76- },
77- ),
78- },
7939 // verify datasource
8040 {
8141 Config : config + `
@@ -87,21 +47,16 @@ data "oci_core_shapes" "test_shapes" {
8747 compartment_id = "${var.compartment_id}"
8848
8949 #Optional
90- availability_domain = "${var.shape_availability_domain}"
91- image_id = "${var.shape_image_id}"
92-
93- filter {
94- name = "id"
95- values = ["${oci_core_shape.test_shape.id}"]
96- }
50+ #availability_domain = "${var.shape_availability_domain}"
51+ #image_id = "${var.shape_image_id}"
9752}
9853 ` + compartmentIdVariableStr2 + ShapeResourceConfig ,
9954 Check : resource .ComposeTestCheckFunc (
100- resource .TestCheckResourceAttr (datasourceName , "availability_domain" , "availabilityDomain2" ),
55+ // resource.TestCheckResourceAttr(datasourceName, "availability_domain", "availabilityDomain2"),
10156 resource .TestCheckResourceAttr (datasourceName , "compartment_id" , compartmentId2 ),
102- resource .TestCheckResourceAttr (datasourceName , "image_id" , "imageId2" ),
57+ // resource.TestCheckResourceAttr(datasourceName, "image_id", "imageId2"),
10358
104- resource .TestCheckResourceAttr (datasourceName , "shapes.#" , "1 " ),
59+ resource .TestCheckResourceAttrSet (datasourceName , "shapes.#" ),
10560 resource .TestCheckResourceAttrSet (datasourceName , "shapes.0.name" ),
10661 ),
10762 },
0 commit comments