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
61 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
69 if test "$debug" -eq 1 ; then
71 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
73 bin/bacula start 2>&1 >/dev/null
74 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
77 scripts/check_for_zombie_jobs storage=DDS-4
79 bin/bacula stop 2>&1 >/dev/null
80 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
82 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
84 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
85 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
88 echo " !!!!! Scratch Pool Test Bacula source failed!!! !!!!! "
89 echo " !!!!! Scratch Pool Test failed!!! !!!!! " >>test.out
92 echo " ===== Scratch Pool Test Bacula source OK ===== "
93 echo " ===== Scratch Pool Test OK ===== " >>test.out