]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-volume-tape
Final changes
[bacula/bacula] / regress / tests / two-volume-tape
1 #!/bin/sh
2 #
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.
7 #
8 . config.out
9 if test x${AUTOCHANGER} = x/dev/null ; then
10    echo "two-volume-tape test skipped. No autochanger."
11    exit
12 fi
13 debug=0
14 if test "$debug" -eq 1 ; then
15   out="tee"
16 else
17   out="output"
18 fi
19 cwd=`pwd`
20 scripts/cleanup
21 scripts/copy-2tape-confs
22 scripts/prepare-two-tapes
23  
24 echo "${cwd}/build" >/tmp/file-list
25
26 outf="tmp/sed_tmp"
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
30
31 echo " "
32 echo " "
33 echo " === Starting Two Volume Tape test at `date +%R:%S` ==="
34 echo " === Starting Two Volume Tape test at `date +%R:%S` ===" >>working/log
35 echo " "
36 # Write out bconsole commands
37 cat <<END_OF_DATA >tmp/bconcmds
38 @$out /dev/null
39 messages
40 @$out tmp/log1.out
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
46 wait
47 messages
48 @# 
49 @# now do a restore
50 @#
51 @$out tmp/log2.out
52 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
53 yes
54 wait
55 messages
56 @$out
57 quit
58 END_OF_DATA
59
60 if test "$debug" -eq 1 ; then
61   bin/bacula start
62   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
63 else
64   bin/bacula start 2>&1 >/dev/null
65   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
66 fi
67 scripts/check_for_zombie_jobs storage=DDS-4
68
69 bin/bacula stop 2>&1 >/dev/null
70 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
71 bstat=$?
72 grep "^  Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
73 rstat=$?
74 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
75 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
76    echo " "
77    echo " "
78    echo "  !!!!! Two Volume Tape test Bacula source failed!!! !!!!! "
79    echo "  !!!!! Two Volume Tape test failed!!! !!!!! " >>test.out
80    echo " "
81 else
82    echo "  ===== Two Volume Tape test Bacula source OK ===== "
83    echo "  ===== Two Volume Tape test OK ===== " >>test.out
84 #  scripts/cleanup
85 fi