Debian Codegraph @

debian/tests/virus-scan

raw
1 #!/bin/sh
2
3 . "$(dirname $0)/toolbox.sh"
4
5 c_icap_enable_virus_scan() {
6 echo 'Enabling virus-scan'
7 append_line 'Include virus_scan.conf' /etc/c-icap/c-icap.conf
8 append_line 'Include clamd_mod.conf' /etc/c-icap/virus_scan.conf
9 }
10
11 clamd_enable() {
12 # FIXME Offline mode, see #825817
13 service clamav-freshclam stop
14 freshclam 2>&1
15 service clamav-daemon start
16 }
17
18 c_icap_enable
19 c_icap_enable_virus_scan
20 clamd_enable
21 c_icap_start
22 c_icap_test_basic
23 c_icap_test_service 'virus_scan' 'Antivirus service'
24 echo 'Testing Eicar'
25 c-icap-client -i 127.0.0.1 -s virus_scan -f "$(dirname $0)/eicar.com.txt" -v 2>&1 >/dev/null \
26 | grep -qF '403 Forbidden' \
27 || error 'Eicar Test File not forbidden'