Unverified Commit 7178a0ca authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

clamav: fix tests on sandboxed Darwin (#418797)

parents bf158e1d 5e3aab16
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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
+0 −20
Original line number Diff line number Diff line
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})
+13 −0
Original line number Diff line number Diff line
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"