#!/bin/sh # # Run a simple backup of the Bacula build directory but # split the archive into two volumes, then restore # files on only one of the volumes and ensure that # the other volume is not used. I.e. bsr optimization # works. # cwd=`pwd` scripts/copy-test-confs scripts/cleanup echo "${cwd}/build" >/tmp/file-list echo " " echo " " echo " === Starting bsr-opt-test ===" echo " === Starting bsr-opt-test ===" >working/log echo " " bin/bacula start 2>&1 >/dev/null bin/bconsole -c bin/bconsole.conf <&1 >/dev/null # # This test is not really reliable. What we want to do is # to select files on only one Volume, then insure here # that only one Volume is chosen. # grep TestVolume002 working/restore.bsr 2>&1 >/dev/null bsrstat=$? grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null bstat=$? grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null rstat=$? diff -r build/src/cats tmp/bacula-restores${cwd}/build/src/cats 2>&1 >/dev/null if [ $? != 0 -o $bsrstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then echo " " echo " " echo " !!!!! bsr-opt-test Bacula source failed!!! !!!!! " echo " !!!!! bsr-opt-test failed!!! !!!!! " >>test.out echo " " else echo " ===== bsr-opt-test Bacula source OK ===== " echo " ===== bsr-opt-test OK ===== " >>test.out scripts/cleanup fi