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
9 # We set TestVolume001 to not in the changer, so the algorithm
10 # should find TestVolume002 and use it rather than blocking.
12 # Note we use the viritual disk autochanger
16 if test x${AUTOCHANGER} = x/dev/null ; then
17 echo "two-volume-test skipped. No autochanger."
20 if test "$debug" -eq 1 ; then
27 scripts/copy-2disk-confs
28 scripts/prepare-two-disks
30 echo "${cwd}/build" >/tmp/file-list
33 echo "s%# Maximum File Size% Maximum File Size%g" >${outf}
34 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
35 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
39 echo " === Starting Scratch Pool Test at `date +%R:%S` ==="
40 echo " === Starting Scratch Pool Test at `date +%R:%S` ===" >>working/log
42 # Write out bconsole commands
43 cat <<END_OF_DATA >tmp/bconcmds
47 label storage=DDS-4 volume=TestVolume001 slot=1 pool=Scratch drive=0
48 label storage=DDS-4 volume=TestVolume002 slot=2 pool=Scratch drive=0
49 update Volume=TestVolume001 MaxVolBytes=2000000 pool=Scratch drive=0
50 update Volume=TestVolume001 inchanger=no pool=Scratch drive=0
51 @#setdebug level=200 storage=DDS-4
52 llist volume=TestVolume001
53 llist volume=TestVolume002
54 run job=NightlySave yes
58 llist volume=TestVolume001
63 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
71 if test "$debug" -eq 1 ; then
73 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
75 bin/bacula start 2>&1 >/dev/null
76 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
78 scripts/check_for_zombie_jobs storage=DDS-4
80 bin/bacula stop 2>&1 >/dev/null
81 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
83 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
85 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
86 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
89 echo " !!!!! Scratch Pool Test Bacula source failed!!! !!!!! "
90 echo " !!!!! Scratch Pool Test failed!!! !!!!! " >>test.out
93 echo " ===== Scratch Pool Test Bacula source OK `date +%R:%S` ===== "
94 echo " ===== Scratch Pool Test OK `date +%R:%S` ===== " >>test.out