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 scripts/copy-test-confs
12 echo "${cwd}/build" >/tmp/file-list
16 echo " === Starting bsr-opt-test at `date +%R:%S` ==="
17 echo " === Starting bsr-opt-test at `date +%R:%S` ===" >working/log
20 bin/bacula start 2>&1 >/dev/null
21 #bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
22 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
26 label storage=File1 volume=TestVolume001
27 label storage=File1 volume=TestVolume002
28 update Volume=TestVolume001 MaxVolBytes=3000000
29 run job=NightlySave storage=File1 yes
36 restore bootstrap=${cwd}/working/restore.bsr where=${cwd}/tmp/bacula-restores select storage=File1
38 cd ${cwd}/build/src/cats
48 scripts/check_for_zombie_jobs storage=File1
49 bin/bacula stop 2>&1 >/dev/null
51 # This test is not really reliable. What we want to do is
52 # to select files on only one Volume, then insure here
53 # that only one Volume is chosen.
55 grep TestVolume002 working/restore.bsr 2>&1 >/dev/null
57 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
59 grep "^ Termination: *Restore OK" tmp/log2.out 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 ===== "
80 echo " ===== bsr-opt-test OK ===== " >>test.out