diff --git a/unit_tests/clamscan/ole2_encryption_test.py b/unit_tests/clamscan/ole2_encryption_test.py index 23146a4d74..2e731f20ea 100644 --- a/unit_tests/clamscan/ole2_encryption_test.py +++ b/unit_tests/clamscan/ole2_encryption_test.py @@ -7,6 +7,7 @@ import sys import os import re +import shutil sys.path.append('../unit_tests') import testcase @@ -82,10 +83,8 @@ def test_FAT_doc_metadata(self): assert output.ec == 0 # clean - expected_strings = [ - '"Encrypted":1', - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"ENCRYPTION_TYPE_UNKNOWN"' ] + self.verify_metadata_json(tempdir, expected_strings) def test_ministream_doc(self): self.step_name('Test ministream doc') @@ -123,10 +122,8 @@ def test_ministream_doc_metadata(self): assert output.ec == 0 # clean - neededStrings = [ '"Encrypted":1' - , '"EncryptedWithVelvetSweatshop":0' - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"ENCRYPTION_TYPE_UNKNOWN"' ] + self.verify_metadata_json(tempdir, expected_strings) def test_FAT_docx(self): @@ -165,10 +162,8 @@ def test_FAT_docx_metadata(self): assert output.ec == 0 # clean - neededStrings = [ '"Encrypted":1' - , '"EncryptedWithVelvetSweatshop":0' - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"ENCRYPTION_TYPE_UNKNOWN"' ] + self.verify_metadata_json(tempdir, expected_strings) def test_ministream_docx(self): self.step_name('Test ministream docx') @@ -206,10 +201,8 @@ def test_ministream_docx_metadata(self): assert output.ec == 0 # clean - neededStrings = [ '"Encrypted":1' - , '"EncryptedWithVelvetSweatshop":0' - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"ENCRYPTION_TYPE_UNKNOWN"' ] + self.verify_metadata_json(tempdir, expected_strings) def test_FAT_dot(self): self.step_name('Test FAT dot') @@ -247,10 +240,8 @@ def test_FAT_dot_metadata(self): assert output.ec == 0 # clean - neededStrings = [ '"Encrypted":1' - , '"EncryptedWithVelvetSweatshop":0' - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"ENCRYPTION_TYPE_UNKNOWN"' ] + self.verify_metadata_json(tempdir, expected_strings) def test_ministream_dot(self): self.step_name('Test ministream dot') @@ -288,10 +279,8 @@ def test_ministream_dot_metadata(self): assert output.ec == 0 # clean - neededStrings = [ '"Encrypted":1' - , '"EncryptedWithVelvetSweatshop":0' - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"ENCRYPTION_TYPE_UNKNOWN"' ] + self.verify_metadata_json(tempdir, expected_strings) def test_FAT_ppsx(self): self.step_name('Test FAT ppsx') @@ -329,10 +318,8 @@ def test_FAT_ppsx_metadata(self): assert output.ec == 0 # clean - neededStrings = [ '"Encrypted":1' - , '"EncryptedWithVelvetSweatshop":0' - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"ENCRYPTION_TYPE_UNKNOWN"' ] + self.verify_metadata_json(tempdir, expected_strings) def test_ministream_ppsx(self): self.step_name('Test ministream ppsx') @@ -370,10 +357,8 @@ def test_ministream_ppsx_metadata(self): assert output.ec == 0 # clean - neededStrings = [ '"Encrypted":1' - , '"EncryptedWithVelvetSweatshop":0' - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"ENCRYPTION_TYPE_UNKNOWN"' ] + self.verify_metadata_json(tempdir, expected_strings) def test_FAT_pptx(self): self.step_name('Test FAT pptx') @@ -411,10 +396,8 @@ def test_FAT_pptx_metadata(self): assert output.ec == 0 # clean - neededStrings = [ '"Encrypted":1' - , '"EncryptedWithVelvetSweatshop":0' - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"ENCRYPTION_TYPE_UNKNOWN"' ] + self.verify_metadata_json(tempdir, expected_strings) def test_ministream_pptx(self): self.step_name('Test ministream pptx') @@ -452,10 +435,8 @@ def test_ministream_pptx_metadata(self): assert output.ec == 0 # clean - neededStrings = [ '"Encrypted":1' - , '"EncryptedWithVelvetSweatshop":0' - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"ENCRYPTION_TYPE_UNKNOWN"' ] + self.verify_metadata_json(tempdir, expected_strings) def test_FAT_xls(self): self.step_name('Test FAT xls') @@ -493,11 +474,8 @@ def test_FAT_xls_metadata(self): assert output.ec == 0 # clean - neededStrings = [ '"Encrypted":1' - , '"EncryptedWithVelvetSweatshop":0' - , '"RC4Encryption":1' - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"RC4"' ] + self.verify_metadata_json(tempdir, expected_strings) def test_ministream_xls(self): self.step_name('Test ministream xls') @@ -535,11 +513,8 @@ def test_ministream_xls_metadata(self): assert output.ec == 0 # clean - neededStrings = [ '"Encrypted":1' - , '"EncryptedWithVelvetSweatshop":0' - , '"RC4Encryption":1' - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"RC4"' ] + self.verify_metadata_json(tempdir, expected_strings) def test_FAT_xlsx(self): self.step_name('Test FAT xlsx') @@ -577,10 +552,8 @@ def test_FAT_xlsx_metadata(self): assert output.ec == 0 # clean - neededStrings = [ '"Encrypted":1' - , '"EncryptedWithVelvetSweatshop":0' - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"ENCRYPTION_TYPE_UNKNOWN"' ] + self.verify_metadata_json(tempdir, expected_strings) def test_ministream_xlsx(self): self.step_name('Test ministream xlsx') @@ -618,10 +591,8 @@ def test_ministream_xlsx_metadata(self): assert output.ec == 0 # clean - neededStrings = [ '"Encrypted":1' - , '"EncryptedWithVelvetSweatshop":0' - ] - self.assertStrings(tempdir, neededStrings) + expected_strings = [ '"Encrypted":"ENCRYPTION_TYPE_UNKNOWN"' ] + self.verify_metadata_json(tempdir, expected_strings)