Test project /usr/local/src/clamav-0.104.2/build Start 8: freshclam_valgrind 1/1 Test #8: freshclam_valgrind ...............***Failed 12.87 sec ============================= test session starts ============================== platform linux -- Python 3.7.10, pytest-7.1.2, pluggy-1.0.0 -- /bin/python3.7 cachedir: .pytest_cache rootdir: /usr/local/src/clamav-0.104.2/unit_tests collecting ... collected 10 items freshclam_test.py::TC::test_freshclam_00_version PASSED [ 10%] freshclam_test.py::TC::test_freshclam_01_file_copy PASSED [ 20%] freshclam_test.py::TC::test_freshclam_02_http_403 PASSED [ 30%] freshclam_test.py::TC::test_freshclam_03_http_403_daemonized PASSED [ 40%] freshclam_test.py::TC::test_freshclam_04_http_429 PASSED [ 50%] freshclam_test.py::TC::test_freshclam_05_cdiff_update FAILED [ 60%] freshclam_test.py::TC::test_freshclam_05_cdiff_update_UNC SKIPPED (T...) [ 70%] freshclam_test.py::TC::test_freshclam_06_cdiff_partial_minus_1 FAILED [ 80%] freshclam_test.py::TC::test_freshclam_07_cdiff_partial_minus_2 FAILED [ 90%] freshclam_test.py::TC::test_freshclam_07_no_cdiff_out_of_date_cvd FAILED [100%] =================================== FAILURES =================================== ______________________ TC.test_freshclam_05_cdiff_update _______________________ self = def test_freshclam_05_cdiff_update(self): self.step_name('Verify that freshclam can update from an older CVD to a newer with CDIFF patches') # start with this CVD shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-1.cvd'), str(TC.path_db / 'test.cvd')) # advertise this CVD (by sending the header response to Range requests) shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-6.cvd'), str(TC.path_www / 'test.cvd.advertised')) # using these CDIFFs shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-2.cdiff'), str(TC.path_www)) shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-3.cdiff'), str(TC.path_www)) shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-4.cdiff'), str(TC.path_www)) shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-5.cdiff'), str(TC.path_www)) shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-6.cdiff'), str(TC.path_www)) handler = partial(WebServerHandler_WWW, TC.path_www) TC.mock_mirror = Process(target=mock_database_mirror, args=(handler, TC.mock_mirror_port)) TC.mock_mirror.start() if TC.freshclam_config.exists(): os.remove(str(TC.freshclam_config)) TC.freshclam_config.write_text(''' DatabaseMirror http://localhost:{port} DNSDatabaseInfo no PidFile {freshclam_pid} LogVerbose yes LogFileMaxSize 0 LogTime yes DatabaseDirectory {path_db} DatabaseOwner {user} '''.format( freshclam_pid=TC.freshclam_pid, path_db=TC.path_db, port=TC.mock_mirror_port, user=getpass.getuser(), )) command = '{valgrind} {valgrind_args} {freshclam} --config-file={freshclam_config} --update-db=test'.format( valgrind=TC.valgrind, valgrind_args=TC.valgrind_args, freshclam=TC.freshclam, freshclam_config=TC.freshclam_config ) output = self.execute_command(command) > assert output.ec == 0 # success E assert 8 == 0 E + where 8 = CmdResult(ec=8, out='Wed Jun 29 16:51:56 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/\nWed Jun 29 16:51:56 2022 -> *Can\'t open freshclam.dat in /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database\nWed Jun 29 16:51:56 2022 -> *It probably doesn\'t exist yet. That\'s ok.\nWed Jun 29 16:51:56 2022 -> *Failed to load freshclam.dat; will create a new freshclam.dat\nWed Jun 29 16:51:56 2022 -> *Creating new freshclam.dat\nWed Jun 29 16:51:56 2022 -> *Saved freshclam.dat\nWed Jun 29 16:51:56 2022 -> ClamAV update process started at Wed Jun 29 16:51:56 2022\nWed Jun 29 16:51:56 2022 -> *Querying no\nWed Jun 29 16:51:56 2022 -> ^Can\'t query no\nWed Jun 29 16:51:56 2022 -> ^Invalid DNS reply. Falling back to HTTP mode.\nWed Jun 29 16:51:56 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/\nWed Jun 29 16:51:56 2022 -> *check_for_new_database_version: Local copy of test found: test.cvd.\nWed Jun 29 16:51:56 2022 -> Trying to retrieve CVD header from http://localhost:8001/test.cvd\n* Trying 127.0.0.1:8001...\n* Connected to localhost (127.0.0.1) port 8001 (#0)\n> GET ...un 29 16:51:56 2022 -> *download_complete_callback: fc_context->bTestDatabases : 1\nWed Jun 29 16:51:56 2022 -> *download_complete_callback: fc_context->bBytecodeEnabled : 1\nWed Jun 29 16:51:56 2022 -> Testing database: \'/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.e4edd08071/clamav-d6a87b95d30467af2423cd92470f22f6.tmp-test.cld\' ...\nWed Jun 29 16:51:56 2022 -> *Loading signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.e4edd08071/clamav-d6a87b95d30467af2423cd92470f22f6.tmp-test.cld\nWed Jun 29 16:51:57 2022 -> *Properly loaded 14 signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.e4edd08071/clamav-d6a87b95d30467af2423cd92470f22f6.tmp-test.cld\nWed Jun 29 16:51:57 2022 -> ^Database load exited with "Unknown libfreshclam error code!"\nWed Jun 29 16:51:57 2022 -> !Database test FAILED.\nWed Jun 29 16:51:57 2022 -> *updatedb: callback failed: Test failed (8)\nWed Jun 29 16:51:57 2022 -> !Unexpected error when attempting to update test: Test failed\nWed Jun 29 16:51:57 2022 -> !Database update process failed: Test failed\nWed Jun 29 16:51:57 2022 -> !Update failed.\n', err='').ec /usr/local/src/clamav-0.104.2/unit_tests/freshclam_test.py:318: AssertionError ----------------------------- Captured stdout call ----------------------------- [INFO]: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [INFO]: Verify that freshclam can update from an older CVD to a newer with CDIFF patches [INFO]: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [DEBUG]: Run command: /bin/valgrind -v --trace-children=yes --track-fds=yes --leak-check=full --suppressions=/usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp --log-file=/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/valgrind.log --error-exitcode=123 /usr/local/src/clamav-0.104.2/build/freshclam/freshclam --config-file=/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/freshclam-test.conf --update-db=test Web server is running on port 8001 Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test.cvd Mock Server: But they only want bytes 0 through 511 ... Mock Server: Sending 512 bytes back to client. Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-2.cdiff Mock Server: Sending 765 bytes back to client. Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-3.cdiff Mock Server: Sending 1637 bytes back to client. Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-4.cdiff Mock Server: Sending 945 bytes back to client. Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-5.cdiff Mock Server: Sending 993 bytes back to client. Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-6.cdiff Mock Server: Sending 973 bytes back to client. [DEBUG]: Exit code: 8 [DEBUG]: stdout: Wed Jun 29 16:51:56 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/ Wed Jun 29 16:51:56 2022 -> *Can't open freshclam.dat in /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database Wed Jun 29 16:51:56 2022 -> *It probably doesn't exist yet. That's ok. Wed Jun 29 16:51:56 2022 -> *Failed to load freshclam.dat; will create a new freshclam.dat Wed Jun 29 16:51:56 2022 -> *Creating new freshclam.dat Wed Jun 29 16:51:56 2022 -> *Saved freshclam.dat Wed Jun 29 16:51:56 2022 -> ClamAV update process started at Wed Jun 29 16:51:56 2022 Wed Jun 29 16:51:56 2022 -> *Querying no Wed Jun 29 16:51:56 2022 -> ^Can't query no Wed Jun 29 16:51:56 2022 -> ^Invalid DNS reply. Falling back to HTTP mode. Wed Jun 29 16:51:56 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/ Wed Jun 29 16:51:56 2022 -> *check_for_new_database_version: Local copy of test found: test.cvd. Wed Jun 29 16:51:56 2022 -> Trying to retrieve CVD header from http://localhost:8001/test.cvd * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test.cvd HTTP/1.1 Host: localhost:8001 Range: bytes=0-511 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: f393146c-01d8-4619-a8d8-70c8c2405594) Accept: */* If-Modified-Since: Tue, 22 Jun 2021 18:58:22 GMT Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 206 Partial Content < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:56 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:51:56 2022 -> OK Wed Jun 29 16:51:56 2022 -> *test database version obtained using HTTP GET: 6 Wed Jun 29 16:51:56 2022 -> test database available for update (local version: 1, remote version: 6) Wed Jun 29 16:51:56 2022 -> *Retrieving http://localhost:8001/test-2.cdiff Wed Jun 29 16:51:56 2022 -> *downloadFile: Download source: http://localhost:8001/test-2.cdiff Wed Jun 29 16:51:56 2022 -> *downloadFile: Download destination: ./clamav-9b1465dd8943654b9f6e5d7b20e425ed.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-2.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: f393146c-01d8-4619-a8d8-70c8c2405594) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:56 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:51:56 2022 -> *cdiff_apply: Parsed 4 lines and executed 4 commands Wed Jun 29 16:51:56 2022 -> *Retrieving http://localhost:8001/test-3.cdiff Wed Jun 29 16:51:56 2022 -> *downloadFile: Download source: http://localhost:8001/test-3.cdiff Wed Jun 29 16:51:56 2022 -> *downloadFile: Download destination: ./clamav-053a7bb750b159911e82be04e51c3be4.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-3.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: f393146c-01d8-4619-a8d8-70c8c2405594) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:56 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:51:56 2022 -> *cdiff_apply: Parsed 71 lines and executed 71 commands Wed Jun 29 16:51:56 2022 -> *Retrieving http://localhost:8001/test-4.cdiff Wed Jun 29 16:51:56 2022 -> *downloadFile: Download source: http://localhost:8001/test-4.cdiff Wed Jun 29 16:51:56 2022 -> *downloadFile: Download destination: ./clamav-3e785f316ccf67c8eb25840ec94f9b30.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-4.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: f393146c-01d8-4619-a8d8-70c8c2405594) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:56 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:51:56 2022 -> *cdiff_apply: Parsed 8 lines and executed 8 commands Wed Jun 29 16:51:56 2022 -> *Retrieving http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:56 2022 -> *downloadFile: Download source: http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:56 2022 -> *downloadFile: Download destination: ./clamav-43242af537bd806fd9117362226d3478.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-5.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: f393146c-01d8-4619-a8d8-70c8c2405594) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:56 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:51:56 2022 -> *cdiff_apply: Parsed 8 lines and executed 8 commands Wed Jun 29 16:51:56 2022 -> *Retrieving http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:56 2022 -> *downloadFile: Download source: http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:56 2022 -> *downloadFile: Download destination: ./clamav-48839aabab2f8bcbc531afc0dfad08b1.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-6.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: f393146c-01d8-4619-a8d8-70c8c2405594) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:56 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:51:56 2022 -> *cdiff_apply: Parsed 8 lines and executed 8 commands Wed Jun 29 16:51:56 2022 -> *updatedb: Running g_cb_download_complete callback... Wed Jun 29 16:51:56 2022 -> *download_complete_callback: Download complete for database : /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.e4edd08071/clamav-d6a87b95d30467af2423cd92470f22f6.tmp-test.cld Wed Jun 29 16:51:56 2022 -> *download_complete_callback: fc_context->bTestDatabases : 1 Wed Jun 29 16:51:56 2022 -> *download_complete_callback: fc_context->bBytecodeEnabled : 1 Wed Jun 29 16:51:56 2022 -> Testing database: '/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.e4edd08071/clamav-d6a87b95d30467af2423cd92470f22f6.tmp-test.cld' ... Wed Jun 29 16:51:56 2022 -> *Loading signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.e4edd08071/clamav-d6a87b95d30467af2423cd92470f22f6.tmp-test.cld Wed Jun 29 16:51:57 2022 -> *Properly loaded 14 signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.e4edd08071/clamav-d6a87b95d30467af2423cd92470f22f6.tmp-test.cld Wed Jun 29 16:51:57 2022 -> ^Database load exited with "Unknown libfreshclam error code!" Wed Jun 29 16:51:57 2022 -> !Database test FAILED. Wed Jun 29 16:51:57 2022 -> *updatedb: callback failed: Test failed (8) Wed Jun 29 16:51:57 2022 -> !Unexpected error when attempting to update test: Test failed Wed Jun 29 16:51:57 2022 -> !Database update process failed: Test failed Wed Jun 29 16:51:57 2022 -> !Update failed. [DEBUG]: stderr: [INFO]: Verifying /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/valgrind.log... [WARNING]: More than one match for item `ERROR SUMMARY: 0 errors`. [INFO]: ==11452== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) [INFO]: --11452-- [INFO]: --11452-- used_suppression: 11 dl_catch_error-leak-1 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:35 suppressed: 82,268 bytes in 15 blocks [INFO]: --11452-- used_suppression: 282 openssl-globals-01 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:77 suppressed: 91,280 bytes in 3,024 blocks [INFO]: --11452-- used_suppression: 64 openssl-globals-02 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:84 suppressed: 1,536 bytes in 64 blocks [INFO]: ==11452== [INFO]: ==11452== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) [INFO]: --11451-- Discarding syms at 0x6324660-0x63297bc in /usr/lib64/libnss_sss.so.2 (have_dinfo 1) [INFO]: --11451-- Discarding syms at 0x63465c0-0x634f7fc in /usr/lib64/libnss_files-2.26.so (have_dinfo 1) [INFO]: ==11451== [INFO]: ==11451== FILE DESCRIPTORS: 4 open (3 std) at exit. [INFO]: ==11451== Open file descriptor 3: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/valgrind.log [INFO]: ==11451== [INFO]: ==11451== [INFO]: ==11451== [INFO]: ==11451== HEAP SUMMARY: [INFO]: ==11451== in use at exit: 84,122 bytes in 54 blocks [INFO]: ==11451== total heap usage: 6,565 allocs, 6,511 frees, 1,372,260 bytes allocated [INFO]: ==11451== [INFO]: ==11451== Searching for pointers to 54 not-freed blocks [INFO]: ==11451== Checked 941,688 bytes [INFO]: ==11451== [INFO]: ==11451== LEAK SUMMARY: [INFO]: ==11451== definitely lost: 0 bytes in 0 blocks [INFO]: ==11451== indirectly lost: 0 bytes in 0 blocks [INFO]: ==11451== possibly lost: 0 bytes in 0 blocks [INFO]: ==11451== still reachable: 1,854 bytes in 39 blocks [INFO]: ==11451== suppressed: 82,268 bytes in 15 blocks [INFO]: ==11451== Reachable blocks (those to which a pointer was found) are not shown. [INFO]: ==11451== To see them, rerun with: --leak-check=full --show-leak-kinds=all [INFO]: ==11451== [INFO]: ==11451== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) [INFO]: --11451-- [INFO]: --11451-- used_suppression: 11 dl_catch_error-leak-1 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:35 suppressed: 82,268 bytes in 15 blocks [INFO]: ==11451== [INFO]: ==11451== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ----------------------------- Captured stderr call ----------------------------- 127.0.0.1 - - [29/Jun/2022 16:51:56] "GET /test.cvd HTTP/1.1" 206 - 127.0.0.1 - - [29/Jun/2022 16:51:56] "GET /test-2.cdiff HTTP/1.1" 200 - 127.0.0.1 - - [29/Jun/2022 16:51:56] "GET /test-3.cdiff HTTP/1.1" 200 - 127.0.0.1 - - [29/Jun/2022 16:51:56] "GET /test-4.cdiff HTTP/1.1" 200 - 127.0.0.1 - - [29/Jun/2022 16:51:56] "GET /test-5.cdiff HTTP/1.1" 200 - 127.0.0.1 - - [29/Jun/2022 16:51:56] "GET /test-6.cdiff HTTP/1.1" 200 - __________________ TC.test_freshclam_06_cdiff_partial_minus_1 __________________ self = def test_freshclam_06_cdiff_partial_minus_1(self): self.step_name('Verify that freshclam will accept a partial update with 1 missing cdiff') # start with this CVD shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-3.cvd'), str(TC.path_db / 'test.cvd')) # advertise this CVD (by sending the header response to Range requests) shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-6.cvd'), str(TC.path_www / 'test.cvd.advertised')) # using these CDIFFs shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-4.cdiff'), str(TC.path_www)) shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-5.cdiff'), str(TC.path_www)) #shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-6.cdiff'), str(TC.path_www)) # <-- don't give them the last CDIFF handler = partial(WebServerHandler_WWW, TC.path_www) TC.mock_mirror = Process(target=mock_database_mirror, args=(handler, TC.mock_mirror_port)) TC.mock_mirror.start() if TC.freshclam_config.exists(): os.remove(str(TC.freshclam_config)) TC.freshclam_config.write_text(''' DatabaseMirror http://localhost:{port} DNSDatabaseInfo no PidFile {freshclam_pid} LogVerbose yes LogFileMaxSize 0 LogTime yes DatabaseDirectory {path_db} DatabaseOwner {user} '''.format( freshclam_pid=TC.freshclam_pid, path_db=TC.path_db, port=TC.mock_mirror_port, user=getpass.getuser(), )) command = '{valgrind} {valgrind_args} {freshclam} --config-file={freshclam_config} --update-db=test'.format( valgrind=TC.valgrind, valgrind_args=TC.valgrind_args, freshclam=TC.freshclam, freshclam_config=TC.freshclam_config ) output = self.execute_command(command) > assert output.ec == 0 # success E assert 8 == 0 E + where 8 = CmdResult(ec=8, out='Wed Jun 29 16:51:58 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/\nWed Jun 29 16:51:58 2022 -> *Can\'t open freshclam.dat in /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database\nWed Jun 29 16:51:58 2022 -> *It probably doesn\'t exist yet. That\'s ok.\nWed Jun 29 16:51:58 2022 -> *Failed to load freshclam.dat; will create a new freshclam.dat\nWed Jun 29 16:51:58 2022 -> *Creating new freshclam.dat\nWed Jun 29 16:51:58 2022 -> *Saved freshclam.dat\nWed Jun 29 16:51:58 2022 -> ClamAV update process started at Wed Jun 29 16:51:58 2022\nWed Jun 29 16:51:58 2022 -> *Querying no\nWed Jun 29 16:51:58 2022 -> ^Can\'t query no\nWed Jun 29 16:51:58 2022 -> ^Invalid DNS reply. Falling back to HTTP mode.\nWed Jun 29 16:51:58 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/\nWed Jun 29 16:51:58 2022 -> *check_for_new_database_version: Local copy of test found: test.cvd.\nWed Jun 29 16:51:58 2022 -> Trying to retrieve CVD header from http://localhost:8001/test.cvd\n* Trying 127.0.0.1:8001...\n* Connected to localhost (127.0.0.1) port 8001 (#0)\n> GET ...un 29 16:51:58 2022 -> *download_complete_callback: fc_context->bTestDatabases : 1\nWed Jun 29 16:51:58 2022 -> *download_complete_callback: fc_context->bBytecodeEnabled : 1\nWed Jun 29 16:51:58 2022 -> Testing database: \'/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.803a717fc8/clamav-f683d62be0e43701b99e41bff4310caf.tmp-test.cld\' ...\nWed Jun 29 16:51:58 2022 -> *Loading signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.803a717fc8/clamav-f683d62be0e43701b99e41bff4310caf.tmp-test.cld\nWed Jun 29 16:51:58 2022 -> *Properly loaded 13 signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.803a717fc8/clamav-f683d62be0e43701b99e41bff4310caf.tmp-test.cld\nWed Jun 29 16:51:58 2022 -> ^Database load exited with "Unknown libfreshclam error code!"\nWed Jun 29 16:51:58 2022 -> !Database test FAILED.\nWed Jun 29 16:51:58 2022 -> *updatedb: callback failed: Test failed (8)\nWed Jun 29 16:51:58 2022 -> !Unexpected error when attempting to update test: Test failed\nWed Jun 29 16:51:58 2022 -> !Database update process failed: Test failed\nWed Jun 29 16:51:58 2022 -> !Update failed.\n', err='').ec /usr/local/src/clamav-0.104.2/unit_tests/freshclam_test.py:426: AssertionError ----------------------------- Captured stdout call ----------------------------- [INFO]: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [INFO]: Verify that freshclam will accept a partial update with 1 missing cdiff [INFO]: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [DEBUG]: Run command: /bin/valgrind -v --trace-children=yes --track-fds=yes --leak-check=full --suppressions=/usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp --log-file=/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/valgrind.log --error-exitcode=123 /usr/local/src/clamav-0.104.2/build/freshclam/freshclam --config-file=/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/freshclam-test.conf --update-db=test Web server is running on port 8001 Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test.cvd Mock Server: But they only want bytes 0 through 511 ... Mock Server: Sending 512 bytes back to client. Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-4.cdiff Mock Server: Sending 945 bytes back to client. Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-5.cdiff Mock Server: Sending 993 bytes back to client. Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-6.cdiff Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-6.cdiff Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-6.cdiff [DEBUG]: Exit code: 8 [DEBUG]: stdout: Wed Jun 29 16:51:58 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/ Wed Jun 29 16:51:58 2022 -> *Can't open freshclam.dat in /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database Wed Jun 29 16:51:58 2022 -> *It probably doesn't exist yet. That's ok. Wed Jun 29 16:51:58 2022 -> *Failed to load freshclam.dat; will create a new freshclam.dat Wed Jun 29 16:51:58 2022 -> *Creating new freshclam.dat Wed Jun 29 16:51:58 2022 -> *Saved freshclam.dat Wed Jun 29 16:51:58 2022 -> ClamAV update process started at Wed Jun 29 16:51:58 2022 Wed Jun 29 16:51:58 2022 -> *Querying no Wed Jun 29 16:51:58 2022 -> ^Can't query no Wed Jun 29 16:51:58 2022 -> ^Invalid DNS reply. Falling back to HTTP mode. Wed Jun 29 16:51:58 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/ Wed Jun 29 16:51:58 2022 -> *check_for_new_database_version: Local copy of test found: test.cvd. Wed Jun 29 16:51:58 2022 -> Trying to retrieve CVD header from http://localhost:8001/test.cvd * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test.cvd HTTP/1.1 Host: localhost:8001 Range: bytes=0-511 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: 63b98fd5-a95c-4ba0-b19c-74a469cc16e1) Accept: */* If-Modified-Since: Wed, 23 Jun 2021 00:40:09 GMT Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 206 Partial Content < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:58 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:51:58 2022 -> OK Wed Jun 29 16:51:58 2022 -> *test database version obtained using HTTP GET: 6 Wed Jun 29 16:51:58 2022 -> test database available for update (local version: 3, remote version: 6) Wed Jun 29 16:51:58 2022 -> *Retrieving http://localhost:8001/test-4.cdiff Wed Jun 29 16:51:58 2022 -> *downloadFile: Download source: http://localhost:8001/test-4.cdiff Wed Jun 29 16:51:58 2022 -> *downloadFile: Download destination: ./clamav-641081aaa177d9da7b39d4c791c361e5.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-4.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: 63b98fd5-a95c-4ba0-b19c-74a469cc16e1) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:58 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:51:58 2022 -> *cdiff_apply: Parsed 8 lines and executed 8 commands Wed Jun 29 16:51:58 2022 -> *Retrieving http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:58 2022 -> *downloadFile: Download source: http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:58 2022 -> *downloadFile: Download destination: ./clamav-eca91f3d2d021b6941a4c251becb017d.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-5.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: 63b98fd5-a95c-4ba0-b19c-74a469cc16e1) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:58 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:51:58 2022 -> *cdiff_apply: Parsed 8 lines and executed 8 commands Wed Jun 29 16:51:58 2022 -> *Retrieving http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:58 2022 -> *downloadFile: Download source: http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:58 2022 -> *downloadFile: Download destination: ./clamav-54ec1c3a521a82ce6c4da3319841e8ea.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-6.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: 63b98fd5-a95c-4ba0-b19c-74a469cc16e1) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 404 test-6.cdiff Not Found < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:58 GMT < Connection: close < Content-Type: text/html;charset=utf-8 < Content-Length: 460 < * Closing connection 0 Wed Jun 29 16:51:58 2022 -> ^downloadFile: file not found: http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:58 2022 -> ^downloadPatch: Can't download test-6.cdiff from http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:58 2022 -> *Retrieving http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:58 2022 -> *downloadFile: Download source: http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:58 2022 -> *downloadFile: Download destination: ./clamav-306590964d63a5ffb8f24df28f8cd968.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-6.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: 63b98fd5-a95c-4ba0-b19c-74a469cc16e1) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 404 test-6.cdiff Not Found < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:58 GMT < Connection: close < Content-Type: text/html;charset=utf-8 < Content-Length: 460 < * Closing connection 0 Wed Jun 29 16:51:58 2022 -> ^downloadFile: file not found: http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:58 2022 -> ^downloadPatch: Can't download test-6.cdiff from http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:58 2022 -> *Retrieving http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:58 2022 -> *downloadFile: Download source: http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:58 2022 -> *downloadFile: Download destination: ./clamav-c1604930c76e4c964affffb84faecb2e.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-6.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: 63b98fd5-a95c-4ba0-b19c-74a469cc16e1) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 404 test-6.cdiff Not Found < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:58 GMT < Connection: close < Content-Type: text/html;charset=utf-8 < Content-Length: 460 < * Closing connection 0 Wed Jun 29 16:51:58 2022 -> ^downloadFile: file not found: http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:58 2022 -> ^downloadPatch: Can't download test-6.cdiff from http://localhost:8001/test-6.cdiff Wed Jun 29 16:51:58 2022 -> Downloaded 2 patches for test, which is fewer than the 3 expected patches. Wed Jun 29 16:51:58 2022 -> We'll settle for this partial-update, at least for now. Wed Jun 29 16:51:58 2022 -> *updatedb: Running g_cb_download_complete callback... Wed Jun 29 16:51:58 2022 -> *download_complete_callback: Download complete for database : /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.803a717fc8/clamav-f683d62be0e43701b99e41bff4310caf.tmp-test.cld Wed Jun 29 16:51:58 2022 -> *download_complete_callback: fc_context->bTestDatabases : 1 Wed Jun 29 16:51:58 2022 -> *download_complete_callback: fc_context->bBytecodeEnabled : 1 Wed Jun 29 16:51:58 2022 -> Testing database: '/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.803a717fc8/clamav-f683d62be0e43701b99e41bff4310caf.tmp-test.cld' ... Wed Jun 29 16:51:58 2022 -> *Loading signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.803a717fc8/clamav-f683d62be0e43701b99e41bff4310caf.tmp-test.cld Wed Jun 29 16:51:58 2022 -> *Properly loaded 13 signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.803a717fc8/clamav-f683d62be0e43701b99e41bff4310caf.tmp-test.cld Wed Jun 29 16:51:58 2022 -> ^Database load exited with "Unknown libfreshclam error code!" Wed Jun 29 16:51:58 2022 -> !Database test FAILED. Wed Jun 29 16:51:58 2022 -> *updatedb: callback failed: Test failed (8) Wed Jun 29 16:51:58 2022 -> !Unexpected error when attempting to update test: Test failed Wed Jun 29 16:51:58 2022 -> !Database update process failed: Test failed Wed Jun 29 16:51:58 2022 -> !Update failed. [DEBUG]: stderr: [INFO]: Verifying /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/valgrind.log... [WARNING]: More than one match for item `ERROR SUMMARY: 0 errors`. [INFO]: ==11457== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) [INFO]: --11457-- [INFO]: --11457-- used_suppression: 11 dl_catch_error-leak-1 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:35 suppressed: 82,268 bytes in 15 blocks [INFO]: --11457-- used_suppression: 282 openssl-globals-01 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:77 suppressed: 91,280 bytes in 3,024 blocks [INFO]: --11457-- used_suppression: 64 openssl-globals-02 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:84 suppressed: 1,536 bytes in 64 blocks [INFO]: ==11457== [INFO]: ==11457== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) [INFO]: --11456-- Discarding syms at 0x6324660-0x63297bc in /usr/lib64/libnss_sss.so.2 (have_dinfo 1) [INFO]: --11456-- Discarding syms at 0x63465c0-0x634f7fc in /usr/lib64/libnss_files-2.26.so (have_dinfo 1) [INFO]: ==11456== [INFO]: ==11456== FILE DESCRIPTORS: 4 open (3 std) at exit. [INFO]: ==11456== Open file descriptor 3: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/valgrind.log [INFO]: ==11456== [INFO]: ==11456== [INFO]: ==11456== [INFO]: ==11456== HEAP SUMMARY: [INFO]: ==11456== in use at exit: 84,122 bytes in 54 blocks [INFO]: ==11456== total heap usage: 6,168 allocs, 6,114 frees, 1,025,907 bytes allocated [INFO]: ==11456== [INFO]: ==11456== Searching for pointers to 54 not-freed blocks [INFO]: ==11456== Checked 941,688 bytes [INFO]: ==11456== [INFO]: ==11456== LEAK SUMMARY: [INFO]: ==11456== definitely lost: 0 bytes in 0 blocks [INFO]: ==11456== indirectly lost: 0 bytes in 0 blocks [INFO]: ==11456== possibly lost: 0 bytes in 0 blocks [INFO]: ==11456== still reachable: 1,854 bytes in 39 blocks [INFO]: ==11456== suppressed: 82,268 bytes in 15 blocks [INFO]: ==11456== Reachable blocks (those to which a pointer was found) are not shown. [INFO]: ==11456== To see them, rerun with: --leak-check=full --show-leak-kinds=all [INFO]: ==11456== [INFO]: ==11456== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) [INFO]: --11456-- [INFO]: --11456-- used_suppression: 11 dl_catch_error-leak-1 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:35 suppressed: 82,268 bytes in 15 blocks [INFO]: ==11456== [INFO]: ==11456== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ----------------------------- Captured stderr call ----------------------------- 127.0.0.1 - - [29/Jun/2022 16:51:58] "GET /test.cvd HTTP/1.1" 206 - 127.0.0.1 - - [29/Jun/2022 16:51:58] "GET /test-4.cdiff HTTP/1.1" 200 - 127.0.0.1 - - [29/Jun/2022 16:51:58] "GET /test-5.cdiff HTTP/1.1" 200 - 127.0.0.1 - - [29/Jun/2022 16:51:58] code 404, message test-6.cdiff Not Found 127.0.0.1 - - [29/Jun/2022 16:51:58] "GET /test-6.cdiff HTTP/1.1" 404 - 127.0.0.1 - - [29/Jun/2022 16:51:58] code 404, message test-6.cdiff Not Found 127.0.0.1 - - [29/Jun/2022 16:51:58] "GET /test-6.cdiff HTTP/1.1" 404 - 127.0.0.1 - - [29/Jun/2022 16:51:58] code 404, message test-6.cdiff Not Found 127.0.0.1 - - [29/Jun/2022 16:51:58] "GET /test-6.cdiff HTTP/1.1" 404 - __________________ TC.test_freshclam_07_cdiff_partial_minus_2 __________________ self = def test_freshclam_07_cdiff_partial_minus_2(self): self.step_name('Verify that freshclam behavior with 2 missing cdiffs') # start with this CVD shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-3.cvd'), str(TC.path_db / 'test.cvd')) # advertise this CVD (by sending the header response to Range requests) shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-6.cvd'), str(TC.path_www / 'test.cvd.advertised')) # serve this CVD when requested instead of the advertised one shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-6.cvd'), str(TC.path_www / 'test.cvd.served')) # using these CDIFFs shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-4.cdiff'), str(TC.path_www)) # shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-5.cdiff'), str(TC.path_www)) <--- dont' give them the second to last, either! # shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-6.cdiff'), str(TC.path_www)) <--- don't give them the last CDIFF handler = partial(WebServerHandler_WWW, TC.path_www) TC.mock_mirror = Process(target=mock_database_mirror, args=(handler, TC.mock_mirror_port)) TC.mock_mirror.start() if TC.freshclam_config.exists(): os.remove(str(TC.freshclam_config)) TC.freshclam_config.write_text(''' DatabaseMirror http://localhost:{port} DNSDatabaseInfo no PidFile {freshclam_pid} LogVerbose yes LogFileMaxSize 0 LogTime yes DatabaseDirectory {path_db} DatabaseOwner {user} '''.format( freshclam_pid=TC.freshclam_pid, path_db=TC.path_db, port=TC.mock_mirror_port, user=getpass.getuser(), )) command = '{valgrind} {valgrind_args} {freshclam} --config-file={freshclam_config} --update-db=test'.format( valgrind=TC.valgrind, valgrind_args=TC.valgrind_args, freshclam=TC.freshclam, freshclam_config=TC.freshclam_config ) output = self.execute_command(command) > assert output.ec == 0 # success E assert 8 == 0 E + where 8 = CmdResult(ec=8, out='Wed Jun 29 16:51:59 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/\nWed Jun 29 16:51:59 2022 -> *Can\'t open freshclam.dat in /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database\nWed Jun 29 16:51:59 2022 -> *It probably doesn\'t exist yet. That\'s ok.\nWed Jun 29 16:51:59 2022 -> *Failed to load freshclam.dat; will create a new freshclam.dat\nWed Jun 29 16:51:59 2022 -> *Creating new freshclam.dat\nWed Jun 29 16:51:59 2022 -> *Saved freshclam.dat\nWed Jun 29 16:51:59 2022 -> ClamAV update process started at Wed Jun 29 16:51:59 2022\nWed Jun 29 16:51:59 2022 -> *Querying no\nWed Jun 29 16:51:59 2022 -> ^Can\'t query no\nWed Jun 29 16:51:59 2022 -> ^Invalid DNS reply. Falling back to HTTP mode.\nWed Jun 29 16:51:59 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/\nWed Jun 29 16:51:59 2022 -> *check_for_new_database_version: Local copy of test found: test.cvd.\nWed Jun 29 16:51:59 2022 -> Trying to retrieve CVD header from http://localhost:8001/test.cvd\n* Trying 127.0.0.1:8001...\n* Connected to localhost (127.0.0.1) port 8001 (#0)\n> GET ...un 29 16:52:00 2022 -> *download_complete_callback: fc_context->bTestDatabases : 1\nWed Jun 29 16:52:00 2022 -> *download_complete_callback: fc_context->bBytecodeEnabled : 1\nWed Jun 29 16:52:00 2022 -> Testing database: \'/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.5c87ae3ca4/clamav-5668389939946458760f556e95934a3e.tmp-test.cld\' ...\nWed Jun 29 16:52:00 2022 -> *Loading signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.5c87ae3ca4/clamav-5668389939946458760f556e95934a3e.tmp-test.cld\nWed Jun 29 16:52:00 2022 -> *Properly loaded 12 signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.5c87ae3ca4/clamav-5668389939946458760f556e95934a3e.tmp-test.cld\nWed Jun 29 16:52:00 2022 -> ^Database load exited with "Unknown libfreshclam error code!"\nWed Jun 29 16:52:00 2022 -> !Database test FAILED.\nWed Jun 29 16:52:00 2022 -> *updatedb: callback failed: Test failed (8)\nWed Jun 29 16:52:00 2022 -> !Unexpected error when attempting to update test: Test failed\nWed Jun 29 16:52:00 2022 -> !Database update process failed: Test failed\nWed Jun 29 16:52:00 2022 -> !Update failed.\n', err='').ec /usr/local/src/clamav-0.104.2/unit_tests/freshclam_test.py:502: AssertionError ----------------------------- Captured stdout call ----------------------------- [INFO]: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [INFO]: Verify that freshclam behavior with 2 missing cdiffs [INFO]: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [DEBUG]: Run command: /bin/valgrind -v --trace-children=yes --track-fds=yes --leak-check=full --suppressions=/usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp --log-file=/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/valgrind.log --error-exitcode=123 /usr/local/src/clamav-0.104.2/build/freshclam/freshclam --config-file=/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/freshclam-test.conf --update-db=test Web server is running on port 8001 Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test.cvd Mock Server: But they only want bytes 0 through 511 ... Mock Server: Sending 512 bytes back to client. Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-4.cdiff Mock Server: Sending 945 bytes back to client. Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-5.cdiff Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-5.cdiff Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-5.cdiff [DEBUG]: Exit code: 8 [DEBUG]: stdout: Wed Jun 29 16:51:59 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/ Wed Jun 29 16:51:59 2022 -> *Can't open freshclam.dat in /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database Wed Jun 29 16:51:59 2022 -> *It probably doesn't exist yet. That's ok. Wed Jun 29 16:51:59 2022 -> *Failed to load freshclam.dat; will create a new freshclam.dat Wed Jun 29 16:51:59 2022 -> *Creating new freshclam.dat Wed Jun 29 16:51:59 2022 -> *Saved freshclam.dat Wed Jun 29 16:51:59 2022 -> ClamAV update process started at Wed Jun 29 16:51:59 2022 Wed Jun 29 16:51:59 2022 -> *Querying no Wed Jun 29 16:51:59 2022 -> ^Can't query no Wed Jun 29 16:51:59 2022 -> ^Invalid DNS reply. Falling back to HTTP mode. Wed Jun 29 16:51:59 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/ Wed Jun 29 16:51:59 2022 -> *check_for_new_database_version: Local copy of test found: test.cvd. Wed Jun 29 16:51:59 2022 -> Trying to retrieve CVD header from http://localhost:8001/test.cvd * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test.cvd HTTP/1.1 Host: localhost:8001 Range: bytes=0-511 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: 4c23a92c-6f8b-4cdd-a17c-978dece9f049) Accept: */* If-Modified-Since: Wed, 23 Jun 2021 00:40:09 GMT Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 206 Partial Content < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:59 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:51:59 2022 -> OK Wed Jun 29 16:51:59 2022 -> *test database version obtained using HTTP GET: 6 Wed Jun 29 16:51:59 2022 -> test database available for update (local version: 3, remote version: 6) Wed Jun 29 16:51:59 2022 -> *Retrieving http://localhost:8001/test-4.cdiff Wed Jun 29 16:51:59 2022 -> *downloadFile: Download source: http://localhost:8001/test-4.cdiff Wed Jun 29 16:51:59 2022 -> *downloadFile: Download destination: ./clamav-7fa7606d3df5945a40c89c661cc65e3e.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-4.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: 4c23a92c-6f8b-4cdd-a17c-978dece9f049) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:59 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:51:59 2022 -> *cdiff_apply: Parsed 8 lines and executed 8 commands Wed Jun 29 16:51:59 2022 -> *Retrieving http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:59 2022 -> *downloadFile: Download source: http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:59 2022 -> *downloadFile: Download destination: ./clamav-f91769154c700b66f47aa972467bf711.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-5.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: 4c23a92c-6f8b-4cdd-a17c-978dece9f049) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 404 test-5.cdiff Not Found < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:59 GMT < Connection: close < Content-Type: text/html;charset=utf-8 < Content-Length: 460 < * Closing connection 0 Wed Jun 29 16:51:59 2022 -> ^downloadFile: file not found: http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:59 2022 -> ^downloadPatch: Can't download test-5.cdiff from http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:59 2022 -> *Retrieving http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:59 2022 -> *downloadFile: Download source: http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:59 2022 -> *downloadFile: Download destination: ./clamav-bcc75e5479240411d9fa018b9cca1514.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-5.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: 4c23a92c-6f8b-4cdd-a17c-978dece9f049) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 404 test-5.cdiff Not Found < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:59 GMT < Connection: close < Content-Type: text/html;charset=utf-8 < Content-Length: 460 < * Closing connection 0 Wed Jun 29 16:51:59 2022 -> ^downloadFile: file not found: http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:59 2022 -> ^downloadPatch: Can't download test-5.cdiff from http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:59 2022 -> *Retrieving http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:59 2022 -> *downloadFile: Download source: http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:59 2022 -> *downloadFile: Download destination: ./clamav-c09b7eadebc2294c17bca9210faf4e0c.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-5.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: 4c23a92c-6f8b-4cdd-a17c-978dece9f049) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 404 test-5.cdiff Not Found < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:51:59 GMT < Connection: close < Content-Type: text/html;charset=utf-8 < Content-Length: 460 < * Closing connection 0 Wed Jun 29 16:51:59 2022 -> ^downloadFile: file not found: http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:59 2022 -> ^downloadPatch: Can't download test-5.cdiff from http://localhost:8001/test-5.cdiff Wed Jun 29 16:51:59 2022 -> Downloaded 1 patches for test, which is fewer than the 3 expected patches. Wed Jun 29 16:51:59 2022 -> We'll settle for this partial-update, at least for now. Wed Jun 29 16:52:00 2022 -> *updatedb: Running g_cb_download_complete callback... Wed Jun 29 16:52:00 2022 -> *download_complete_callback: Download complete for database : /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.5c87ae3ca4/clamav-5668389939946458760f556e95934a3e.tmp-test.cld Wed Jun 29 16:52:00 2022 -> *download_complete_callback: fc_context->bTestDatabases : 1 Wed Jun 29 16:52:00 2022 -> *download_complete_callback: fc_context->bBytecodeEnabled : 1 Wed Jun 29 16:52:00 2022 -> Testing database: '/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.5c87ae3ca4/clamav-5668389939946458760f556e95934a3e.tmp-test.cld' ... Wed Jun 29 16:52:00 2022 -> *Loading signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.5c87ae3ca4/clamav-5668389939946458760f556e95934a3e.tmp-test.cld Wed Jun 29 16:52:00 2022 -> *Properly loaded 12 signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.5c87ae3ca4/clamav-5668389939946458760f556e95934a3e.tmp-test.cld Wed Jun 29 16:52:00 2022 -> ^Database load exited with "Unknown libfreshclam error code!" Wed Jun 29 16:52:00 2022 -> !Database test FAILED. Wed Jun 29 16:52:00 2022 -> *updatedb: callback failed: Test failed (8) Wed Jun 29 16:52:00 2022 -> !Unexpected error when attempting to update test: Test failed Wed Jun 29 16:52:00 2022 -> !Database update process failed: Test failed Wed Jun 29 16:52:00 2022 -> !Update failed. [DEBUG]: stderr: [INFO]: Verifying /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/valgrind.log... [WARNING]: More than one match for item `ERROR SUMMARY: 0 errors`. [INFO]: ==11461== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) [INFO]: --11461-- [INFO]: --11461-- used_suppression: 11 dl_catch_error-leak-1 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:35 suppressed: 82,268 bytes in 15 blocks [INFO]: --11461-- used_suppression: 282 openssl-globals-01 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:77 suppressed: 91,280 bytes in 3,024 blocks [INFO]: --11461-- used_suppression: 64 openssl-globals-02 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:84 suppressed: 1,536 bytes in 64 blocks [INFO]: ==11461== [INFO]: ==11461== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) [INFO]: --11460-- Discarding syms at 0x6324660-0x63297bc in /usr/lib64/libnss_sss.so.2 (have_dinfo 1) [INFO]: --11460-- Discarding syms at 0x63465c0-0x634f7fc in /usr/lib64/libnss_files-2.26.so (have_dinfo 1) [INFO]: ==11460== [INFO]: ==11460== FILE DESCRIPTORS: 4 open (3 std) at exit. [INFO]: ==11460== Open file descriptor 3: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/valgrind.log [INFO]: ==11460== [INFO]: ==11460== [INFO]: ==11460== [INFO]: ==11460== HEAP SUMMARY: [INFO]: ==11460== in use at exit: 84,122 bytes in 54 blocks [INFO]: ==11460== total heap usage: 6,028 allocs, 5,974 frees, 876,846 bytes allocated [INFO]: ==11460== [INFO]: ==11460== Searching for pointers to 54 not-freed blocks [INFO]: ==11460== Checked 941,688 bytes [INFO]: ==11460== [INFO]: ==11460== LEAK SUMMARY: [INFO]: ==11460== definitely lost: 0 bytes in 0 blocks [INFO]: ==11460== indirectly lost: 0 bytes in 0 blocks [INFO]: ==11460== possibly lost: 0 bytes in 0 blocks [INFO]: ==11460== still reachable: 1,854 bytes in 39 blocks [INFO]: ==11460== suppressed: 82,268 bytes in 15 blocks [INFO]: ==11460== Reachable blocks (those to which a pointer was found) are not shown. [INFO]: ==11460== To see them, rerun with: --leak-check=full --show-leak-kinds=all [INFO]: ==11460== [INFO]: ==11460== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) [INFO]: --11460-- [INFO]: --11460-- used_suppression: 11 dl_catch_error-leak-1 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:35 suppressed: 82,268 bytes in 15 blocks [INFO]: ==11460== [INFO]: ==11460== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ----------------------------- Captured stderr call ----------------------------- 127.0.0.1 - - [29/Jun/2022 16:51:59] "GET /test.cvd HTTP/1.1" 206 - 127.0.0.1 - - [29/Jun/2022 16:51:59] "GET /test-4.cdiff HTTP/1.1" 200 - 127.0.0.1 - - [29/Jun/2022 16:51:59] code 404, message test-5.cdiff Not Found 127.0.0.1 - - [29/Jun/2022 16:51:59] "GET /test-5.cdiff HTTP/1.1" 404 - 127.0.0.1 - - [29/Jun/2022 16:51:59] code 404, message test-5.cdiff Not Found 127.0.0.1 - - [29/Jun/2022 16:51:59] "GET /test-5.cdiff HTTP/1.1" 404 - 127.0.0.1 - - [29/Jun/2022 16:51:59] code 404, message test-5.cdiff Not Found 127.0.0.1 - - [29/Jun/2022 16:51:59] "GET /test-5.cdiff HTTP/1.1" 404 - ________________ TC.test_freshclam_07_no_cdiff_out_of_date_cvd _________________ self = def test_freshclam_07_no_cdiff_out_of_date_cvd(self): self.step_name('Verify that freshclam will properly handle an out-of-date CVD update after a zero-byte CDIFF') # start with CVD 1 shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-1.cvd'), str(TC.path_db / 'test.cvd')) # advertise CVD 6 (by sending the header response to Range requests) shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-6.cvd'), str(TC.path_www / 'test.cvd.advertised')) # Serve the patches 2. shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-2.cdiff'), str(TC.path_www)) # Serve a zero-byte file instead of test-3.cdiff. This should trigger a whole CVD download. with (TC.path_www / 'test-3.cdiff').open('w') as fp: pass # Serve CVD 5 when test.cvd is requested instead of 6 (the advertised one). This should trigger an incremental update, starting a test-4.cvd + patches 5-6. shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-5.cvd'), str(TC.path_www / 'test.cvd.served')) # Serve the patches 5 - 6. Patch 4 should never be requested. shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-5.cdiff'), str(TC.path_www)) shutil.copy(str(TC.path_source / 'unit_tests' / 'input' / 'freshclam_testfiles' /'test-6.cdiff'), str(TC.path_www)) handler = partial(WebServerHandler_WWW, TC.path_www) TC.mock_mirror = Process(target=mock_database_mirror, args=(handler, TC.mock_mirror_port)) TC.mock_mirror.start() if TC.freshclam_config.exists(): os.remove(str(TC.freshclam_config)) TC.freshclam_config.write_text(''' DatabaseMirror http://localhost:{port} DNSDatabaseInfo no PidFile {freshclam_pid} LogVerbose yes LogFileMaxSize 0 LogTime yes DatabaseDirectory {path_db} DatabaseOwner {user} '''.format( freshclam_pid=TC.freshclam_pid, path_db=TC.path_db, port=TC.mock_mirror_port, user=getpass.getuser(), )) # # 1st attempt # command = '{valgrind} {valgrind_args} {freshclam} --config-file={freshclam_config} --update-db=test'.format( valgrind=TC.valgrind, valgrind_args=TC.valgrind_args, freshclam=TC.freshclam, freshclam_config=TC.freshclam_config ) output = self.execute_command(command) > assert output.ec == 0 # success E assert 8 == 0 E + where 8 = CmdResult(ec=8, out='Wed Jun 29 16:52:01 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/\nWed Jun 29 16:52:01 2022 -> *Can\'t open freshclam.dat in /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database\nWed Jun 29 16:52:01 2022 -> *It probably doesn\'t exist yet. That\'s ok.\nWed Jun 29 16:52:01 2022 -> *Failed to load freshclam.dat; will create a new freshclam.dat\nWed Jun 29 16:52:01 2022 -> *Creating new freshclam.dat\nWed Jun 29 16:52:01 2022 -> *Saved freshclam.dat\nWed Jun 29 16:52:01 2022 -> ClamAV update process started at Wed Jun 29 16:52:01 2022\nWed Jun 29 16:52:01 2022 -> *Querying no\nWed Jun 29 16:52:01 2022 -> ^Can\'t query no\nWed Jun 29 16:52:01 2022 -> ^Invalid DNS reply. Falling back to HTTP mode.\nWed Jun 29 16:52:01 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/\nWed Jun 29 16:52:01 2022 -> *check_for_new_database_version: Local copy of test found: test.cvd.\nWed Jun 29 16:52:01 2022 -> Trying to retrieve CVD header from http://localhost:8001/test.cvd\n* Trying 127.0.0.1:8001...\n* Connected to localhost (127.0.0.1) port 8001 (#0)\n> GET ...un 29 16:52:01 2022 -> *download_complete_callback: fc_context->bTestDatabases : 1\nWed Jun 29 16:52:01 2022 -> *download_complete_callback: fc_context->bBytecodeEnabled : 1\nWed Jun 29 16:52:01 2022 -> Testing database: \'/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.79d321c4e1/clamav-591eb9158d2e56e73a98bd4c50b19519.tmp-test.cvd\' ...\nWed Jun 29 16:52:01 2022 -> *Loading signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.79d321c4e1/clamav-591eb9158d2e56e73a98bd4c50b19519.tmp-test.cvd\nWed Jun 29 16:52:01 2022 -> *Properly loaded 13 signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.79d321c4e1/clamav-591eb9158d2e56e73a98bd4c50b19519.tmp-test.cvd\nWed Jun 29 16:52:01 2022 -> ^Database load exited with "Unknown libfreshclam error code!"\nWed Jun 29 16:52:01 2022 -> !Database test FAILED.\nWed Jun 29 16:52:01 2022 -> *updatedb: callback failed: Test failed (8)\nWed Jun 29 16:52:01 2022 -> !Unexpected error when attempting to update test: Test failed\nWed Jun 29 16:52:01 2022 -> !Database update process failed: Test failed\nWed Jun 29 16:52:01 2022 -> !Update failed.\n', err='').ec /usr/local/src/clamav-0.104.2/unit_tests/freshclam_test.py:587: AssertionError ----------------------------- Captured stdout call ----------------------------- [INFO]: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [INFO]: Verify that freshclam will properly handle an out-of-date CVD update after a zero-byte CDIFF [INFO]: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [DEBUG]: Run command: /bin/valgrind -v --trace-children=yes --track-fds=yes --leak-check=full --suppressions=/usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp --log-file=/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/valgrind.log --error-exitcode=123 /usr/local/src/clamav-0.104.2/build/freshclam/freshclam --config-file=/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/freshclam-test.conf --update-db=test Web server is running on port 8001 Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test.cvd Mock Server: But they only want bytes 0 through 511 ... Mock Server: Sending 512 bytes back to client. Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-2.cdiff Mock Server: Sending 765 bytes back to client. Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test-3.cdiff Mock Server: Sending 0 bytes back to client. Mock Server: Test requested: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/www/test.cvd Mock Server: Sending 9818 bytes back to client. [DEBUG]: Exit code: 8 [DEBUG]: stdout: Wed Jun 29 16:52:01 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/ Wed Jun 29 16:52:01 2022 -> *Can't open freshclam.dat in /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database Wed Jun 29 16:52:01 2022 -> *It probably doesn't exist yet. That's ok. Wed Jun 29 16:52:01 2022 -> *Failed to load freshclam.dat; will create a new freshclam.dat Wed Jun 29 16:52:01 2022 -> *Creating new freshclam.dat Wed Jun 29 16:52:01 2022 -> *Saved freshclam.dat Wed Jun 29 16:52:01 2022 -> ClamAV update process started at Wed Jun 29 16:52:01 2022 Wed Jun 29 16:52:01 2022 -> *Querying no Wed Jun 29 16:52:01 2022 -> ^Can't query no Wed Jun 29 16:52:01 2022 -> ^Invalid DNS reply. Falling back to HTTP mode. Wed Jun 29 16:52:01 2022 -> *Current working dir is /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/ Wed Jun 29 16:52:01 2022 -> *check_for_new_database_version: Local copy of test found: test.cvd. Wed Jun 29 16:52:01 2022 -> Trying to retrieve CVD header from http://localhost:8001/test.cvd * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test.cvd HTTP/1.1 Host: localhost:8001 Range: bytes=0-511 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: dbb42c59-8bfe-4b85-aa07-295e1ff18e4e) Accept: */* If-Modified-Since: Tue, 22 Jun 2021 18:58:22 GMT Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 206 Partial Content < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:52:01 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:52:01 2022 -> OK Wed Jun 29 16:52:01 2022 -> *test database version obtained using HTTP GET: 6 Wed Jun 29 16:52:01 2022 -> test database available for update (local version: 1, remote version: 6) Wed Jun 29 16:52:01 2022 -> *Retrieving http://localhost:8001/test-2.cdiff Wed Jun 29 16:52:01 2022 -> *downloadFile: Download source: http://localhost:8001/test-2.cdiff Wed Jun 29 16:52:01 2022 -> *downloadFile: Download destination: ./clamav-5c5456e6577c8f8a5e9607afd25e1d7b.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-2.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: dbb42c59-8bfe-4b85-aa07-295e1ff18e4e) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:52:01 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:52:01 2022 -> *cdiff_apply: Parsed 4 lines and executed 4 commands Wed Jun 29 16:52:01 2022 -> *Retrieving http://localhost:8001/test-3.cdiff Wed Jun 29 16:52:01 2022 -> *downloadFile: Download source: http://localhost:8001/test-3.cdiff Wed Jun 29 16:52:01 2022 -> *downloadFile: Download destination: ./clamav-31ede9cede6777637951fa62aa017881.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test-3.cdiff HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: dbb42c59-8bfe-4b85-aa07-295e1ff18e4e) Accept: */* Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:52:01 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:52:01 2022 -> Empty script test-3.cdiff, need to download entire database Wed Jun 29 16:52:01 2022 -> *Empty CDIFF found. Skip incremental updates for this version and download test.cvd Wed Jun 29 16:52:01 2022 -> *Retrieving http://localhost:8001/test.cvd Wed Jun 29 16:52:01 2022 -> *downloadFile: Download source: http://localhost:8001/test.cvd Wed Jun 29 16:52:01 2022 -> *downloadFile: Download destination: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.79d321c4e1/clamav-591eb9158d2e56e73a98bd4c50b19519.tmp * Trying 127.0.0.1:8001... * Connected to localhost (127.0.0.1) port 8001 (#0) > GET /test.cvd HTTP/1.1 Host: localhost:8001 User-Agent: ClamAV/0.104.2 (OS: Linux, ARCH: aarch64, CPU: aarch64, UUID: dbb42c59-8bfe-4b85-aa07-295e1ff18e4e) Accept: */* If-Modified-Since: Tue, 22 Jun 2021 18:58:22 GMT Connection: close * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: BaseHTTP/0.6 Python/3.7.10 < Date: Wed, 29 Jun 2022 16:52:01 GMT < Content-type: application/octet-stream < * Closing connection 0 Wed Jun 29 16:52:01 2022 -> *The test.cvd database downloaded from http://localhost:8001 is older than the version advertised in the DNS TXT record. Wed Jun 29 16:52:01 2022 -> ^Received an older test CVD than was advertised. Incremental updates either failed or are disabled, so we'll have to settle for a slightly out-of-date database. Wed Jun 29 16:52:01 2022 -> *updatedb: Running g_cb_download_complete callback... Wed Jun 29 16:52:01 2022 -> *download_complete_callback: Download complete for database : /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.79d321c4e1/clamav-591eb9158d2e56e73a98bd4c50b19519.tmp-test.cvd Wed Jun 29 16:52:01 2022 -> *download_complete_callback: fc_context->bTestDatabases : 1 Wed Jun 29 16:52:01 2022 -> *download_complete_callback: fc_context->bBytecodeEnabled : 1 Wed Jun 29 16:52:01 2022 -> Testing database: '/usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.79d321c4e1/clamav-591eb9158d2e56e73a98bd4c50b19519.tmp-test.cvd' ... Wed Jun 29 16:52:01 2022 -> *Loading signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.79d321c4e1/clamav-591eb9158d2e56e73a98bd4c50b19519.tmp-test.cvd Wed Jun 29 16:52:01 2022 -> *Properly loaded 13 signatures from /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/database/tmp.79d321c4e1/clamav-591eb9158d2e56e73a98bd4c50b19519.tmp-test.cvd Wed Jun 29 16:52:01 2022 -> ^Database load exited with "Unknown libfreshclam error code!" Wed Jun 29 16:52:01 2022 -> !Database test FAILED. Wed Jun 29 16:52:01 2022 -> *updatedb: callback failed: Test failed (8) Wed Jun 29 16:52:01 2022 -> !Unexpected error when attempting to update test: Test failed Wed Jun 29 16:52:01 2022 -> !Database update process failed: Test failed Wed Jun 29 16:52:01 2022 -> !Update failed. [DEBUG]: stderr: [INFO]: Verifying /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/valgrind.log... [WARNING]: More than one match for item `ERROR SUMMARY: 0 errors`. [INFO]: ==11465== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) [INFO]: --11465-- [INFO]: --11465-- used_suppression: 11 dl_catch_error-leak-1 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:35 suppressed: 82,268 bytes in 15 blocks [INFO]: --11465-- used_suppression: 282 openssl-globals-01 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:77 suppressed: 91,280 bytes in 3,024 blocks [INFO]: --11465-- used_suppression: 64 openssl-globals-02 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:84 suppressed: 1,536 bytes in 64 blocks [INFO]: ==11465== [INFO]: ==11465== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) [INFO]: --11464-- Discarding syms at 0x6324660-0x63297bc in /usr/lib64/libnss_sss.so.2 (have_dinfo 1) [INFO]: --11464-- Discarding syms at 0x63465c0-0x634f7fc in /usr/lib64/libnss_files-2.26.so (have_dinfo 1) [INFO]: ==11464== [INFO]: ==11464== FILE DESCRIPTORS: 4 open (3 std) at exit. [INFO]: ==11464== Open file descriptor 3: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj/valgrind.log [INFO]: ==11464== [INFO]: ==11464== [INFO]: ==11464== [INFO]: ==11464== HEAP SUMMARY: [INFO]: ==11464== in use at exit: 84,122 bytes in 54 blocks [INFO]: ==11464== total heap usage: 6,005 allocs, 5,951 frees, 1,181,353 bytes allocated [INFO]: ==11464== [INFO]: ==11464== Searching for pointers to 54 not-freed blocks [INFO]: ==11464== Checked 941,688 bytes [INFO]: ==11464== [INFO]: ==11464== LEAK SUMMARY: [INFO]: ==11464== definitely lost: 0 bytes in 0 blocks [INFO]: ==11464== indirectly lost: 0 bytes in 0 blocks [INFO]: ==11464== possibly lost: 0 bytes in 0 blocks [INFO]: ==11464== still reachable: 1,854 bytes in 39 blocks [INFO]: ==11464== suppressed: 82,268 bytes in 15 blocks [INFO]: ==11464== Reachable blocks (those to which a pointer was found) are not shown. [INFO]: ==11464== To see them, rerun with: --leak-check=full --show-leak-kinds=all [INFO]: ==11464== [INFO]: ==11464== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) [INFO]: --11464-- [INFO]: --11464-- used_suppression: 11 dl_catch_error-leak-1 /usr/local/src/clamav-0.104.2/unit_tests/valgrind.supp:35 suppressed: 82,268 bytes in 15 blocks [INFO]: ==11464== [INFO]: ==11464== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ----------------------------- Captured stderr call ----------------------------- 127.0.0.1 - - [29/Jun/2022 16:52:01] "GET /test.cvd HTTP/1.1" 206 - 127.0.0.1 - - [29/Jun/2022 16:52:01] "GET /test-2.cdiff HTTP/1.1" 200 - 127.0.0.1 - - [29/Jun/2022 16:52:01] "GET /test-3.cdiff HTTP/1.1" 200 - 127.0.0.1 - - [29/Jun/2022 16:52:01] "GET /test.cvd HTTP/1.1" 200 - --------------------------- Captured stdout teardown --------------------------- [INFO]: Removed tmp directory: /usr/local/src/clamav-0.104.2/build/unit_tests/TC-uon3ekuj =========================== short test summary info ============================ FAILED freshclam_test.py::TC::test_freshclam_05_cdiff_update - assert 8 == 0 FAILED freshclam_test.py::TC::test_freshclam_06_cdiff_partial_minus_1 - asser... FAILED freshclam_test.py::TC::test_freshclam_07_cdiff_partial_minus_2 - asser... FAILED freshclam_test.py::TC::test_freshclam_07_no_cdiff_out_of_date_cvd - as... =================== 4 failed, 5 passed, 1 skipped in 12.48s ==================== 0% tests passed, 1 tests failed out of 1 Total Test time (real) = 12.87 sec The following tests FAILED: 8 - freshclam_valgrind (Failed)