~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to unit_tests/check_common.sh

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
# ----------- valgrind wrapper 
123
123
init_valgrind() {
124
124
    test "x$VG" = "x1" || { echo "*** valgrind tests skipped by default, use 'make check VG=1' to activate"; exit 77; }
125
 
    export VALGRIND=`which ${VALGRIND-valgrind}`
126
 
    export VALGRIND_COMMON_FLAGS="-v --trace-children=yes --suppressions=$abs_srcdir/valgrind.supp --log-file=valgrind.log --error-exitcode=123 $GENSUPP"
127
 
    export VALGRIND_FLAGS="$VALGRIND_COMMON_FLAGS --track-fds=yes --leak-check=full"
128
 
    export VALGRIND_FLAGS_RACE="$VALGRIND_COMMON_FLAGS --tool=helgrind"
 
125
    VALGRIND=`which ${VALGRIND-valgrind}` || true
 
126
    VALGRIND_COMMON_FLAGS="-v --trace-children=yes --suppressions=$abs_srcdir/valgrind.supp --log-file=valgrind.log --error-exitcode=123 $GENSUPP"
 
127
    VALGRIND_FLAGS="$VALGRIND_COMMON_FLAGS --track-fds=yes --leak-check=full"
 
128
    VALGRIND_FLAGS_RACE="$VALGRIND_COMMON_FLAGS --tool=helgrind"
 
129
    export VALGRIND VALGRIND_COMMON_FLAGS VALGRIND_FLAGS VALGRIND_FLAGS_RACE
129
130
    test -n "$VALGRIND" || { echo "*** valgrind not found, skipping test"; exit 77; }
130
131
    test -x "$VALGRIND" || { echo "*** valgrind not executable, skipping test"; exit 77; }
131
132
}
146
147
# ----------- clamscan tests --------------------------------------------------------
147
148
test_clamscan() {
148
149
    test_start $1
149
 
    if test_run 1 $CLAMSCAN --quiet -dtest-db/test.hdb $TESTFILES --log=clamscan.log; then
 
150
    if test_run 1 $CLAMSCAN --debug --quiet -dtest-db/test.hdb $TESTFILES --log=clamscan.log; then
150
151
        scan_failed clamscan.log "clamscan didn't detect all testfiles correctly"
151
152
    fi
152
153
    NINFECTED=`grep "Infected files" clamscan.log | cut -f2 -d: | sed -e 's/ //g'`
167
168
        die "Failed to run clamscan (phish-test2)";
168
169
    fi
169
170
 
170
 
    grep "phish-test-ssl: Phishing.Heuristics.Email.SSL-Spoof FOUND" clamscan3.log >/dev/null || die "phish-test1 failed";
171
 
    grep "phish-test-cloak: Phishing.Heuristics.Email.Cloaked.Null FOUND" clamscan3.log >/dev/null || die "phish-test2 failed";
 
171
    grep "phish-test-ssl: Heuristics.Phishing.Email.SSL-Spoof FOUND" clamscan3.log >/dev/null || die "phish-test1 failed";
 
172
    grep "phish-test-cloak: Heuristics.Phishing.Email.Cloaked.Null FOUND" clamscan3.log >/dev/null || die "phish-test2 failed";
172
173
    test_end $1
173
174
}
174
175
 
302
303
    start_clamd
303
304
    # Test HeuristicScanPrecedence feature
304
305
    run_clamdscan ../clam-phish-exe
305
 
    grep "Phishing.Heuristics.Email.SpoofedDomain" clamdscan.log >/dev/null 2>/dev/null ||
 
306
    grep "Heuristics.Phishing.Email.SpoofedDomain" clamdscan.log >/dev/null 2>/dev/null ||
306
307
        { cat clamdscan.log; die "HeuristicScanPrecedence on test failed!"; }
307
308
 
308
309
    if grep "^#define HAVE_FD_PASSING 1" $TOP/clamav-config.h >/dev/null; then
313
314
        echo "*** No file descriptor passing support, skipping test"
314
315
    fi
315
316
 
 
317
    rm test-clamd.log
316
318
    # Test VirusEvent feature
317
319
    run_clamdscan_fileonly $TOP/test/clam.exe
318
320
    test -f test-clamd.log || sleep 1