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