Skip to content

Commit

Permalink
Update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ra1nb0rn committed Oct 24, 2024
1 parent 2a45bc9 commit fe1d0a2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog
This file keeps track of all notable changes between the different versions of search_vulns.

## v0.6.2 - 2024-10-24
### Fixed
- Updated test cases.


## v0.6.1 - 2024-10-18
### Added
- Added equivalent CPEs.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cve_completeness.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_search_vmware_spring_framework_5326(self):
self.maxDiff = None
query = 'cpe:2.3:a:vmware:spring_framework:5.3.26:*:*:*:*:*:*:*'
result = search_vulns.search_vulns(query=query, add_other_exploit_refs=True, is_good_cpe=True)
expected_cves = ['CVE-2016-1000027', 'CVE-2023-20863', 'CVE-2024-22243', 'CVE-2024-22259', 'CVE-2024-22262', 'CVE-2024-38809']
expected_cves = ['CVE-2016-1000027', 'CVE-2023-20863', 'CVE-2024-22243', 'CVE-2024-22259', 'CVE-2024-22262', 'CVE-2024-38809', 'CVE-2024-38820']
result_cves = [vuln_id for vuln_id in result[query]['vulns'].keys() if vuln_id.startswith('CVE-')]
self.assertEqual(set(expected_cves), set(result_cves))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_ghsa_completeness.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_search_vmware_spring_framework_5_3_26(self):
self.maxDiff = None
query = 'cpe:2.3:a:vmware:spring_framework:5.3.26:*:*:*:*:*:*:*'
result = search_vulns.search_vulns(query=query, is_good_cpe=False)
expected_vulns = {'CVE-2023-20863': 'GHSA-wxqc-pxw9-g2p8', 'CVE-2016-1000027': 'GHSA-4wrc-f8pq-fpqp', 'CVE-2024-22262': 'GHSA-2wrp-6fg6-hmc5', 'CVE-2024-22243': 'GHSA-ccgv-vj62-xf9h', 'CVE-2024-22259': 'GHSA-hgjh-9rj2-g67j', 'GHSA-9cmq-m9j5-mvww': {'published': '2024-08-20 09:30:28', 'cvss_ver': '3.1', 'cvss': '4.3', 'cvss_vec': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L', 'aliases': ['CVE-2024-38808']}, 'CVE-2024-38809': 'GHSA-2rmj-mq67-h97g', 'GHSA-cx7f-g6mp-7hqm': {'published': '2024-09-13 06:30:42', 'cvss_ver': '3.1', 'cvss': '7.5', 'cvss_vec': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N', 'aliases': ['CVE-2024-38816']}}
expected_vulns = {'CVE-2023-20863': 'GHSA-wxqc-pxw9-g2p8', 'CVE-2016-1000027': 'GHSA-4wrc-f8pq-fpqp', 'CVE-2024-22262': 'GHSA-2wrp-6fg6-hmc5', 'CVE-2024-22243': 'GHSA-ccgv-vj62-xf9h', 'CVE-2024-22259': 'GHSA-hgjh-9rj2-g67j', 'GHSA-9cmq-m9j5-mvww': {'published': '2024-08-20 09:30:28', 'cvss_ver': '3.1', 'cvss': '4.3', 'cvss_vec': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L', 'aliases': ['CVE-2024-38808']}, 'CVE-2024-38809': 'GHSA-2rmj-mq67-h97g', 'GHSA-cx7f-g6mp-7hqm': {'published': '2024-09-13 06:30:42', 'cvss_ver': '3.1', 'cvss': '7.5', 'cvss_vec': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N', 'aliases': ['CVE-2024-38816']}, 'CVE-2024-38820': 'GHSA-4gc7-5j7h-4qph'}
expected_ghsa_vulns = [expected_vulns[vuln_id] if vuln_id.startswith('CVE') else vuln_id for vuln_id in expected_vulns]
expected_not_matching = {}
actual_ghsa_vulns = []
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.1
0.6.2

0 comments on commit fe1d0a2

Please sign in to comment.