]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-volume-tape
a9bedc5a74ec8ede9135e249aff06b1ee87d0f8f
[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 debug=0
9 if test "$debug" -eq 1 ; then
10   out="tee"
11 else
12   out="output"
13 fi
14 cwd=`pwd`
15 scripts/cleanup
16 scripts/copy-2tape-confs
17 scripts/prepare-two-tapes
18  
19 echo "${cwd}/build" >/tmp/file-list
20
21 outf="tmp/sed_tmp"
22 echo "s%# Maximum File Size%  Maximum File Size%g" >${outf}
23 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
24 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
25
26 echo " "
27 echo " "
28 echo " === Starting Two Volume Tape test at `date +%R:%S` ==="
29 echo " === Starting Two Volume Tape test at `date +%R:%S` ===" >>working/log
30 echo " "
31 # Write out bconsole commands
32 cat <<END_OF_DATA >tmp/bconcmds
33 @$out /dev/null
34 messages
35 @$out tmp/log1.out
36 label storage=DDS-4 volume=TestVolume001 slot=1 pool=Default
37 label storage=DDS-4 volume=TestVolume002 slot=2 pool=Default
38 update Volume=TestVolume001 MaxVolBytes=3000000 pool=Default
39 run job=NightlySave yes
40 wait
41 messages
42 @# 
43 @# now do a restore
44 @#
45 @$out tmp/log2.out
46 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
47 yes
48 wait
49 messages
50 @$out
51 quit
52 END_OF_DATA
53
54 if test "$debug" -eq 1 ; then
55   bin/bacula start
56   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
57 else
58   bin/bacula start 2>&1 >/dev/null
59   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
60 fi
61 scripts/check_for_zombie_jobs storage=DDS-4
62
63 bin/bacula stop 2>&1 >/dev/null
64 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
65 bstat=$?
66 grep "^  Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
67 rstat=$?
68 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
69 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
70    echo " "
71    echo " "
72    echo "  !!!!! Two Volume Tape test Bacula source failed!!! !!!!! "
73    echo "  !!!!! Two Volume Tape test failed!!! !!!!! " >>test.out
74    echo " "
75 else
76    echo "  ===== Two Volume Tape test Bacula source OK ===== "
77    echo "  ===== Two Volume Tape test OK ===== " >>test.out
78 #  scripts/cleanup
79 fi