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 Jan 26, 2024
1 parent 4b26d21 commit 2cb1ba6
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/e2e/serial/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func TestMixProductScan(t *testing.T) {

// Wait until the scan completes
// after the scan is done
if err := f.WaitForSuiteScansStatus(f.OperatorNamespace, bindingName, compv1alpha1.PhaseDone, compv1alpha1.ResultNonCompliant); err != nil {
if err := f.WaitForSuiteScansStatus(f.OperatorNamespace, bindingName, compv1alpha1.PhaseDone, compv1alpha1.ResultInconsistent); err != nil {
t.Fatal(err)
}

Expand All @@ -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 2cb1ba6

Please sign in to comment.