From 5ca1babc4113c8ad5d10f3856c166881cb935a63 Mon Sep 17 00:00:00 2001 From: Terri Oda Date: Thu, 11 Jan 2024 16:11:56 -0800 Subject: [PATCH] test: re-enable failing tests from #3653 (#3720) * test: try re-enabling exploit test * test: re-add test_csv2cve tests * test: re-enable language scanner tests * test: re-enable test_sbom tests --- cve_bin_tool/cvedb.py | 2 +- test/test_csv2cve.py | 1 - test/test_exploits.py | 1 - test/test_language_scanner.py | 2 -- test/test_sbom.py | 3 --- 5 files changed, 1 insertion(+), 8 deletions(-) diff --git a/cve_bin_tool/cvedb.py b/cve_bin_tool/cvedb.py index 748dd74764..a27e3aa984 100644 --- a/cve_bin_tool/cvedb.py +++ b/cve_bin_tool/cvedb.py @@ -54,10 +54,10 @@ class CVEDB: BACKUPCACHEDIR = DISK_LOCATION_BACKUP LOGGER = LOGGER.getChild("CVEDB") SOURCES = [ - nvd_source.NVD_Source, curl_source.Curl_Source, osv_source.OSV_Source, gad_source.GAD_Source, + nvd_source.NVD_Source, # last to avoid data overwrites ] INSERT_QUERIES = { diff --git a/test/test_csv2cve.py b/test/test_csv2cve.py index 40ba595a6c..b8db9b70f8 100644 --- a/test/test_csv2cve.py +++ b/test/test_csv2cve.py @@ -11,7 +11,6 @@ class TestCSV2CVE: - @pytest.mark.skip(reason="Temporarily disabled -- may need data changes") @pytest.mark.asyncio async def test_csv2cve_valid_file(self, caplog): file_path = join(dirname(__file__), "csv", "triage.csv") diff --git a/test/test_exploits.py b/test/test_exploits.py index d10a64acee..f6c752a5ec 100644 --- a/test/test_exploits.py +++ b/test/test_exploits.py @@ -8,7 +8,6 @@ class TestExploitScanner: - @pytest.mark.skip(reason="Temporarily disabled -- may need data changes") @pytest.mark.parametrize( "check_exploits, exploits_list, product_info, triage_info, expected_result", ( diff --git a/test/test_language_scanner.py b/test/test_language_scanner.py index eedc81eba6..b0966ec910 100644 --- a/test/test_language_scanner.py +++ b/test/test_language_scanner.py @@ -163,7 +163,6 @@ def setup_class(cls): cls.cvedb.get_cvelist_if_stale() print("Database setup complete.") - @pytest.mark.skip(reason="Temporarily disabled -- may need data changes") @pytest.mark.parametrize( "filename, product_list", (((str(TEST_FILE_PATH / "pom.xml")), ["jmeter", "hamcrest"]),), @@ -235,7 +234,6 @@ def test_language_package(self, filename: str, products: set[str]) -> None: assert p in found_product assert file_path == filename - @pytest.mark.skip(reason="Temporarily disabled -- may need data changes") @pytest.mark.parametrize("filename", ((str(TEST_FILE_PATH / "PKG-INFO")),)) def test_python_package(self, filename: str) -> None: scanner = VersionScanner() diff --git a/test/test_sbom.py b/test/test_sbom.py index 35ef856b64..813516da7f 100644 --- a/test/test_sbom.py +++ b/test/test_sbom.py @@ -68,7 +68,6 @@ def test_invalid_type(self, filename: str, sbom_type: str): sbom_engine = SBOMManager(filename, sbom_type) assert sbom_engine.scan_file() == {} - @pytest.mark.skip(reason="Temporarily disabled -- may need data changes") @pytest.mark.parametrize( "filename, spdx_parsed_data", ( @@ -89,7 +88,6 @@ def test_valid_spdx_file( for p in spdx_parsed_data: assert p in scan_result - @pytest.mark.skip(reason="Temporarily disabled -- may need data changes") @pytest.mark.parametrize( "filename, cyclonedx_parsed_data", ( @@ -107,7 +105,6 @@ def test_valid_cyclonedx_file( for p in cyclonedx_parsed_data: assert p in scan_result - @pytest.mark.skip(reason="Temporarily disabled -- may need data changes") @pytest.mark.parametrize( "filename, swid_parsed_data", ((str(SBOM_PATH / "swid_test.xml"), PARSED_SBOM_DATA),),