3 # Run a simple backup of the Bacula build directory but
4 # split the archive into two volumes, then restore
5 # files on only one of the volumes and ensure that
6 # the other volume is not used. I.e. bsr optimization
9 TestName="bsr-opt-test"
14 scripts/copy-test-confs
16 echo "${cwd}/build" >/tmp/file-list
18 change_jobname NightlySave $JobName
21 cat <<END_OF_DATA >tmp/bconcmds
25 label storage=File1 volume=TestVolume001
26 label storage=File1 volume=TestVolume002
27 update Volume=TestVolume001 MaxVolBytes=3000000
28 run job=$JobName storage=File1 yes
35 restore bootstrap=${cwd}/working/restore.bsr where=${cwd}/tmp/bacula-restores select storage=File1
37 cd ${cwd}/build/src/cats
49 check_for_zombie_jobs storage=File1
52 # This test is not really reliable. What we want to do is
53 # to select files on only one Volume, then insure here
54 # that only one Volume is chosen.
56 grep TestVolume002 working/restore.bsr 2>&1 >/dev/null
60 diff -r build/src/cats tmp/bacula-restores${cwd}/build/src/cats 2>&1 >/dev/null
61 if [ $? != 0 -o $bsrstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
64 echo " !!!!! bsr-opt-test Bacula source failed!!! !!!!! "
65 echo " !!!!! bsr-opt-test failed!!! !!!!! " >>test.out
66 if [ $bstat != 0 -o $rstat != 0 ] ; then
67 echo " !!!!! Bad Job termination status !!!!! "
68 echo " !!!!! Bad Job termination status !!!!! " >>test.out
69 elif [ $bsrstat != 0 ] ; then
70 echo " !!!!! Volume selection error !!!!! "
71 echo " !!!!! Volume selection error !!!!! " >>test.out
73 echo " !!!!! Restored files differ !!!!! "
74 echo " !!!!! Restored files differ !!!!! " >>test.out
78 echo " ===== bsr-opt-test Bacula source OK `date +%R:%S` ===== "
79 echo " ===== bsr-opt-test OK `date +%R:%S` ===== " >>test.out