From: Eric Bollengier Date: Mon, 8 Feb 2010 19:45:54 +0000 (+0100) Subject: regress: Add lockmgr-test X-Git-Tag: Release-5.2.1~1792 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d22b5489ac4326ef404e2a32018fb6b0749fe30b;p=bacula%2Fbacula regress: Add lockmgr-test --- diff --git a/regress/scripts/functions b/regress/scripts/functions index a000a7ea87..36d0b0aac6 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -315,8 +315,10 @@ check_restore_tmp_build_diff() # 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` !!!!! " diff --git a/regress/tests/lockmgr-test b/regress/tests/lockmgr-test new file mode 100755 index 0000000000..d1a88be4d8 --- /dev/null +++ b/regress/tests/lockmgr-test @@ -0,0 +1,60 @@ +#!/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 <$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