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
6 # the next tape. One minor wrinkle: we create the two tapes
7 # in the Scratch pool, so they should be switched to the Default
10 # Note we use the viritual disk autochanger
14 if test x${AUTOCHANGER} = x/dev/null ; then
15 echo "two-volume-test skipped. No autochanger."
18 if test "$debug" -eq 1 ; then
25 scripts/copy-2disk-confs
26 scripts/prepare-two-disks
28 echo "${cwd}/build" >/tmp/file-list
31 echo "s%# Maximum File Size% Maximum File Size%g" >${outf}
32 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
33 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
37 echo " === Starting Scratch Pool Test at `date +%R:%S` ==="
38 echo " === Starting Scratch Pool Test at `date +%R:%S` ===" >>working/log
40 # Write out bconsole commands
41 cat <<END_OF_DATA >tmp/bconcmds
45 label storage=DDS-4 volume=TestVolume001 slot=1 pool=Scratch drive=0
46 label storage=DDS-4 volume=TestVolume002 slot=2 pool=Scratch drive=0
47 update Volume=TestVolume001 MaxVolBytes=3000000 pool=Scratch drive=0
48 update Volume=TestVolume001 inchanger=no pool=Scratch drive=0
49 @#setdebug level=200 storage=DDS-4
50 llist volume=TestVolume001
51 run job=NightlySave yes
55 llist volume=TestVolume001
60 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
68 if test "$debug" -eq 1 ; then
70 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
72 bin/bacula start 2>&1 >/dev/null
73 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
75 scripts/check_for_zombie_jobs storage=DDS-4
77 bin/bacula stop 2>&1 >/dev/null
78 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
80 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
82 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
83 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
86 echo " !!!!! Scratch Pool Test Bacula source failed!!! !!!!! "
87 echo " !!!!! Scratch Pool Test failed!!! !!!!! " >>test.out
90 echo " ===== Scratch Pool Test Bacula source OK ===== "
91 echo " ===== Scratch Pool Test OK ===== " >>test.out