]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/fixed-block-size-tape
- Take Dan's fix to the fix_postgresql_tables (thanks Dan)
[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 echo "${cwd}/build" >/tmp/file-list
11
12 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
13 echo "s%# Maximum Block Size%  Maximum Block Size%" >${cwd}/tmp/2
14 echo "s%# Minimum Block Size%  Minimum Block Size%" >>${cwd}/tmp/2
15 sed -f ${cwd}/tmp/2 ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
16 if [ $? != 0 ] ; then
17    echo " "
18    echo " "
19    echo "!!!! sed problem in Fixed Block Size test !!!!!"
20    echo " "
21    exit 1
22 fi
23 rm -f ${cwd}/tmp/1 ${cwd}/tmp/2
24
25 echo " "
26 echo " "
27 echo " === Starting Fixed Block Size test ==="
28 echo " === Starting Fixed Block Size test ===" >>working/log
29 echo " "
30
31 bin/bacula start 2>&1 >/dev/null
32 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
33 @output /dev/null
34 messages
35 @output tmp/log1.out
36 label storage=DDS-4 volume=TestVolume001 slot=0
37 run job=NightlySave yes
38 wait
39 messages
40 @# 
41 @# now do a restore
42 @#
43 @output tmp/log2.out
44 restore where=${cwd}/tmp/bacula-restores select storage=DDS-4
45 unmark *
46 mark *
47 done
48 yes
49 wait
50 messages
51 @output
52 quit
53 END_OF_DATA
54 scripts/check_for_zombie_jobs storage=DDS-4
55
56 bin/bacula stop 2>&1 >/dev/null
57 grep "\0Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
58 bstat=$?
59 grep "\0Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
60 rstat=$?
61 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
62 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
63    echo " "
64    echo " "
65    echo "  !!!!! Fixed Block Size test Bacula source failed!!! !!!!! "
66    echo "  !!!!! Fixed Block Size test failed!!! !!!!! " >>test.out
67    echo " "
68 else
69    echo "  ===== Fixed Block Size test Bacula source OK ===== "
70    echo "  ===== Fixed Block Size test OK ===== " >>test.out
71 #  scripts/cleanup
72 fi