Skip to content

Commit 79e7e74

Browse files
Fixed a problem when the clean up code doesn't clean everything properly between runs.
1 parent 3fbeb1d commit 79e7e74

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sysdig/resource_sysdig_secure_rule_falco_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func TestRuleFalcoCloudAWSCloudtrail(t *testing.T) {
243243
func TestRuleFalcoCloudAWSCloudtrailAppend(t *testing.T) {
244244
steps := []resource.TestStep{
245245
{
246-
Config: ruleFalcoCloudAWSCloudtrailWithAppend(),
246+
Config: RuleFalcoCloudAWSCloudtrailWithAppend(randomString()),
247247
},
248248
}
249249
runTest(steps, t)
@@ -449,18 +449,18 @@ resource "sysdig_secure_rule_falco" "falco_rule_with_exceptions" {
449449
}
450450

451451
func existingFalcoRuleWithExceptions(name string) string {
452-
return `
452+
return fmt.Sprintf(`
453453
resource "sysdig_secure_rule_falco" "attach_to_cluster_admin_role_exceptions" {
454454
name = "Terminal shell in container" # Sysdig-provided
455455
append = true
456456
457457
exceptions {
458-
name = "proc_name"
458+
name = "proc_name_%s"
459459
fields = ["proc.name"]
460460
comps = ["in"]
461461
values = jsonencode([["sh"]])
462462
}
463-
}`
463+
}`, name)
464464
}
465465

466466
func ruleFalcoTerminalShellWithMinimumEngineVersion(name string) string {
@@ -492,19 +492,19 @@ resource "sysdig_secure_rule_falco" "awscloudtrail" {
492492
}`, name, name)
493493
}
494494

495-
func ruleFalcoCloudAWSCloudtrailWithAppend() string {
496-
return `
495+
func RuleFalcoCloudAWSCloudtrailWithAppend(name string) string {
496+
return fmt.Sprintf(`
497497
resource "sysdig_secure_rule_falco" "awscloudtrail_append" {
498498
name = "Amplify Create App"
499499
source = "awscloudtrail"
500500
append = true
501501
exceptions {
502-
name = "user_name"
502+
name = "user_name_%s"
503503
fields = ["ct.user"]
504504
comps = ["="]
505505
values = jsonencode([ ["user_a"] ])
506506
}
507-
}`
507+
}`, name)
508508
}
509509

510510
func ruleOkta(name string) string {

0 commit comments

Comments
 (0)