]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/fixed-block-size-tape
Update and add tests
[bacula/bacula] / regress / tests / fixed-block-size-tape
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory 
4 #   to a tape where we set the minimum and maximum block
5 #   sizes.
6 #
7 cwd=`pwd`
8 scripts/copy-tape-confs
9 scripts/cleanup-tape
10
11 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
12 echo "s%# Maximum Block Size%  Maximum Block Size%" >${cwd}/tmp/2
13 echo "s%# Minimum Block Size%  Minimum Block Size%" >>${cwd}/tmp/2
14 sed -f ${cwd}/tmp/2 ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
15 rm -f ${cwd}/tmp/1 ${cwd}/tmp/2
16
17 echo " "
18 echo " "
19 echo " === Starting Fixed Block Size test ==="
20 echo " === Starting Fixed Block Size test ===" >>working/log
21 echo " "
22
23 bin/bacula start 2>&1 >/dev/null
24 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
25 @output /dev/null
26 messages
27 @output tmp/log1.out
28 label storage=DDS-4 volume=TestVolume001 slot=0
29 run job=NightlySave yes
30 wait
31 messages
32 @# 
33 @# now do a restore
34 @#
35 @output tmp/log2.out
36 restore where=${cwd}/tmp/bacula-restores select storage=DDS-4
37 unmark *
38 mark *
39 done
40 yes
41 wait
42 messages
43 @output
44 quit
45 END_OF_DATA
46 scripts/check_for_zombie_jobs storage=DDS-4
47 bin/bacula stop 2>&1 >/dev/null
48 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
49 bstat=$?
50 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
51 rstat=$?
52 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
53 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
54    echo " "
55    echo " "
56    echo "  !!!!! Fixed Block Size test Bacula source failed!!! !!!!! "
57    echo "  !!!!! Fixed Block Size test failed!!! !!!!! " >>test.out
58    echo " "
59 else
60    echo "  ===== Fixed Block Size test Bacula source OK ===== "
61    echo "  ===== Fixed Block Size test OK ===== " >>test.out
62 #  scripts/cleanup
63 fi