Skip to content

Commit d24c0d4

Browse files
committed
removing force new tests
1 parent 4eae8a6 commit d24c0d4

File tree

140 files changed

+700
-6725
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+700
-6725
lines changed

docs/core/vcns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ The following arguments are supported:
106106

107107
The following attributes are exported:
108108

109-
* `virtual_networks` - The list of vcns.
109+
* `virtual_networks` - The list of virtual_networks.
110110

111111
### Example Usage
112112

docs/identity/swift_passwords.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ The following arguments are supported:
8181

8282
The following attributes are exported:
8383

84-
* `swift_passwords` - The list of swift_passwords.
84+
* `passwords` - The list of passwords.
8585

8686
### Example Usage
8787

docs/identity/user_group_memberships.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The following arguments are supported:
7575

7676
The following attributes are exported:
7777

78-
* `user_group_memberships` - The list of user_group_memberships.
78+
* `memberships` - The list of memberships.
7979

8080
### Example Usage
8181

docs/load_balancer/load_balancer_policies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The following arguments are supported:
1414

1515
The following attributes are exported:
1616

17-
* `policies` - The list of load_balancer_policies.
17+
* `policies` - The list of policies.
1818

1919
### Example Usage
2020

provider/core_boot_volume_attachment_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ func TestCoreBootVolumeAttachmentResource_basic(t *testing.T) {
2323
provider := testAccProvider
2424
config := testProviderConfig()
2525

26-
compartmentId2 := getRequiredEnvSetting("compartment_id_for_update")
27-
compartmentIdVariableStr2 := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId2)
26+
compartmentId := getRequiredEnvSetting("compartment_ocid")
27+
compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId)
2828

2929
datasourceName := "data.oci_core_boot_volume_attachments.test_boot_volume_attachments"
3030

@@ -45,10 +45,10 @@ data "oci_core_boot_volume_attachments" "test_boot_volume_attachments" {
4545
boot_volume_id = "${oci_core_instance.test_instance.boot_volume_id}"
4646
instance_id = "${oci_core_instance.test_instance.id}"
4747
}
48-
` + compartmentIdVariableStr2 + BootVolumeAttachmentResourceConfig,
49-
Check: resource.ComposeTestCheckFunc(
48+
` + compartmentIdVariableStr + BootVolumeAttachmentResourceConfig,
49+
Check: resource.ComposeAggregateTestCheckFunc(
5050
resource.TestCheckResourceAttrSet(datasourceName, "boot_volume_id"),
51-
resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId2),
51+
resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId),
5252
resource.TestCheckResourceAttrSet(datasourceName, "instance_id"),
5353

5454
resource.TestCheckResourceAttr(datasourceName, "boot_volume_attachments.#", "1"),
@@ -70,9 +70,9 @@ data "oci_core_boot_volume_attachments" "test_boot_volume_attachments" {
7070
availability_domain = "${oci_core_instance.test_instance.availability_domain}"
7171
compartment_id = "${var.compartment_id}"
7272
}
73-
` + compartmentIdVariableStr2 + BootVolumeAttachmentResourceConfig,
74-
Check: resource.ComposeTestCheckFunc(
75-
resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId2),
73+
` + compartmentIdVariableStr + BootVolumeAttachmentResourceConfig,
74+
Check: resource.ComposeAggregateTestCheckFunc(
75+
resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId),
7676
resource.TestMatchResourceAttr(datasourceName, "boot_volume_attachments.#", regexp.MustCompile("[1-9][0-9]*")),
7777
),
7878
},

provider/core_boot_volume_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ func TestCoreBootVolumeResource_basic(t *testing.T) {
5151
provider := testAccProvider
5252
config := testProviderConfig()
5353

54-
compartmentId2 := getRequiredEnvSetting("compartment_id_for_update")
55-
compartmentIdVariableStr2 := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId2)
54+
compartmentId := getRequiredEnvSetting("compartment_ocid")
55+
compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId)
56+
5657
datasourceName := "data.oci_core_boot_volumes.test_boot_volumes"
5758

5859
resource.Test(t, resource.TestCase{
@@ -69,9 +70,9 @@ func TestCoreBootVolumeResource_basic(t *testing.T) {
6970
compartment_id = "${var.compartment_id}"
7071
7172
}
72-
` + compartmentIdVariableStr2,
73-
Check: resource.ComposeTestCheckFunc(
74-
resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId2),
73+
` + compartmentIdVariableStr,
74+
Check: resource.ComposeAggregateTestCheckFunc(
75+
resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId),
7576

7677
resource.TestCheckResourceAttrSet(datasourceName, "boot_volumes.#"),
7778
resource.TestCheckResourceAttrSet(datasourceName, "boot_volumes.0.availability_domain"),

provider/core_console_history_content_data_source_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (s *CoreConsoleHistoryDataDatasourceTestSuite) TestAccDatasourceCoreConsole
4242
ImportState: true,
4343
ImportStateVerify: true,
4444
Config: s.Config,
45-
Check: resource.ComposeTestCheckFunc(
45+
Check: resource.ComposeAggregateTestCheckFunc(
4646
resource.TestCheckResourceAttrSet(s.ResourceName, "id"),
4747
resource.TestCheckResourceAttrSet(s.ResourceName, "console_history_id"),
4848
resource.TestCheckResourceAttrSet(s.ResourceName, "data"),

provider/core_console_history_resource_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (s *ResourceCoreConsoleHistoryTestSuite) TestAccResourceCoreInstanceConsole
4747
resource "oci_core_console_history" "t" {
4848
instance_id = "${oci_core_instance.t.id}"
4949
}`,
50-
Check: resource.ComposeTestCheckFunc(
50+
Check: resource.ComposeAggregateTestCheckFunc(
5151
resource.TestCheckResourceAttrSet(s.ResourceName, "id"),
5252
resource.TestCheckResourceAttrSet(s.ResourceName, "instance_id"),
5353
resource.TestCheckResourceAttrSet(s.ResourceName, "compartment_id"),

provider/core_console_history_test.go

Lines changed: 8 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ resource "oci_core_console_history" "test_console_history" {
3030
ConsoleHistoryPropertyVariables = `
3131
variable "console_history_availability_domain" { default = "availabilityDomain" }
3232
variable "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 + `
10098
variable "console_history_availability_domain" { default = "availabilityDomain" }
10199
variable "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" }
153125
variable "console_history_display_name" { default = "displayName2" }
154126
variable "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-
}

provider/core_cpe_resource_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (s *ResourceCoreCpeTestSuite) TestAccResourceCoreCpe_basic() {
4040
ImportState: true,
4141
ImportStateVerify: true,
4242
Config: s.Config,
43-
Check: resource.ComposeTestCheckFunc(
43+
Check: resource.ComposeAggregateTestCheckFunc(
4444
resource.TestCheckResourceAttr(s.ResourceName, "compartment_id", compartmentId),
4545
resource.TestCheckResourceAttr(s.ResourceName, "display_name", "-tf-cpe"),
4646
resource.TestCheckResourceAttrSet(s.ResourceName, "id"),

0 commit comments

Comments
 (0)