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
28 label storage=File1 volume=TestVolume001
29 label storage=File1 volume=TestVolume002
30 update Volume=TestVolume001 MaxVolBytes=3000000
31 run job=NightlySave storage=File1 yes
38 restore where=${cwd}/tmp/bacula-restores current
40 cd ${cwd}/build/src/cats
50 bin/bacula stop 2>&1 >/dev/null
51 grep TestVolume001 working/restore.bsr
53 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
55 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
57 diff -r build/src/cats tmp/bacula-restores${cwd}/build/src/cats
58 if [ $? != 0 -o $bsrstat != 1 -o $bstat != 0 -o $rstat != 0 ] ; then
61 echo " !!!!! bsr-opt-test Bacula source failed!!! !!!!! "
62 echo " !!!!! bsr-opt-test failed!!! !!!!! " >>test.out
65 echo " ===== bsr-opt-test Bacula source OK ===== "
66 echo " ===== bsr-opt-test OK ===== " >>test.out