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
10 if test "$debug" -eq 1 ; then
17 scripts/copy-test-confs
19 echo "${cwd}/build" >/tmp/file-list
23 echo " === Starting bsr-opt-test at `date +%R:%S` ==="
24 echo " === Starting bsr-opt-test at `date +%R:%S` ===" >working/log
27 cat <<END_OF_DATA >tmp/bconcmds
31 label storage=File1 volume=TestVolume001
32 label storage=File1 volume=TestVolume002
33 update Volume=TestVolume001 MaxVolBytes=3000000
34 run job=NightlySave storage=File1 yes
41 restore bootstrap=${cwd}/working/restore.bsr where=${cwd}/tmp/bacula-restores select storage=File1
43 cd ${cwd}/build/src/cats
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
65 # This test is not really reliable. What we want to do is
66 # to select files on only one Volume, then insure here
67 # that only one Volume is chosen.
69 grep TestVolume002 working/restore.bsr 2>&1 >/dev/null
71 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
73 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
75 diff -r build/src/cats tmp/bacula-restores${cwd}/build/src/cats 2>&1 >/dev/null
76 if [ $? != 0 -o $bsrstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
79 echo " !!!!! bsr-opt-test Bacula source failed!!! !!!!! "
80 echo " !!!!! bsr-opt-test failed!!! !!!!! " >>test.out
81 if [ $bstat != 0 -o $rstat != 0 ] ; then
82 echo " !!!!! Bad Job termination status !!!!! "
83 echo " !!!!! Bad Job termination status !!!!! " >>test.out
84 elif [ $bsrstat != 0 ] ; then
85 echo " !!!!! Volume selection error !!!!! "
86 echo " !!!!! Volume selection error !!!!! " >>test.out
88 echo " !!!!! Restored files differ !!!!! "
89 echo " !!!!! Restored files differ !!!!! " >>test.out
93 echo " ===== bsr-opt-test Bacula source OK ===== "
94 echo " ===== bsr-opt-test OK ===== " >>test.out