intel / cve-bin-tool

The CVE Binary Tool helps you determine if your system includes known vulnerabilities. You can scan binaries for over 200 common, vulnerable components (openssl, libpng, libxml2, expat and others), or if you know the components used, you can get a list of known vulnerabilities associated with an SBOM or a list of components and versions.
https://cve-bin-tool.readthedocs.io/en/latest/
GNU General Public License v3.0
1.24k stars 464 forks source link

refactor: cvedb schema checks #4568

Open anchita20 opened 1 week ago

anchita20 commented 1 week ago

Description:

This PR modifies the cvedb.py file to make use of the fact that all the schemas are stored in self.TABLE_SCHEMAS[table_name] as earlier it required both the table name and a schema as arguments

Changes Made: Added few lines to latest_schema and init_database functions in the cvedb.py

Fixes #4242

anchita20 commented 1 week ago

Hey, I was curious as to why most of the tests were failing, when I had changed a single file only, when I run pytest?

terriko commented 2 days ago

Hey, I was curious as to why most of the tests were failing, when I had changed a single file only, when I run pytest?

It's because of what you changed: most of the tests rely on cvedb data to load correctly; if you put an error in that code then it makes everything that relies on it break too.