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
8 # Note we used the viritual disk autochanger
11 if test x${AUTOCHANGER} = x/dev/null ; then
12 echo "two-volume-test skipped. No autochanger."
16 if test "$debug" -eq 1 ; then
23 scripts/copy-2disk-confs
24 scripts/prepare-two-disks
26 echo "${cwd}/build" >/tmp/file-list
29 echo "s%# Maximum File Size% Maximum File Size%g" >${outf}
30 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
31 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
35 echo " === Starting Two Volume Test at `date +%R:%S` ==="
36 echo " === Starting Two Volume Test at `date +%R:%S` ===" >>working/log
38 # Write out bconsole commands
39 cat <<END_OF_DATA >tmp/bconcmds
43 label storage=DDS-4 volume=TestVolume001 slot=1 pool=Default drive=0
44 label storage=DDS-4 volume=TestVolume002 slot=2 pool=Default drive=0
45 update Volume=TestVolume001 MaxVolBytes=3000000 pool=Default drive=0
46 @#setdebug level=1000 client
47 run job=NightlySave yes
54 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
62 if test "$debug" -eq 1 ; then
64 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
66 bin/bacula start 2>&1 >/dev/null
67 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
69 scripts/check_for_zombie_jobs storage=DDS-4
71 bin/bacula stop 2>&1 >/dev/null
72 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
74 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
76 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
77 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
80 echo " !!!!! Two Volume Test Bacula source failed!!! !!!!! "
81 echo " !!!!! Two Volume Test failed!!! !!!!! " >>test.out
84 echo " ===== Two Volume Test Bacula source OK ===== "
85 echo " ===== Two Volume Test OK ===== " >>test.out