3 # Run a simple backup of the Bacula build directory but
4 # split the archive into two volumes then bscan it
5 # into the catalog after the backup. It also to a limited
6 # extent tests the purge volume and delete volume commands.
10 if test "$debug" -eq 1 ; then
17 scripts/copy-test-confs
19 echo "${cwd}/build" >/tmp/file-list
23 echo " === Starting bscan-test at `date +%R:%S` ==="
24 echo " === Starting bscan-test at `date +%R:%S` ===" >working/log
27 cat <<END_OF_DATA >tmp/bconcmds
35 update Volume=TestVolume001 MaxVolBytes=3000000
36 run job=NightlySave storage=File1
42 @# now purge the Volume
44 purge volume=TestVolume001
45 purge volume=TestVolume002
46 delete volume=TestVolume001
48 delete volume=TestVolume002
55 if test "$debug" -eq 1 ; then
57 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
59 bin/bacula start 2>&1 >/dev/null
60 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
63 scripts/check_for_zombie_jobs storage=File1
64 bin/bacula stop 2>&1 >/dev/null
65 echo "volume=TestVolume001|TestVolume002" >tmp/bscan.bsr
67 if test "$debug" -eq 1 ; then
68 bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp
70 bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >/dev/null
73 cat <<END_OF_DATA >tmp/bconcmds
80 @#setdebug level=400 storage=File1
81 restore bootstrap=${cwd}/tmp/kern.bsr where=${cwd}/tmp/bacula-restores select all storage=File1 done
90 if test "$debug" -eq 1 ; then
92 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
94 bin/bacula start 2>&1 >/dev/null
95 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
99 scripts/check_for_zombie_jobs storage=File1
100 bin/bacula stop 2>&1 >/dev/null
101 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
103 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
105 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
106 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
109 echo " !!!!! bscan-test Bacula source failed!!! !!!!! "
110 echo " !!!!! bscan-test failed!!! !!!!! " >>test.out
111 if [ $bstat != 0 -o $rstat != 0 ] ; then
112 echo " !!!!! Bad Job termination status !!!!! "
113 echo " !!!!! Bad Job termination status !!!!! " >>test.out
115 echo " !!!!! Restored files differ !!!!! "
116 echo " !!!!! Restored files differ !!!!! " >>test.out
120 echo " ===== bscan-test Bacula source OK `date +%R:%S` ===== "
121 echo " ===== bscan-test OK `date +%R:%S` ===== " >>test.out