Skip to content

Commit

Permalink
OCP4/e2e: TestMixProductScan INCONSISTENT for file_permissions_var_lo…
Browse files Browse the repository at this point in the history
…g_kube_audit

E2e tests have been flaky because of the file_permissions_var_log_kube_audit rule. This is because there is a bug in the API-server in old versions of OCP[1][2]. For now, we'll just check that the scan is not inconsistent until we upgrade to a version that has the fix. [1]https://bugzilla.redhat.com/show_bug.cgi?id=2001442 [2]ComplianceAsCode/content@6343659
  • Loading branch information
Vincent056 committed Mar 4, 2024
1 parent dc8068c commit d45bb1e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/e2e/serial/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,20 @@ func TestMixProductScan(t *testing.T) {
if s.Phase != compv1alpha1.PhaseDone {
t.Fatalf("expected scan %s to be done", scan)
}
// E2e tests have been flaky because of the file_permissions_var_log_kube_audit
// rule. This is because there is a bug in the API-server in old versions of OCP[1][2].
// For now, we'll just check that the scan is not inconsistent until we upgrade
// to a version that has the fix.
// [1]https://bugzilla.redhat.com/show_bug.cgi?id=2001442
// [2]https://github.com/ComplianceAsCode/content/commit/6343659d1d25e97c66a5c1eaf8eb2ee20d1af920
if s.Result == compv1alpha1.ResultInconsistent {
// check if the scan is "ocp4-moderate-node-master"
if scan != "ocp4-moderate-node-master" {
t.Fatalf("expected scan %s not to be inconsistent", scan)
}
} else if s.Result != compv1alpha1.ResultCompliant && s.Result != compv1alpha1.ResultNonCompliant {
t.Fatalf("expected scan %s to be compliant or non-compliant", scan)
}
break
}
}
Expand Down

0 comments on commit d45bb1e

Please sign in to comment.