Skip to content

Commit 4f532e7

Browse files
Rahul2044Rahul Lugun
andauthored
update-README.md (#931)
* changed 'module' to 'product' * removed typo Co-authored-by: Rahul Lugun <rlugun65@gmail,com>
1 parent 88d68f8 commit 4f532e7

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

test/README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,16 @@ deactivate
6666
## Adding new tests: CVE mapping tests
6767
* 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)
6868
* 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:
7070
```python
7171
mapping_test_data = [
72-
{"module": "gnutls", "version": "2.1.6", "version_strings": ["gnutls-cli 2.1.6"]},
7372
{
74-
"module": "gnutls",
73+
"product": "gnutls",
74+
"version": "2.1.6",
75+
"version_strings": ["gnutls-cli 2.1.6"]
76+
},
77+
{
78+
"product": "gnutls",
7579
"version": "2.3.11",
7680
"version_strings": ["gnutls-serv 2.3.11"],
7781
},
@@ -85,9 +89,9 @@ mapping_test_data = [
8589

8690
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.
8791

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.
8993

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!
9195

9296
* 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:
9397

@@ -96,13 +100,13 @@ package_test_data = [
96100
{
97101
"url": "http://security.ubuntu.com/ubuntu/pool/main/b/binutils/",
98102
"package_name": "binutils_2.26.1-1ubuntu1~16.04.8_amd64.deb",
99-
"module": "binutils",
103+
"product": "binutils",
100104
"version": "2.26.1",
101105
},
102106
{
103107
"url": "http://mirror.centos.org/centos/7/os/x86_64/Packages/",
104108
"package_name": "binutils-2.27-43.base.el7.x86_64.rpm",
105-
"module": "binutils",
109+
"product": "binutils",
106110
"version": "2.27",
107111
},
108112
]

0 commit comments

Comments
 (0)