3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a simple backup of the Bacula build directory but
9 # split the archive into two volumes, then restore
10 # files on only one of the volumes and ensure that
11 # the other volume is not used. I.e. bsr optimization
14 TestName="bsr-opt-test"
19 scripts/copy-test-confs
20 echo "${cwd}/build" >${cwd}/tmp/file-list
22 change_jobname NightlySave $JobName
26 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
29 @$out ${cwd}/tmp/log1.out
30 label storage=File1 volume=TestVolume001
31 label storage=File1 volume=TestVolume002
32 update Volume=TestVolume001 MaxVolBytes=$MaxVolBytes
33 run job=$JobName storage=File1 yes
39 @$out ${cwd}/tmp/log2.out
40 setdebug level=150 storage=File1 trace=1
41 restore bootstrap=${cwd}/working/restore.bsr where=${cwd}/tmp/bacula-restores select storage=File1
43 cd ${cwd}/build/src/cats
54 check_for_zombie_jobs storage=File1
57 # This test is not really reliable. What we want to do is
58 # to select files on only one Volume, then insure here
59 # that only one Volume is chosen.
61 grep TestVolume002 working/restore.bsr 2>&1 >/dev/null
65 diff -r build/src/cats ${cwd}/tmp/bacula-restores${cwd}/build/src/cats 2>&1 >/dev/null
66 if [ $? != 0 -o $bsrstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
69 echo " !!!!! bsr-opt-test Bacula source failed!!! !!!!! "
70 echo " !!!!! bsr-opt-test failed!!! !!!!! " >>test.out
71 if [ $bstat != 0 -o $rstat != 0 ] ; then
72 echo " !!!!! Bad Job termination status !!!!! "
73 echo " !!!!! Bad Job termination status !!!!! " >>test.out
74 elif [ $bsrstat != 0 ] ; then
75 echo " !!!!! Volume selection error !!!!! "
76 echo " !!!!! Volume selection error !!!!! " >>test.out
78 echo " !!!!! Restored files differ !!!!! "
79 echo " !!!!! Restored files differ !!!!! " >>test.out
84 echo " ===== bsr-opt-test Bacula source OK `date +%R:%S` ===== "
85 echo " ===== bsr-opt-test OK `date +%R:%S` ===== " >>test.out