From 7d7be28d0406d5d8dd7d185346aad5c292d2456d Mon Sep 17 00:00:00 2001 From: Sanskar Sharma Date: Tue, 30 Jul 2024 02:33:32 +0530 Subject: [PATCH] fix: vex generatation and parse test (#4287) --- requirements.txt | 2 +- test/test_vex.py | 2 +- test/vex/test_cyclonedx_vex.json | 19 +++++++++---------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/requirements.txt b/requirements.txt index 5ceb406231..b91210d9e6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ importlib_metadata>=3.6; python_version < "3.10" importlib_resources; python_version < "3.9" jinja2>=2.11.3 jsonschema>=3.0.2 -lib4sbom>=0.7.0 +lib4sbom>=0.7.2 lib4vex>=0.1.0 python-gnupg packageurl-python diff --git a/test/test_vex.py b/test/test_vex.py index e33fa5ffb2..aec1910fa6 100644 --- a/test/test_vex.py +++ b/test/test_vex.py @@ -208,7 +208,7 @@ class TestVexParse: "CVE-1234-1005": { "remarks": Remarks.NotAffected, "comments": "", - "response": [], + "response": "will_not_fix", "justification": "code_not_reachable", }, "paths": {}, diff --git a/test/vex/test_cyclonedx_vex.json b/test/vex/test_cyclonedx_vex.json index 66a1183938..271c10fff1 100644 --- a/test/vex/test_cyclonedx_vex.json +++ b/test/vex/test_cyclonedx_vex.json @@ -44,10 +44,7 @@ }, "affects": [ { - "ref": "urn:cbt:1/vendor0#product0:1.0", - "versions": { - "status": "unknown" - } + "ref": "urn:cbt:1/vendor0#product0:1.0" } ] }, @@ -63,13 +60,17 @@ "updated": "2024-06-14T22:39:24Z", "analysis": { "state": "not_affected", - "detail": "Detail field populated.", - "justification": "code_not_reachable" + "detail": "NotAffected: Detail field populated.", + "justification": "code_not_reachable", + "response": [ + "will_not_fix" + ] }, "affects": [ { "ref": "urn:cbt:1/vendor0#product0:1.0", "versions": { + "version": "1.0", "status": "unaffected" } } @@ -93,6 +94,7 @@ { "ref": "urn:cbt:1/vendor0#product0:2.8.6", "versions": { + "version": "2.8.6", "status": "affected" } } @@ -114,10 +116,7 @@ }, "affects": [ { - "ref": "urn:cbt:1/vendor0#product0:2.8.6", - "versions": { - "status": "unknown" - } + "ref": "urn:cbt:1/vendor0#product0:2.8.6" } ] }