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 if test "$debug" -eq 1 ; then
47 cat tmp/bconcmds | bin/btape -c bin/bacula-sd.conf DDS-4 | tee tmp/log1.out
49 cat tmp/bconcmds | bin/btape -c bin/bacula-sd.conf DDS-4 2>&1 >tmp/log1.out
56 bin/bacula stop 2>&1 >/dev/null
59 check_for_zombie_jobs()
61 scripts/check_for_zombie_jobs $1
66 if test $# -eq 1; then
74 mv bin/bacula-dir.conf bin/1
75 echo "s%${oldname}%${newname}%g" >/tmp/1
76 sed -f /tmp/1 bin/1 >bin/bacula-dir.conf
77 # echo "Job ${oldname} changed to ${newname}"
82 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
84 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
90 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
94 check_restore_tmp_build_diff()
96 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
102 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
105 echo " !!!!! $TestName Bacula source failed!!! !!!!! "
106 echo " !!!!! $TestName failed!!! !!!!! " >>test.out
107 if [ $bstat != 0 -o $rstat != 0 ] ; then
108 echo " !!!!! Bad Job termination status !!!!! "
109 echo " !!!!! Bad Job termination status !!!!! " >>test.out
111 echo " !!!!! Restored files differ !!!!! "
112 echo " !!!!! Restored files differ !!!!! " >>test.out
116 echo " ===== $TestName Bacula source OK `date +%R:%S` ===== "
117 echo " ===== $TestName OK `date +%R:%S` ===== " >>test.out
118 if test "$debug" -eq 0 ; then
126 scripts/copy-tape-confs
132 scripts/copy-test-confs
137 # Save current directory