Skip to content

Commit

Permalink
fix(tests/k8saudit): adapt tests to rules v0.9.0
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Dellaluce <[email protected]>
  • Loading branch information
jasondellaluce authored and poiana committed May 7, 2024
1 parent 4c71962 commit 527631d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/k8saudit/k8saudit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func TestK8SAudit_Legacy_DeleteClusterrolebinding(t *testing.T) {
)
assert.NotZero(t, res.Detections().Count())
assert.NotZero(t, res.Detections().OfPriority("INFO").Count())
assert.Equal(t, 1, res.Detections().OfRule("K8s Role/Clusterrolebinding Deleted").Count())
assert.Equal(t, 1, res.Detections().OfRule("K8s ClusterRoleBinding Deleted").Count())
assert.NoError(t, res.Err(), "%s", res.Stderr())
assert.Equal(t, 0, res.ExitCode())
}
Expand Down Expand Up @@ -773,7 +773,7 @@ func TestK8SAudit_Legacy_DeleteClusterrole(t *testing.T) {
)
assert.NotZero(t, res.Detections().Count())
assert.NotZero(t, res.Detections().OfPriority("INFO").Count())
assert.Equal(t, 1, res.Detections().OfRule("K8s Role/Clusterrole Deleted").Count())
assert.Equal(t, 1, res.Detections().OfRule("K8s ClusterRole Deleted").Count())
assert.NoError(t, res.Err(), "%s", res.Stderr())
assert.Equal(t, 0, res.ExitCode())
}
Expand Down Expand Up @@ -856,7 +856,7 @@ func TestK8SAudit_Legacy_CreateClusterrole(t *testing.T) {
)
assert.NotZero(t, res.Detections().Count())
assert.NotZero(t, res.Detections().OfPriority("INFO").Count())
assert.Equal(t, 1, res.Detections().OfRule("K8s Role/Clusterrole Created").Count())
assert.Equal(t, 1, res.Detections().OfRule("K8s ClusterRole Created").Count())
assert.NoError(t, res.Err(), "%s", res.Stderr())
assert.Equal(t, 0, res.ExitCode())
}
Expand All @@ -873,7 +873,7 @@ func TestK8SAudit_Legacy_CreateClusterrolebinding(t *testing.T) {
)
assert.NotZero(t, res.Detections().Count())
assert.NotZero(t, res.Detections().OfPriority("INFO").Count())
assert.Equal(t, 1, res.Detections().OfRule("K8s Role/Clusterrolebinding Created").Count())
assert.Equal(t, 1, res.Detections().OfRule("K8s ClusterRoleBinding Created").Count(), res.Stdout())
assert.NoError(t, res.Err(), "%s", res.Stderr())
assert.Equal(t, 0, res.ExitCode())
}
Expand Down

0 comments on commit 527631d

Please sign in to comment.