]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/fixed-block-size-tape
Add new 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 bin/bacula stop  2>&1 >/dev/null
9 scripts/copy-tape-confs
10 scripts/cleanup-tape
11 echo "${cwd}/build" >/tmp/file-list
12 cd bin
13 ./drop_bacula_tables >/dev/null 2>&1
14 ./make_bacula_tables >/dev/null 2>&1
15 ./grant_bacula_privileges 2>&1 >/dev/null
16 cd ..
17 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
18 echo "s%# Maximum Block Size%  Maximum Block Size%" >${cwd}/tmp/2
19 echo "s%# Minimum Block Size%  Minimum Block Size%" >>${cwd}/tmp/2
20 sed -f ${cwd}/tmp/2 ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
21 rm -f ${cwd}/tmp/1 ${cwd}/tmp/2
22
23 echo " "
24 echo " "
25 echo " === Starting Fixed Block Size test ==="
26 echo " === Starting Fixed Block Size test ===" >>working/log
27 echo " "
28
29 bin/bacula start 2>&1 >/dev/null
30 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
31 @output /dev/null
32 messages
33 @output tmp/log1.out
34 label storage=DDS-4 volume=TestVolume001 slot=0
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 storage=DDS-4
43 unmark *
44 mark *
45 done
46 yes
47 wait
48 messages
49 @output
50 quit
51 END_OF_DATA
52 scripts/check_for_zombie_jobs storage=DDS-4
53 bin/bacula stop 2>&1 >/dev/null
54 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
55 bstat=$?
56 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
57 rstat=$?
58 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
59 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
60    echo " "
61    echo " "
62    echo "  !!!!! Fixed Block Size test Bacula source failed!!! !!!!! "
63    echo "  !!!!! Fixed Block Size test failed!!! !!!!! " >>test.out
64    echo " "
65 else
66    echo "  ===== Fixed Block Size test Bacula source OK ===== "
67    echo "  ===== Fixed Block Size test OK ===== " >>test.out
68 #  scripts/cleanup
69 fi