-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (C) 2020-2024 Cisco Systems, Inc. and/or its affiliates. All rights reserved. | ||
|
||
""" | ||
Run clamscan tests. | ||
""" | ||
|
||
import sys | ||
|
||
sys.path.append('../unit_tests') | ||
import testcase | ||
|
||
|
||
class TC(testcase.TestCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
super(TC, cls).setUpClass() | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
super(TC, cls).tearDownClass() | ||
|
||
def setUp(self): | ||
super(TC, self).setUp() | ||
|
||
def tearDown(self): | ||
super(TC, self).tearDown() | ||
self.verify_valgrind_log() | ||
|
||
def test_pdf_hook(self): | ||
self.step_name('Test alz files compressed with deflate (gzip)') | ||
|
||
testfile = TC.path_source / 'unit_tests' / 'input' / 'other_scanfiles' / 'deflate.alz' | ||
command = '{valgrind} {valgrind_args} {clamscan} -d {path_db} {testfile}'.format( | ||
valgrind=TC.valgrind, valgrind_args=TC.valgrind_args, clamscan=TC.clamscan, | ||
path_db=TC.path_source / 'unit_tests' / 'input' / 'other_sigs' / 'alz.hdb', | ||
testfile=testfile, | ||
) | ||
output = self.execute_command(command) | ||
|
||
assert output.ec == 1 # virus | ||
|
||
expected_results = [ | ||
'test.txt.UNOFFICIAL FOUND', | ||
] | ||
self.verify_output(output.out, expected=expected_results) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
9645df16bc733a92129563ad2e5f1f6a9ed483c9:16:test.txt | ||
12f41f69d25d0ba9b73da429e0d69b27c95522db:16:test.txt | ||
03d4c70e6aa3832fa51959137b6a3fc55d8b9f55:16:test.txt | ||
26c0e077ad49260d416dbf449569efbc7ce02448:16:test.txt | ||
67b33eebc1e4537d839bc6b04affd6b06074c746:13:test.txt |