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
54 if test "$debug" -eq 1 ; then
56 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
58 bin/bacula start 2>&1 >/dev/null
59 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
62 scripts/check_for_zombie_jobs storage=File1
63 bin/bacula stop 2>&1 >/dev/null
64 echo "volume=TestVolume001|TestVolume002" >tmp/bscan.bsr
65 bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >/dev/null
66 #bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp
67 bin/bacula start 2>&1 >/dev/null
68 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
69 #bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
76 restore bootstrap=${cwd}/tmp/kern.bsr where=${cwd}/tmp/bacula-restores select all storage=File1 done
83 scripts/check_for_zombie_jobs storage=File1
84 bin/bacula stop 2>&1 >/dev/null
85 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
87 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
89 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
90 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
93 echo " !!!!! bscan-test Bacula source failed!!! !!!!! "
94 echo " !!!!! bscan-test failed!!! !!!!! " >>test.out
95 if [ $bstat != 0 -o $rstat != 0 ] ; then
96 echo " !!!!! Bad Job termination status !!!!! "
97 echo " !!!!! Bad Job termination status !!!!! " >>test.out
99 echo " !!!!! Restored files differ !!!!! "
100 echo " !!!!! Restored files differ !!!!! " >>test.out
104 echo " ===== bscan-test Bacula source OK ===== "
105 echo " ===== bscan-test OK ===== " >>test.out