3 # Run a simple backup of the Bacula build directory
4 # to two tapes where the maximum tape file size is set to 1M
5 # Note, this test simulates the tape filling and writing to
9 if test x${AUTOCHANGER} = x/dev/null ; then
10 echo "two-volume-tape test skipped. No autochanger."
14 if test "$debug" -eq 1 ; then
21 scripts/copy-2tape-confs
22 scripts/prepare-two-tapes
24 echo "${cwd}/build" >/tmp/file-list
27 echo "s%# Maximum File Size% Maximum File Size%g" >${outf}
28 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
29 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
33 echo " === Starting Two Volume Tape test at `date +%R:%S` ==="
34 echo " === Starting Two Volume Tape test at `date +%R:%S` ===" >>working/log
36 # Write out bconsole commands
37 cat <<END_OF_DATA >tmp/bconcmds
41 label storage=DDS-4 volume=TestVolume001 slot=1 pool=Default drive=0
42 label storage=DDS-4 volume=TestVolume002 slot=2 pool=Default drive=0
43 update Volume=TestVolume001 MaxVolBytes=3000000 pool=Default drive=0
44 @#setdebug level=1000 client
45 run job=NightlySave yes
52 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
60 if test "$debug" -eq 1 ; then
62 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
64 bin/bacula start 2>&1 >/dev/null
65 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
67 scripts/check_for_zombie_jobs storage=DDS-4
69 bin/bacula stop 2>&1 >/dev/null
70 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
72 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
74 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
75 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
78 echo " !!!!! Two Volume Tape test Bacula source failed!!! !!!!! "
79 echo " !!!!! Two Volume Tape test failed!!! !!!!! " >>test.out
82 echo " ===== Two Volume Tape test Bacula source OK ===== "
83 echo " ===== Two Volume Tape test OK ===== " >>test.out