diff --git a/pkgs/by-name/cl/clamav/package.nix b/pkgs/by-name/cl/clamav/package.nix index 50d7e8d87a60..e1c0fb47a873 100644 --- a/pkgs/by-name/cl/clamav/package.nix +++ b/pkgs/by-name/cl/clamav/package.nix @@ -34,9 +34,8 @@ stdenv.mkDerivation rec { }; patches = [ - # Flaky test, remove this when https://github.com/Cisco-Talos/clamav/issues/343 is fixed - ./remove-freshclam-test.patch - ./sample-cofiguration-file-install-location.patch + ./sample-configuration-file-install-location.patch + ./use-non-existent-file-with-proper-permissions.patch ]; enableParallelBuilding = true; @@ -69,7 +68,9 @@ stdenv.mkDerivation rec { "-DAPP_CONFIG_DIRECTORY=/etc/clamav" ]; - doCheck = true; + # Seems to only fail on x86_64-darwin with sandboxing + doCheck = !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64); + __darwinAllowLocalNetworking = true; checkInputs = [ python3.pkgs.pytest diff --git a/pkgs/by-name/cl/clamav/remove-freshclam-test.patch b/pkgs/by-name/cl/clamav/remove-freshclam-test.patch deleted file mode 100644 index 93078b52aaad..000000000000 --- a/pkgs/by-name/cl/clamav/remove-freshclam-test.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt -index 1460357ba..1194abc9d 100644 ---- a/unit_tests/CMakeLists.txt -+++ b/unit_tests/CMakeLists.txt -@@ -371,15 +371,6 @@ if(ENABLE_APP) - set_property(TEST clamd_valgrind PROPERTY ENVIRONMENT ${ENVIRONMENT} VALGRIND=${Valgrind_EXECUTABLE}) - endif() - -- add_test(NAME freshclam COMMAND ${PythonTest_COMMAND};freshclam_test.py -- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) -- set_property(TEST freshclam PROPERTY ENVIRONMENT ${ENVIRONMENT}) -- if(Valgrind_FOUND) -- add_test(NAME freshclam_valgrind COMMAND ${PythonTest_COMMAND};freshclam_test.py -- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) -- set_property(TEST freshclam_valgrind PROPERTY ENVIRONMENT ${ENVIRONMENT} VALGRIND=${Valgrind_EXECUTABLE}) -- endif() -- - add_test(NAME sigtool COMMAND ${PythonTest_COMMAND};sigtool_test.py - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - set_property(TEST sigtool PROPERTY ENVIRONMENT ${ENVIRONMENT}) diff --git a/pkgs/by-name/cl/clamav/sample-cofiguration-file-install-location.patch b/pkgs/by-name/cl/clamav/sample-configuration-file-install-location.patch similarity index 100% rename from pkgs/by-name/cl/clamav/sample-cofiguration-file-install-location.patch rename to pkgs/by-name/cl/clamav/sample-configuration-file-install-location.patch diff --git a/pkgs/by-name/cl/clamav/use-non-existent-file-with-proper-permissions.patch b/pkgs/by-name/cl/clamav/use-non-existent-file-with-proper-permissions.patch new file mode 100644 index 000000000000..0cbc3cb6583d --- /dev/null +++ b/pkgs/by-name/cl/clamav/use-non-existent-file-with-proper-permissions.patch @@ -0,0 +1,13 @@ +diff --git a/unit_tests/check_clamd.c b/unit_tests/check_clamd.c +index 2f526709a..df67c36ed 100644 +--- a/unit_tests/check_clamd.c ++++ b/unit_tests/check_clamd.c +@@ -144,7 +144,7 @@ static void conn_teardown(void) + #define CLEANREPLY CLEANFILE ": OK" + #define UNKNOWN_REPLY "UNKNOWN COMMAND" + +-#define NONEXISTENT PATHSEP "nonexistentfilename" ++#define NONEXISTENT PATHSEP "tmp" PATHSEP "nonexistentfilename" + + #define NONEXISTENT_REPLY NONEXISTENT ": File path check failure: No such file or directory. ERROR" +