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"
15 scripts/copy-test-confs
17 echo "${cwd}/build" >/tmp/file-list
18 change_jobname $JobName
22 cat <<END_OF_DATA >tmp/bconcmds
26 label storage=File1 volume=TestVolume001
27 label storage=File1 volume=TestVolume002
28 update Volume=TestVolume001 MaxVolBytes=3000000
29 run job=$JobName storage=File1 yes
36 restore bootstrap=${cwd}/working/restore.bsr where=${cwd}/tmp/bacula-restores select storage=File1
38 cd ${cwd}/build/src/cats
50 check_for_zombie_jobs storage=File1
53 # This test is not really reliable. What we want to do is
54 # to select files on only one Volume, then insure here
55 # that only one Volume is chosen.
57 grep TestVolume002 working/restore.bsr 2>&1 >/dev/null
61 diff -r build/src/cats tmp/bacula-restores${cwd}/build/src/cats 2>&1 >/dev/null
62 if [ $? != 0 -o $bsrstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
65 echo " !!!!! bsr-opt-test Bacula source failed!!! !!!!! "
66 echo " !!!!! bsr-opt-test failed!!! !!!!! " >>test.out
67 if [ $bstat != 0 -o $rstat != 0 ] ; then
68 echo " !!!!! Bad Job termination status !!!!! "
69 echo " !!!!! Bad Job termination status !!!!! " >>test.out
70 elif [ $bsrstat != 0 ] ; then
71 echo " !!!!! Volume selection error !!!!! "
72 echo " !!!!! Volume selection error !!!!! " >>test.out
74 echo " !!!!! Restored files differ !!!!! "
75 echo " !!!!! Restored files differ !!!!! " >>test.out
79 echo " ===== bsr-opt-test Bacula source OK `date +%R:%S` ===== "
80 echo " ===== bsr-opt-test OK `date +%R:%S` ===== " >>test.out