Skip to content

Commit

Permalink
Fix CVE Audit testsuite tests
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Arlt <parlt@suse.com>
  • Loading branch information
parlt91 committed Feb 20, 2024
1 parent 703af5e commit ba1466c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@ public List<CVEAuditServer> listSystemsByPatchStatus(User loggedInUser,
else {
for (String label : patchStatusLabels) {
try {
patchStatuses.add(PatchStatus.valueOf(label));
// TODO: Adapt to use new patch statuses
if (label.equals("AFFECTED_PATCH_APPLICABLE")) {
patchStatuses.add(PatchStatus.AFFECTED_FULL_PATCH_APPLICABLE);
}
else {
patchStatuses.add(PatchStatus.valueOf(label));
}
}
catch (IllegalArgumentException e) {
throw new MethodInvalidParamException(e);
Expand Down Expand Up @@ -189,7 +195,13 @@ public List<CVEAuditImage> listImagesByPatchStatus(User loggedInUser,
else {
for (String label : patchStatusLabels) {
try {
patchStatuses.add(PatchStatus.valueOf(label));
// TODO: Adapt to use new patch statuses
if (label.equals("AFFECTED_PATCH_APPLICABLE")) {
patchStatuses.add(PatchStatus.AFFECTED_FULL_PATCH_APPLICABLE);
}
else {
patchStatuses.add(PatchStatus.valueOf(label));
}
}
catch (IllegalArgumentException e) {
throw new MethodInvalidParamException(e);
Expand Down
2 changes: 1 addition & 1 deletion testsuite/features/secondary/min_cve_audit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Feature: CVE Audit on SLE Salt Minions
When I call audit.list_systems_by_patch_status() with CVE identifier "CVE-1999-9979"
Then I should get status "NOT_AFFECTED" for "sle_minion"
When I call audit.list_systems_by_patch_status() with CVE identifier "CVE-1999-9999"
Then I should get status "AFFECTED_PATCH_APPLICABLE" for "sle_minion"
Then I should get status "AFFECTED_FULL_PATCH_APPLICABLE" for "sle_minion"
And I should get the "fake-rpm-suse-channel" channel label
And I should get the "milkyway-dummy-2345" patch

Expand Down

0 comments on commit ba1466c

Please sign in to comment.