8080
8181cp "${config_file}" "${TEST_STATE}/clamd.conf"
8282printf '%s\n' "$$" > "${TEST_STATE}/clamd.pid"
83+
84+ case "${FAKE_SCAN_EXIT:-0}" in
85+ 0)
86+ printf '%s\n' \
87+ "${TEST_STATE}/work/clean-one.php: OK" \
88+ "${TEST_STATE}/work/clean-two.php: OK"
89+ ;;
90+ 1)
91+ printf '%s\n' \
92+ "${TEST_STATE}/work/clean.php: OK" \
93+ "${TEST_STATE}/work/infected.php: Eicar-Test-Signature FOUND"
94+ ;;
95+ 2)
96+ printf '%s\n' \
97+ "${TEST_STATE}/work/unreadable.php: Permission denied. ERROR"
98+ ;;
99+ esac
100+
83101trap 'touch "${TEST_STATE}/clamd.stopped"; exit 0' TERM INT
84102while :; do
85103 sleep 0.05
@@ -106,16 +124,14 @@ done
106124case "${FAKE_SCAN_EXIT:-0}" in
107125 0)
108126 printf '%s\n' \
109- "${TEST_STATE}/work/clean-one.php: OK" \
110- "${TEST_STATE}/work/clean-two.php: OK" \
127+ "${TEST_STATE}/work: OK" \
111128 '' \
112129 '----------- SCAN SUMMARY -----------' \
113130 'Infected files: 0' \
114131 'Time: 0.010 sec (0 m 0 s)'
115132 ;;
116133 1)
117134 printf '%s\n' \
118- "${TEST_STATE}/work/clean.php: OK" \
119135 "${TEST_STATE}/work/infected.php: Eicar-Test-Signature FOUND" \
120136 '' \
121137 '----------- SCAN SUMMARY -----------' \
@@ -180,6 +196,7 @@ run_scan_case() {
180196run_scan_case clean 0 success 0
181197assert_file_contains " ${TEST_DIR} /clean/clamdscan.calls" ' --multiscan' ' clean scan requests multiscan'
182198assert_file_not_contains " ${TEST_DIR} /clean/clamdscan.calls" ' --infected' ' clean scan captures clean results for counting'
199+ assert_file_contains " ${TEST_DIR} /clean/clamd.conf" ' ^LogClean yes$' ' clean file results are enabled in the private daemon log'
183200assert_file_contains " ${TEST_DIR} /clean/clamd.conf" ' ExcludePath .*\\.composer-cache' ' composer cache exclusion is configured for clamd'
184201assert_file_contains " ${TEST_DIR} /clean/clamd.conf" ' ExcludePath .*node_modules_cache' ' node modules cache exclusion is configured for clamd'
185202assert_file_contains " ${TEST_DIR} /clean/output" ' Scanned files: 2' ' clean scan reports the scanned file count'
0 commit comments