@@ -30,7 +30,7 @@ resource "oci_core_console_history" "test_console_history" {
3030 ConsoleHistoryPropertyVariables = `
3131variable "console_history_availability_domain" { default = "availabilityDomain" }
3232variable "console_history_display_name" { default = "displayName" }
33- variable "console_history_state" { default = "state " }
33+ variable "console_history_state" { default = "AVAILABLE " }
3434
3535`
3636 ConsoleHistoryResourceDependencies = "" // Uncomment once defined: InstancePropertyVariables + InstanceResourceConfig
@@ -41,10 +41,8 @@ func TestCoreConsoleHistoryResource_basic(t *testing.T) {
4141 provider := testAccProvider
4242 config := testProviderConfig ()
4343
44- compartmentId := getRequiredEnvSetting ("compartment_id_for_create " )
44+ compartmentId := getRequiredEnvSetting ("compartment_ocid " )
4545 compartmentIdVariableStr := fmt .Sprintf ("variable \" compartment_id\" { default = \" %s\" }\n " , compartmentId )
46- compartmentId2 := getRequiredEnvSetting ("compartment_id_for_update" )
47- compartmentIdVariableStr2 := fmt .Sprintf ("variable \" compartment_id\" { default = \" %s\" }\n " , compartmentId2 )
4846
4947 resourceName := "oci_core_console_history.test_console_history"
5048 datasourceName := "data.oci_core_console_histories.test_console_histories"
@@ -99,7 +97,7 @@ func TestCoreConsoleHistoryResource_basic(t *testing.T) {
9997 Config : config + `
10098variable "console_history_availability_domain" { default = "availabilityDomain" }
10199variable "console_history_display_name" { default = "displayName2" }
102- variable "console_history_state" { default = "state " }
100+ variable "console_history_state" { default = "AVAILABLE " }
103101
104102 ` + compartmentIdVariableStr + ConsoleHistoryResourceConfig ,
105103 Check : resource .ComposeAggregateTestCheckFunc (
@@ -120,36 +118,10 @@ variable "console_history_state" { default = "state" }
120118 },
121119 ),
122120 },
123- // verify updates to Force New parameters.
124- {
125- Config : config + `
126- variable "console_history_availability_domain" { default = "availabilityDomain2" }
127- variable "console_history_display_name" { default = "displayName2" }
128- variable "console_history_state" { default = "AVAILABLE" }
129-
130- ` + compartmentIdVariableStr2 + ConsoleHistoryResourceConfig ,
131- Check : resource .ComposeAggregateTestCheckFunc (
132- resource .TestCheckResourceAttrSet (resourceName , "availability_domain" ),
133- resource .TestCheckResourceAttrSet (resourceName , "compartment_id" ),
134- resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName2" ),
135- resource .TestCheckResourceAttrSet (resourceName , "id" ),
136- resource .TestCheckResourceAttrSet (resourceName , "instance_id" ),
137- resource .TestCheckResourceAttrSet (resourceName , "state" ),
138- resource .TestCheckResourceAttrSet (resourceName , "time_created" ),
139-
140- func (s * terraform.State ) (err error ) {
141- resId2 , err = fromInstanceState (s , resourceName , "id" )
142- if resId == resId2 {
143- return fmt .Errorf ("Resource was expected to be recreated but it wasn't." )
144- }
145- return err
146- },
147- ),
148- },
149121 // verify datasource
150122 {
151123 Config : config + `
152- variable "console_history_availability_domain" { default = "availabilityDomain2 " }
124+ variable "console_history_availability_domain" { default = "availabilityDomain " }
153125variable "console_history_display_name" { default = "displayName2" }
154126variable "console_history_state" { default = "AVAILABLE" }
155127
@@ -167,10 +139,10 @@ data "oci_core_console_histories" "test_console_histories" {
167139 values = ["${oci_core_console_history.test_console_history.id}"]
168140 }
169141}
170- ` + compartmentIdVariableStr2 + ConsoleHistoryResourceConfig ,
171- Check : resource .ComposeTestCheckFunc (
172- resource .TestCheckResourceAttr (datasourceName , "availability_domain" , "availabilityDomain2 " ),
173- resource .TestCheckResourceAttr (datasourceName , "compartment_id" , compartmentId2 ),
142+ ` + compartmentIdVariableStr + ConsoleHistoryResourceConfig ,
143+ Check : resource .ComposeAggregateTestCheckFunc (
144+ resource .TestCheckResourceAttr (datasourceName , "availability_domain" , "availabilityDomain " ),
145+ resource .TestCheckResourceAttr (datasourceName , "compartment_id" , compartmentId ),
174146 resource .TestCheckResourceAttrSet (datasourceName , "instance_id" ),
175147 resource .TestCheckResourceAttr (datasourceName , "state" , "AVAILABLE" ),
176148
@@ -187,69 +159,3 @@ data "oci_core_console_histories" "test_console_histories" {
187159 },
188160 })
189161}
190-
191- func TestCoreConsoleHistoryResource_forcenew (t * testing.T ) {
192- t .Skip ("Skipping generated test for now as it has not been worked on." )
193- provider := testAccProvider
194- config := testProviderConfig ()
195-
196- compartmentId := getRequiredEnvSetting ("compartment_id_for_create" )
197- compartmentIdVariableStr := fmt .Sprintf ("variable \" compartment_id\" { default = \" %s\" }\n " , compartmentId )
198-
199- resourceName := "oci_core_console_history.test_console_history"
200-
201- var resId , resId2 string
202-
203- resource .Test (t , resource.TestCase {
204- Providers : map [string ]terraform.ResourceProvider {
205- "oci" : provider ,
206- },
207- Steps : []resource.TestStep {
208- // verify create with optionals
209- {
210- Config : config + ConsoleHistoryPropertyVariables + compartmentIdVariableStr + ConsoleHistoryResourceConfig ,
211- Check : resource .ComposeAggregateTestCheckFunc (
212- resource .TestCheckResourceAttrSet (resourceName , "availability_domain" ),
213- resource .TestCheckResourceAttrSet (resourceName , "compartment_id" ),
214- resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName" ),
215- resource .TestCheckResourceAttrSet (resourceName , "id" ),
216- resource .TestCheckResourceAttrSet (resourceName , "instance_id" ),
217- resource .TestCheckResourceAttrSet (resourceName , "state" ),
218- resource .TestCheckResourceAttrSet (resourceName , "time_created" ),
219-
220- func (s * terraform.State ) (err error ) {
221- resId , err = fromInstanceState (s , resourceName , "id" )
222- return err
223- },
224- ),
225- },
226- // force new tests, test that changing a parameter would result in creation of a new resource.
227-
228- {
229- Config : config + `
230- variable "console_history_availability_domain" { default = "availabilityDomain" }
231- variable "console_history_display_name" { default = "displayName" }
232- variable "console_history_state" { default = "state" }
233- ` + compartmentIdVariableStr + ConsoleHistoryResourceConfig ,
234- Check : resource .ComposeAggregateTestCheckFunc (
235- resource .TestCheckResourceAttrSet (resourceName , "availability_domain" ),
236- resource .TestCheckResourceAttrSet (resourceName , "compartment_id" ),
237- resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName" ),
238- resource .TestCheckResourceAttrSet (resourceName , "id" ),
239- resource .TestCheckResourceAttrSet (resourceName , "instance_id" ),
240- resource .TestCheckResourceAttrSet (resourceName , "state" ),
241- resource .TestCheckResourceAttrSet (resourceName , "time_created" ),
242-
243- func (s * terraform.State ) (err error ) {
244- resId2 , err = fromInstanceState (s , resourceName , "id" )
245- if resId == resId2 {
246- return fmt .Errorf ("Resource was expected to be recreated when updating parameter InstanceId but the id did not change." )
247- }
248- resId = resId2
249- return err
250- },
251- ),
252- },
253- },
254- })
255- }
0 commit comments