Skip to content

Commit 8873d8b

Browse files
committed
Use the random suffix in the private location label as well
1 parent ed690e9 commit 8873d8b

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

internal/kibana/synthetics/private_location/acc_test.go

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ func TestSyntheticPrivateLocationResource(t *testing.T) {
3838
// Create and Read testing
3939
{
4040
SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaPrivateLocationAPIVersion),
41-
Config: testConfig("testacc", "test_policy", randomSuffix) + `
41+
Config: testConfig("testacc", "test_policy", randomSuffix) + fmt.Sprintf(`
4242
resource "elasticstack_kibana_synthetics_private_location" "test" {
43-
label = "pl-test-label"
43+
label = "pl-test-label-%s"
4444
agent_policy_id = elasticstack_fleet_agent_policy.test_policy.policy_id
4545
tags = ["a", "b"]
4646
geo = {
4747
lat = 42.42
4848
lon = -42.42
4949
}
5050
}
51-
`,
51+
`, randomSuffix),
5252
Check: resource.ComposeAggregateTestCheckFunc(
53-
resource.TestCheckResourceAttr(resourceId, "label", "pl-test-label"),
53+
resource.TestCheckResourceAttr(resourceId, "label", fmt.Sprintf("pl-test-label-%s", randomSuffix)),
5454
resource.TestCheckResourceAttrSet(resourceId, "agent_policy_id"),
5555
resource.TestCheckResourceAttr(resourceId, "tags.#", "2"),
5656
resource.TestCheckResourceAttr(resourceId, "tags.0", "a"),
@@ -65,34 +65,34 @@ resource "elasticstack_kibana_synthetics_private_location" "test" {
6565
ResourceName: resourceId,
6666
ImportState: true,
6767
ImportStateVerify: true,
68-
Config: testConfig("testacc", "test_policy", randomSuffix) + `
68+
Config: testConfig("testacc", "test_policy", randomSuffix) + fmt.Sprintf(`
6969
resource "elasticstack_kibana_synthetics_private_location" "test" {
70-
label = "pl-test-label"
70+
label = "pl-test-label-%s"
7171
agent_policy_id = elasticstack_fleet_agent_policy.test_policy.policy_id
7272
tags = ["a", "b"]
7373
geo = {
7474
lat = 42.42
7575
lon = -42.42
7676
}
7777
}
78-
`,
78+
`, randomSuffix),
7979
},
8080
// Update and Read testing
8181
{
8282
SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaPrivateLocationAPIVersion),
83-
Config: testConfig("default", "test_policy_default", randomSuffix) + `
83+
Config: testConfig("default", "test_policy_default", randomSuffix) + fmt.Sprintf(`
8484
resource "elasticstack_kibana_synthetics_private_location" "test" {
85-
label = "pl-test-label-2"
85+
label = "pl-test-label-2-%s"
8686
agent_policy_id = elasticstack_fleet_agent_policy.test_policy_default.policy_id
8787
tags = ["c", "d", "e"]
8888
geo = {
8989
lat = -33.21
9090
lon = -33.21
9191
}
9292
}
93-
`,
93+
`, randomSuffix),
9494
Check: resource.ComposeAggregateTestCheckFunc(
95-
resource.TestCheckResourceAttr(resourceId, "label", "pl-test-label-2"),
95+
resource.TestCheckResourceAttr(resourceId, "label", fmt.Sprintf("pl-test-label-2-%s", randomSuffix)),
9696
resource.TestCheckResourceAttrSet(resourceId, "agent_policy_id"),
9797
resource.TestCheckResourceAttr(resourceId, "tags.#", "3"),
9898
resource.TestCheckResourceAttr(resourceId, "tags.0", "c"),
@@ -105,14 +105,14 @@ resource "elasticstack_kibana_synthetics_private_location" "test" {
105105
// Update and Read testing
106106
{
107107
SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaPrivateLocationAPIVersion),
108-
Config: testConfig("default", "test_policy_default", randomSuffix) + `
108+
Config: testConfig("default", "test_policy_default", randomSuffix) + fmt.Sprintf(`
109109
resource "elasticstack_kibana_synthetics_private_location" "test" {
110-
label = "pl-test-label-2"
110+
label = "pl-test-label-2-%s"
111111
agent_policy_id = elasticstack_fleet_agent_policy.test_policy_default.policy_id
112112
}
113-
`,
113+
`, randomSuffix),
114114
Check: resource.ComposeAggregateTestCheckFunc(
115-
resource.TestCheckResourceAttr(resourceId, "label", "pl-test-label-2"),
115+
resource.TestCheckResourceAttr(resourceId, "label", fmt.Sprintf("pl-test-label-2-%s", randomSuffix)),
116116
resource.TestCheckResourceAttrSet(resourceId, "agent_policy_id"),
117117
resource.TestCheckNoResourceAttr(resourceId, "tags"),
118118
resource.TestCheckNoResourceAttr(resourceId, "geo"),
@@ -121,15 +121,15 @@ resource "elasticstack_kibana_synthetics_private_location" "test" {
121121
// Update and Read testing
122122
{
123123
SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaPrivateLocationAPIVersion),
124-
Config: testConfig("default", "test_policy_default", randomSuffix) + `
124+
Config: testConfig("default", "test_policy_default", randomSuffix) + fmt.Sprintf(`
125125
resource "elasticstack_kibana_synthetics_private_location" "test" {
126-
label = "pl-test-label-2"
126+
label = "pl-test-label-2-%s"
127127
agent_policy_id = elasticstack_fleet_agent_policy.test_policy_default.policy_id
128128
tags = ["c", "d", "e"]
129129
}
130-
`,
130+
`, randomSuffix),
131131
Check: resource.ComposeAggregateTestCheckFunc(
132-
resource.TestCheckResourceAttr(resourceId, "label", "pl-test-label-2"),
132+
resource.TestCheckResourceAttr(resourceId, "label", fmt.Sprintf("pl-test-label-2-%s", randomSuffix)),
133133
resource.TestCheckResourceAttrSet(resourceId, "agent_policy_id"),
134134
resource.TestCheckResourceAttr(resourceId, "tags.#", "3"),
135135
resource.TestCheckResourceAttr(resourceId, "tags.0", "c"),
@@ -141,18 +141,18 @@ resource "elasticstack_kibana_synthetics_private_location" "test" {
141141
// Update and Read testing
142142
{
143143
SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaPrivateLocationAPIVersion),
144-
Config: testConfig("default", "test_policy_default", randomSuffix) + `
144+
Config: testConfig("default", "test_policy_default", randomSuffix) + fmt.Sprintf(`
145145
resource "elasticstack_kibana_synthetics_private_location" "test" {
146-
label = "pl-test-label-2"
146+
label = "pl-test-label-2-%s"
147147
agent_policy_id = elasticstack_fleet_agent_policy.test_policy_default.policy_id
148148
geo = {
149149
lat = -33.21
150150
lon = -33.21
151151
}
152152
}
153-
`,
153+
`, randomSuffix),
154154
Check: resource.ComposeAggregateTestCheckFunc(
155-
resource.TestCheckResourceAttr(resourceId, "label", "pl-test-label-2"),
155+
resource.TestCheckResourceAttr(resourceId, "label", fmt.Sprintf("pl-test-label-2-%s", randomSuffix)),
156156
resource.TestCheckResourceAttrSet(resourceId, "agent_policy_id"),
157157
resource.TestCheckNoResourceAttr(resourceId, "tags"),
158158
resource.TestCheckResourceAttr(resourceId, "geo.lat", "-33.21"),

0 commit comments

Comments
 (0)