Skip to content

Commit

Permalink
Test: Add test to verify ISO properly extracted w/ empty Joliet tree
Browse files Browse the repository at this point in the history
Test files created with pycdlib and contain the ClamAV logo.png file.
  • Loading branch information
micahsnyder committed Aug 3, 2023
1 parent aa0b76e commit 980f893
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions unit_tests/clamscan/assorted_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,29 @@ def test_pe_cert_trust_archive(self):
unexpected_results = ['OK']

self.verify_output(output.out, expected=expected_results, unexpected=unexpected_results)

def test_iso_missing_joliet(self):
self.step_name('Test that we correctly extract files from an ISO even if the joliet file path is empty.')

test_path = TC.path_source / 'unit_tests' / 'input' / 'other_scanfiles'
sig_path = TC.path_source / 'unit_tests' / 'input' / 'other_sigs' / 'logo.hsb'

command = '{valgrind} {valgrind_args} {clamscan} \
-d {sig_path} \
--allmatch {testfile1} {testfile2}'.format(
valgrind=TC.valgrind, valgrind_args=TC.valgrind_args, clamscan=TC.clamscan,
sig_path=sig_path,
testfile1=test_path / 'iso_normal.logo.iso',
testfile2=test_path / 'iso_no_joliet.logo.iso',
)
output = self.execute_command(command)

assert output.ec == 1

expected_results = [
'iso_normal.logo.iso: logo.png.UNOFFICIAL FOUND',
'iso_no_joliet.logo.iso: logo.png.UNOFFICIAL FOUND',
]
unexpected_results = ['OK']

self.verify_output(output.out, expected=expected_results, unexpected=unexpected_results)
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions unit_tests/input/other_sigs/logo.hsb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f083e9c704165003f8c065964e4ccb47da48bbad8a80521d571cbf0f1d4762c6:25476:logo.png

0 comments on commit 980f893

Please sign in to comment.