Skip to content

Commit 76b43c4

Browse files
committed
use existing exception name
1 parent 0c53e48 commit 76b43c4

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

sysdig/resource_sysdig_secure_rule_stateful_test.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
package sysdig_test
44

55
import (
6-
"fmt"
76
"os"
87
"strings"
98
"testing"
109

1110
"github.com/draios/terraform-provider-sysdig/sysdig"
12-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
1311
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1412
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1513
)
@@ -21,28 +19,26 @@ func TestRuleStatefulAppends(t *testing.T) {
2119
}
2220
steps := []resource.TestStep{
2321
{
24-
Config: ruleStatefulAppend(rName()),
22+
Config: ruleStatefulAppend(),
2523
},
2624
}
2725
runStatefulTest(steps, t)
2826
}
2927

30-
func ruleStatefulAppend(name string) string {
31-
return fmt.Sprintf(`
28+
func ruleStatefulAppend() string {
29+
return `
3230
resource "sysdig_secure_rule_stateful" "stateful_rule_append" {
3331
name = "API Gateway Enumeration Detected"
3432
source = "awscloudtrail_stateful"
3533
ruletype = "STATEFUL_SEQUENCE"
3634
append = true
3735
exceptions {
3836
values = jsonencode([["abc", ["docker.io/library/busybox"]]])
39-
name = "tf_append_%s"
37+
name = "user_accountid"
4038
}
41-
}`, name)
39+
}`
4240
}
4341

44-
func rName() string { return acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) }
45-
4642
func runStatefulTest(steps []resource.TestStep, t *testing.T) {
4743
resource.Test(t, resource.TestCase{
4844
PreCheck: func() {

0 commit comments

Comments
 (0)