Skip to content

Commit

Permalink
Add test using real files for zlib
Browse files Browse the repository at this point in the history
  • Loading branch information
SaurabhK122 committed Mar 29, 2020
1 parent c102876 commit 5edfc0e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/binaries/test-zlib-1.2.2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdio.h>

int main() {
printf("This program is designed to test the cve-bin-tool checker.");
printf("It outputs a few strings normally associated with zlib 1.2.2");
printf("They appear below this line.");
printf("------------------");
printf("deflate 1.2.2 ");
printf("too many length or distance symbols");

return 0;
}
26 changes: 26 additions & 0 deletions test/test_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,20 @@ def _file_test(self, url, filename, package, version):
"CVE-2018-7208",
],
),
(
"test-zlib-1.2.2.out",
"zlib",
"1.2.2",
[
# Check for known cves in this version
"CVE-2005-2096",
"CVE-2005-1849",
],
[
# Check to make sure an older CVE isn't included
"CVE-2016-9843"
],
),
],
)
def test_binaries(self, binary, package, version, are_in, not_in):
Expand Down Expand Up @@ -1087,6 +1101,18 @@ def test_binaries(self, binary, package, version, are_in, not_in):
"binutils",
"2.27",
),
(
"http://mirror.centos.org/centos/7/os/x86_64/Packages/",
"zlib-1.2.7-18.el7.x86_64.rpm",
"zlib",
"1.2.7",
),
(
"http://archive.ubuntu.com/ubuntu/pool/universe/z/zlib/",
"zlib-bin_1.2.8.dfsg-1ubuntu1.1_amd64.deb",
"zlib",
"1.2.8",
),
],
list(
map(
Expand Down

0 comments on commit 5edfc0e

Please sign in to comment.