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
14 bin/drop_sqlite_tables
15 bin/make_sqlite_tables
19 echo " === Starting bsr-opt-test ==="
20 echo " === Starting bsr-opt-test ===" >working/log
23 bin/bacula start 2>&1 >/dev/null
24 bin/console -c bin/console.conf <<END_OF_DATA
32 update Volume=TestVolume001
36 run job=NightlySave storage=File1
44 restore where=${cwd}/tmp/bacula-restores current
46 cd ${cwd}/build/src/cats
56 bin/bacula stop 2>&1 >/dev/null
57 grep TestVolume001 working/restore.bsr
59 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
61 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
63 diff -r build/src/cats tmp/bacula-restores${cwd}/build/src/cats
64 if [ $? != 0 -o $bsrstat != 1 -o $bstat != 0 -o $rstat != 0 ] ; then
67 echo " !!!!! bsr-opt-test Bacula source failed!!! !!!!! "
68 echo " !!!!! bsr-opt-test failed!!! !!!!! " >>test.out
71 echo " ===== bsr-opt-test Bacula source OK ===== "
72 echo " ===== bsr-opt-test OK ===== " >>test.out