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
28 bin/bacula-ctl-sd start
29 bin/bacula-ctl-fd start
30 bin/bacula-ctl-dir start
31 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
33 bin/bacula start 2>&1 >/dev/null
34 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
40 if test "$debug" -eq 1 ; then
41 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
43 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
49 if test "$debug" -eq 1 ; then
50 cat tmp/bconcmds | bin/btape -c bin/bacula-sd.conf DDS-4 | tee tmp/log1.out
52 cat tmp/bconcmds | bin/btape -c bin/bacula-sd.conf DDS-4 2>&1 >tmp/log1.out
58 if test "$debug" -eq 1 ; then
59 bin/bscan $* | tee tmp/log.out
61 bin/bscan $* 2>&1 >/dev/null
68 bin/bacula stop 2>&1 >/dev/null
71 check_for_zombie_jobs()
73 scripts/check_for_zombie_jobs $1
78 if test $# -eq 1; then
86 mv bin/bacula-dir.conf bin/1
87 echo "s%${oldname}%${newname}%g" >tmp/1
88 sed -f tmp/1 bin/1 >bin/bacula-dir.conf
89 # echo "Job ${oldname} changed to ${newname}"
94 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
96 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
102 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
106 check_restore_tmp_build_diff()
108 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
114 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
117 echo " !!!!! $TestName Bacula source failed!!! !!!!! "
118 echo " !!!!! $TestName failed!!! !!!!! " >>test.out
119 if [ $bstat != 0 -o $rstat != 0 ] ; then
120 echo " !!!!! Bad Job termination status !!!!! "
121 echo " !!!!! Bad Job termination status !!!!! " >>test.out
123 echo " !!!!! Restored files differ !!!!! "
124 echo " !!!!! Restored files differ !!!!! " >>test.out
128 echo " ===== $TestName Bacula source OK `date +%R:%S` ===== "
129 echo " ===== $TestName OK `date +%R:%S` ===== " >>test.out
130 if test "$debug" -eq 0 ; then
138 scripts/copy-tape-confs
144 scripts/copy-test-confs
150 if test "x${REGRESS_WAIT}" = "x1"; then
151 echo "Start Bacula under debugger and enter anything when ready ..."
156 # Save current directory
158 if test "x${REGRESS_DEBUG}" = "x1"; then