2008-09-15 09:57:02 +00:00
#!/bin/sh
# Run under duma
2009-02-25 20:41:16 +00:00
test " x $RUNDUMA " = "x1" || { echo "*** duma tests skipped by default, use 'make check RUNDUMA=1' to activate (but don't report bugs about timeouts!)" ; exit 77; }
2008-10-19 11:34:19 +00:00
LIBDIRS = ` ../libtool --config | grep sys_lib_search_path_spec | sed -e 's/.*"\(.*\)"/\1/' `
2008-09-15 16:23:19 +00:00
if test -z " $LIBDUMA " ; then
2008-10-27 13:53:58 +00:00
for i in $LIBDIRS ; do
2008-10-19 11:34:19 +00:00
if test -f " $i /libduma.so " ; then
LIBDUMA = " $i /libduma.so "
2008-09-15 16:23:19 +00:00
break;
fi
done
fi
2008-09-15 09:57:02 +00:00
test -f " $LIBDUMA " || { echo "*** duma not found, skipping test" ; exit 77; }
DUMA_FILL = 90
DUMA_MALLOC_0_STRATEGY = 1
DUMA_OUTPUT_FILE = duma.log
DUMA_DISABLE_BANNER = 1
LIBPRELOAD = " $LIBDUMA "
rm -f duma.log
2009-02-24 21:27:38 +00:00
export CK_DEFAULT_TIMEOUT = 40
2008-09-15 09:57:02 +00:00
export DUMA_FILL DUMA_MALLOC_0_STRATEGY DUMA_OUTPUT_FILE DUMA_DISABLE_BANNER LIBPRELOAD
2008-09-23 20:52:15 +00:00
echo "--- starting clamd under duma to detect overruns"
2009-02-24 21:27:38 +00:00
CLAMD_WRAPPER = $abs_srcdir /preload_run.sh $abs_srcdir /check_clamd.sh
if test $? -ne 0; then
echo "*** DUMA has detected errors"
cat duma.log
rm -f duma.log duma2.log
exit 1
fi
2008-09-16 10:32:25 +00:00
echo "--- starting clamd under duma to detect underruns"
DUMA_OUTPUT_FILE = duma2.log
2008-09-15 09:57:02 +00:00
DUMA_PROTECT_BELOW = 1
export DUMA_PROTECT_BELOW
2008-09-16 10:32:25 +00:00
rm -f duma2.log
2009-02-24 21:27:38 +00:00
CLAMD_TEST_UNIQ1 = 3 CLAMD_TEST_UNIQ2 = 4 CLAMD_WRAPPER = $abs_srcdir /preload_run.sh $abs_srcdir /check_clamd.sh
if test $? -ne 0; then
2008-09-16 10:32:25 +00:00
echo "*** DUMA has detected errors"
cat duma2.log
rm -f duma.log duma2.log
exit 1
fi
exit 0