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