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
26 if test "$debug" -eq 1 ; then
28 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
30 bin/bacula start 2>&1 >/dev/null
31 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
37 if test "$debug" -eq 1 ; then
38 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
40 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
46 bin/bacula stop 2>&1 >/dev/null
49 check_for_zombie_jobs()
51 scripts/check_for_zombie_jobs $1
57 mv bin/bacula-dir.conf bin/1
58 echo "s%NightlySave%$1%g" >/tmp/1
59 sed -f /tmp/1 bin/1 >bin/bacula-dir.conf
64 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
66 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
72 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
76 check_restore_tmp_build_diff()
78 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
84 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
87 echo " !!!!! $TestName Bacula source failed!!! !!!!! "
88 echo " !!!!! $TestName failed!!! !!!!! " >>test.out
89 if [ $bstat != 0 -o $rstat != 0 ] ; then
90 echo " !!!!! Bad Job termination status !!!!! "
91 echo " !!!!! Bad Job termination status !!!!! " >>test.out
93 echo " !!!!! Restored files differ !!!!! "
94 echo " !!!!! Restored files differ !!!!! " >>test.out
98 echo " ===== $TestName Bacula source OK `date +%R:%S` ===== "
99 echo " ===== $TestName OK `date +%R:%S` ===== " >>test.out
104 # Save current directory