Skip to content

Commit 8404167

Browse files
committed
separate test, passes
1 parent 044b04e commit 8404167

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

internal/fleet/agent_policy/resource_test.go

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,6 @@ func TestAccResourceAgentPolicy(t *testing.T) {
162162
resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags"),
163163
),
164164
},
165-
{
166-
SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags),
167-
Config: testAccResourceAgentPolicyUpdateWithBadGlobalDataTags(policyNameGlobalDataTags, true),
168-
ExpectError: regexp.MustCompile(".*Error: Invalid Attribute Combination.*"),
169-
},
170165
},
171166
})
172167
}
@@ -195,6 +190,23 @@ func TestAccResourceAgentPolicySkipDestroy(t *testing.T) {
195190
})
196191
}
197192

193+
func TestAccResourceAgentPolicyWithBadGlobalDataTags(t *testing.T) {
194+
policyName := sdkacctest.RandStringFromCharSet(22, sdkacctest.CharSetAlphaNum)
195+
196+
resource.Test(t, resource.TestCase{
197+
PreCheck: func() { acctest.PreCheck(t) },
198+
// CheckDestroy: func(s *state.State) { return nil },
199+
ProtoV6ProviderFactories: acctest.Providers,
200+
Steps: []resource.TestStep{
201+
{
202+
SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags),
203+
Config: testAccResourceAgentPolicyUpdateWithBadGlobalDataTags(policyName, true),
204+
ExpectError: regexp.MustCompile(".*Error: Invalid Attribute Combination.*"),
205+
},
206+
},
207+
})
208+
}
209+
198210
func testAccResourceAgentPolicyCreate(id string, skipDestroy bool) string {
199211
return fmt.Sprintf(`
200212
provider "elasticstack" {

0 commit comments

Comments
 (0)