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
13 bin/bacula stop 2>&1 >/dev/null
15 ./drop_bacula_tables >/dev/null 2>&1
16 ./make_bacula_tables >/dev/null 2>&1
17 ./grant_bacula_privileges 2>&1 >/dev/null
22 echo " === Starting bsr-opt-test ==="
23 echo " === Starting bsr-opt-test ===" >working/log
26 bin/bacula start 2>&1 >/dev/null
27 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
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 where=${cwd}/tmp/bacula-restores select
43 cd ${cwd}/build/src/cats
53 bin/bacula stop 2>&1 >/dev/null
55 # This test is not really reliable. What we want to do is
56 # to select files on only one Volume, then insure here
57 # that only one Volume is chosen.
59 grep TestVolume002 working/restore.bsr 2>&1 >/dev/null
61 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
63 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
65 diff -r build/src/cats 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
73 echo " ===== bsr-opt-test Bacula source OK ===== "
74 echo " ===== bsr-opt-test OK ===== " >>test.out