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.
9 scripts/copy-test-confs
11 echo "${cwd}/build" >/tmp/file-list
15 echo " === Starting bscan-test `date +%R:%S` ==="
16 echo " === Starting bscan-test `date +%R:%S` ===" >working/log
19 bin/bacula start 2>&1 >/dev/null
20 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
28 update Volume=TestVolume001 MaxVolBytes=3000000
29 run job=NightlySave storage=File1
35 @# now purge the Volume
37 purge volume=TestVolume001
38 purge volume=TestVolume002
39 delete volume=TestVolume001
41 delete volume=TestVolume002
46 scripts/check_for_zombie_jobs storage=File1
47 bin/bacula stop 2>&1 >/dev/null
48 echo "volume=TestVolume001|TestVolume002" >tmp/bscan.bsr
49 bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >/dev/null
50 bin/bacula start 2>&1 >/dev/null
51 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
58 restore where=${cwd}/tmp/bacula-restores select all storage=File1 done
65 scripts/check_for_zombie_jobs storage=File1
66 bin/bacula stop 2>&1 >/dev/null
67 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
69 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
71 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
72 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
75 echo " !!!!! bscan-test Bacula source failed!!! !!!!! "
76 echo " !!!!! bscan-test failed!!! !!!!! " >>test.out
77 if [ $bstat != 0 -o $rstat != 0 ] ; then
78 echo " !!!!! Bad Job termination status !!!!! "
79 echo " !!!!! Bad Job termination status !!!!! " >>test.out
81 echo " !!!!! Restored files differ !!!!! "
82 echo " !!!!! Restored files differ !!!!! " >>test.out
86 echo " ===== bscan-test Bacula source OK ===== "
87 echo " ===== bscan-test OK ===== " >>test.out