]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/eot-fail-tape
Updates
[bacula/bacula] / regress / tests / eot-fail-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 scripts/copy-tape-confs
8 scripts/cleanup-tape
9  
10 echo "${cwd}/build" >/tmp/file-list
11
12 out="tmp/sed_tmp"
13 echo "s%# Maximum File Size%  Maximum File Size%g" >${out}
14 cp -f ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
15 sed -f ${out} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
16
17 echo " "
18 echo " "
19 echo " === Starting eot-fail-tape test at `date +%R:%S` ==="
20 echo " === Starting eot-fail-tape test at `date +%R:%S` ===" >>working/log
21 echo " "
22
23 bin/bacula start -d100
24 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
25 @tee /dev/null
26 messages
27 @tee tmp/log1.out
28 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
29 update Volume=TestVolume001 MaxVolBytes=3000000
30 run job=NightlySave yes
31 wait
32 messages
33 @# 
34 @# now do a restore
35 @#
36 @tee tmp/log2.out
37 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
38 yes
39 wait
40 messages
41 @tee
42 quit
43 END_OF_DATA
44 scripts/check_for_zombie_jobs storage=DDS-4
45
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 "  !!!!! eot-fail-tape test Bacula source failed!!! !!!!! "
56    echo "  !!!!! eot-fail-tape test failed!!! !!!!! " >>test.out
57    echo " "
58 else
59    echo "  ===== eot-fail-tape test Bacula source OK ===== "
60    echo "  ===== eot-fail-tape test OK ===== " >>test.out
61 #  scripts/cleanup
62 fi