Skip to content

Commit f343977

Browse files
committed
fix tests
1 parent a7adf49 commit f343977

File tree

1 file changed

+5
-42
lines changed

1 file changed

+5
-42
lines changed

internal/fleet/integration_policy/resource_test.go

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,6 @@ func TestAccResourceIntegrationPolicyMultipleAgentPolicies(t *testing.T) {
4545
})
4646
}
4747

48-
func TestAccResourceIntegrationPolicyValidation(t *testing.T) {
49-
policyName := sdkacctest.RandStringFromCharSet(22, sdkacctest.CharSetAlphaNum)
50-
51-
resource.Test(t, resource.TestCase{
52-
PreCheck: func() { acctest.PreCheck(t) },
53-
ProtoV6ProviderFactories: acctest.Providers,
54-
Steps: []resource.TestStep{
55-
{
56-
SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionIntegrationPolicy),
57-
Config: testAccResourceIntegrationPolicyCreateWithNoAgentPolicyFields(policyName),
58-
ExpectError: regexp.MustCompile("Either 'agent_policy_id' or 'agent_policy_ids' must be provided"),
59-
},
60-
},
61-
})
62-
}
63-
6448
func TestAccResourceIntegrationPolicyBothAgentPolicyFields(t *testing.T) {
6549
policyName := sdkacctest.RandStringFromCharSet(22, sdkacctest.CharSetAlphaNum)
6650

@@ -554,13 +538,17 @@ resource "elasticstack_fleet_integration_policy" "test_policy" {
554538
integration_version = elasticstack_fleet_integration.test_policy.version
555539
input {
556540
input_id = "tcp-tcp"
557-
enabled = true
558541
streams_json = jsonencode({
559542
"tcp.generic": {
560543
"enabled": true
561544
"vars": {
562545
"listen_address": "localhost"
563546
"listen_port": 8080
547+
"data_stream.dataset": "tcp.generic"
548+
"tags": []
549+
"syslog_options": "field: message"
550+
"ssl": ""
551+
"custom": ""
564552
}
565553
}
566554
})
@@ -603,28 +591,3 @@ resource "elasticstack_fleet_integration_policy" "test_policy" {
603591
}
604592
`, id, id)
605593
}
606-
607-
func testAccResourceIntegrationPolicyCreateWithNoAgentPolicyFields(id string) string {
608-
return fmt.Sprintf(`
609-
provider "elasticstack" {
610-
elasticsearch {}
611-
kibana {}
612-
}
613-
resource "elasticstack_fleet_integration" "test_policy" {
614-
name = "tcp"
615-
version = "1.16.0"
616-
force = true
617-
}
618-
resource "elasticstack_fleet_integration_policy" "test_policy" {
619-
name = "%s"
620-
namespace = "default"
621-
description = "IntegrationPolicyTest Policy"
622-
integration_name = elasticstack_fleet_integration.test_policy.name
623-
integration_version = elasticstack_fleet_integration.test_policy.version
624-
input {
625-
input_id = "tcp-tcp"
626-
enabled = true
627-
}
628-
}
629-
`, id)
630-
}

0 commit comments

Comments
 (0)