Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tests/k8saudit): adapt tests to rules v0.9.0 #53

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading