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
55 if test "$debug" -eq 1 ; then
56 bin/bscan $* | tee tmp/log.out
58 bin/bscan $* 2>&1 >/dev/null
65 bin/bacula stop 2>&1 >/dev/null
68 check_for_zombie_jobs()
70 scripts/check_for_zombie_jobs $1
75 if test $# -eq 1; then
83 mv bin/bacula-dir.conf bin/1
84 echo "s%${oldname}%${newname}%g" >tmp/1
85 sed -f tmp/1 bin/1 >bin/bacula-dir.conf
86 # echo "Job ${oldname} changed to ${newname}"
91 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
93 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
99 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
103 check_restore_tmp_build_diff()
105 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
111 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
114 echo " !!!!! $TestName Bacula source failed!!! !!!!! "
115 echo " !!!!! $TestName failed!!! !!!!! " >>test.out
116 if [ $bstat != 0 -o $rstat != 0 ] ; then
117 echo " !!!!! Bad Job termination status !!!!! "
118 echo " !!!!! Bad Job termination status !!!!! " >>test.out
120 echo " !!!!! Restored files differ !!!!! "
121 echo " !!!!! Restored files differ !!!!! " >>test.out
125 echo " ===== $TestName Bacula source OK `date +%R:%S` ===== "
126 echo " ===== $TestName OK `date +%R:%S` ===== " >>test.out
127 if test "$debug" -eq 0 ; then
135 scripts/copy-tape-confs
141 scripts/copy-test-confs
146 # Save current directory