#
end_test()
{
- cat ${working}/bacula.*.traceback 2>/dev/null
- cat ${working}/*.bactrace 2>/dev/null
+ if [ x$notracedump != xyes ]; then
+ cat ${working}/bacula.*.traceback 2>/dev/null
+ cat ${working}/*.bactrace 2>/dev/null
+ fi
if [ $estat != 0 ] ; then
echo " "
echo " !!!!! $TestName failed!!! `date +%R:%S` !!!!! "
--- /dev/null
+#!/bin/sh
+#
+# Test lockmanager
+#
+TestName="lockmgr-test"
+JobName=backup
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-confs
+
+grep '#define _USE_LOCKMGR 1' $src/src/config.h > /dev/null
+if [ $? != 0 ]; then
+ echo "lockmanager disabled"
+ exit 0
+fi
+
+#
+# Zap out any schedule in default conf file so that
+# it doesn't start during our test
+#
+outf="$tmp/sed_tmp"
+echo "s% Schedule =%# Schedule =%g" >${outf}
+cp $scripts/bacula-dir.conf $tmp/1
+sed -f ${outf} $tmp/1 >$scripts/bacula-dir.conf
+
+start_test
+
+make -C $src/src/lib lockmgr_test > /dev/null
+if [ -f $src/src/lib/.libs/lockmgr_test ]; then
+ LD_LIBRARY_PATH=$src/src/lib/.libs $src/src/lib/.libs/lockmgr_test > $tmp/1
+else
+ $src/src/lib/lockmgr_test > $tmp/1
+fi
+
+estat=$?
+
+print_debug `cat $tmp/1`
+
+cat <<END_OF_DATA >$tmp/bconcmds
+@$out /dev/null
+messages
+@$out $tmp/log1.out
+.die deadlock storage
+.die deadlock dir
+quit
+END_OF_DATA
+
+run_bacula
+stop_bacula
+
+nb=`ls $working/*.traceback $working/*.bactrace | wc -l`
+if [ $nb != 4 ]; then
+ print_debug "Should find 4 traces, not $nb"
+ estat=1
+fi
+
+notracedump=yes
+export notracedump
+end_test