]> git.sur5r.net Git - bacula/bacula/commitdiff
regress: Add lockmgr-test
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 8 Feb 2010 19:45:54 +0000 (20:45 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:49:27 +0000 (16:49 +0200)
regress/scripts/functions
regress/tests/lockmgr-test [new file with mode: 0755]

index a000a7ea876bd14694ed3ae7f9923a02005f82bf..36d0b0aac6a587c08cf5af5de5de67ae8a035f20 100644 (file)
@@ -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 (executable)
index 0000000..d1a88be
--- /dev/null
@@ -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 <<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