2 # A set of useful functions to be sourced in each test
9 echo " === Starting $TestName at `date +%R:%S` ==="
10 echo " === Starting $TestName at `date +%R:%S` ===" >>working/log
17 if test "$debug" -eq 1 ; then
27 if test "$debug" -eq 1 ; then
29 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
31 bin/bacula start 2>&1 >/dev/null
32 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
38 if test "$debug" -eq 1 ; then
39 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
41 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
47 if test "$debug" -eq 1 ; then
48 cat tmp/bconcmds | bin/btape -c bin/bacula-sd.conf DDS-4 | tee tmp/log1.out
50 cat tmp/bconcmds | bin/btape -c bin/bacula-sd.conf DDS-4 2>&1 >tmp/log1.out
56 if test "$debug" -eq 1 ; then
57 bin/bscan $* | tee tmp/log.out
59 bin/bscan $* 2>&1 >/dev/null
66 bin/bacula stop 2>&1 >/dev/null
69 check_for_zombie_jobs()
71 scripts/check_for_zombie_jobs $1
76 if test $# -eq 1; then
84 mv bin/bacula-dir.conf bin/1
85 echo "s%${oldname}%${newname}%g" >tmp/1
86 sed -f tmp/1 bin/1 >bin/bacula-dir.conf
87 # echo "Job ${oldname} changed to ${newname}"
92 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
94 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
100 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
104 check_restore_tmp_build_diff()
106 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
112 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
115 echo " !!!!! $TestName Bacula source failed!!! !!!!! "
116 echo " !!!!! $TestName failed!!! !!!!! " >>test.out
117 if [ $bstat != 0 -o $rstat != 0 ] ; then
118 echo " !!!!! Bad Job termination status !!!!! "
119 echo " !!!!! Bad Job termination status !!!!! " >>test.out
121 echo " !!!!! Restored files differ !!!!! "
122 echo " !!!!! Restored files differ !!!!! " >>test.out
126 echo " ===== $TestName Bacula source OK `date +%R:%S` ===== "
127 echo " ===== $TestName OK `date +%R:%S` ===== " >>test.out
128 if test "$debug" -eq 0 ; then
136 scripts/copy-tape-confs
142 scripts/copy-test-confs
148 if test "x${REGRESS_WAIT}" = "x1"; then
149 echo "Start Bacula under debugger and enter anything when ready ..."
154 # Save current directory
156 if test "x${REGRESS_DEBUG}" = "x1"; then