You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/README.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,12 +66,16 @@ deactivate
66
66
## Adding new tests: CVE mapping tests
67
67
* You can see the code for scanner tests in ['test/test_scanner.py'](https://github.com/intel/cve-bin-tool/blob/master/test/test_scanner.py)
68
68
* You can see checker wise test data in ['test/test_data'](https://github.com/intel/cve-bin-tool/blob/master/test/test_data)
69
-
* If you just want to add a new mapping test for a checker, add a dictionary of *module*, *version* and *version_strings* in the mapping_test_data list . Here, *version_strings* are the list of strings that contain version signature or strings that commonly can be found in the module. For example: this is how the current mapping_test_data for gnutls look like. You should add the details of the new test case data at the end of `mapping_test_data` list:
69
+
* If you just want to add a new mapping test for a checker, add a dictionary of *product*, *version* and *version_strings* in the mapping_test_data list . Here, *version_strings* are the list of strings that contain version signature or strings that commonly can be found in the module. For example: this is how the current mapping_test_data for gnutls look like. You should add the details of the new test case data at the end of `mapping_test_data` list:
To make the basic test suite run quickly, we create "faked" binary files to test the **CVE mappings**. However, we want to be able to test real files to test that the **signatures** work on real-world data.
87
91
88
-
You can see test data for package tests in package_test_data varible of the test data file you are writing test for.
92
+
You can see test data for package tests in *package_test_data* varible of the test data file you are writing test for.
89
93
90
-
We have `test_version_in_package` function in `test_scanner` that takes a url, and package name, module name and a version, and downloads the package, runs the scanner against it, and makes sure it is the package that you've specified. But we need more tests!
94
+
We have `test_version_in_package` function in `test_scanner` that takes a *url*, and *package name*, *module name* and a *version*, and downloads the package, runs the scanner against it, and makes sure it is the package that you've specified. But we need more tests!
91
95
92
96
* To add a new test, find an appropriate publicly available file (linux distribution packages and public releases of the packages itself are ideal). You should add the details of the new test case in the `package_test_data` variable of the file for which you are writing test for. For example: this is how the current package_test_data for binutils look like. You should add the details of the new test case data at the end of `package_test_data` list:
0 commit comments