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