2
CLAMSCAN_WRAPPER=${CLAMSCAN_WRAPPER-}
9
if test "X$unrar_disabled" = "X1" && test `grep -v '\.rar' $1 | grep OK | wc -l` -eq 0
12
echo "*** UNRAR is disabled, won't be able to detect unrar files!" >&2;
15
echo "clamscan did not detect all testfiles correctly!" >&2;
21
cat <<EOF >test-db/test.hdb
22
aa15bcf478d165efd2065190eb473bcb:544:ClamAV-Test-File
25
../libtool --mode=execute $CLAMSCAN_WRAPPER ../clamscan/clamscan --quiet -dtest-db/test.hdb ../test/clam* --log=clamscan.log
27
echo "Error running clamscan: $?" >&2;
28
grep OK clamscan.log >&2;
31
NFILES=`ls -1 ../test/clam* | wc -l`
32
NINFECTED=`grep "Infected files" clamscan.log | cut -f2 -d: |sed -e 's/ //g'`
33
if test "$NFILES" -ne "0$NINFECTED"; then
34
grep OK clamscan.log >&2;
35
scan_failed clamscan.log
38
cat <<EOF >test-db/test.pdb
42
../clamscan/clamscan -dtest-db $abs_srcdir/input/phish-test-* --log=clamscan2.log --quiet
44
if test $val != 0; then
45
if test $val = 1; then
46
echo "clamscan detected a file it shouldn't" >&2
47
grep FOUND clamscan2.log
50
echo "Error running clamscan: $val" >&2;
55
../clamscan/clamscan --phishing-ssl --phishing-cloak -dtest-db $abs_srcdir/input/phish-test-* --log=clamscan2.log --quiet
57
if test $val != 1; then
58
echo "Error running clamscan: $val" >&2;
61
grep "phish-test-ssl: Phishing.Heuristics.Email.SSL-Spoof FOUND" clamscan2.log >/dev/null && grep "phish-test-cloak: Phishing.Heuristics.Email.Cloaked.Null FOUND" clamscan2.log >/dev/null
62
if test $? -ne 0; then
63
echo "Error on ssl/cloak phishing test" >&2;