]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/verify-vol-test
Update scripts
[bacula/bacula] / regress / tests / verify-vol-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory
4 #   then verify the catalog.           
5 #
6 cwd=`pwd`
7 scripts/copy-test-confs
8 scripts/cleanup
9 echo "${cwd}/build" >/tmp/file-list
10
11 echo " "
12 echo " "
13 echo " === Starting verify Volume Test `date +%R:%S` ==="
14 echo " === Starting verify Volume Test `date +%R:%S` ===" >>working/log
15 echo " "
16
17 bin/bacula start 2>&1 >/dev/null
18 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
19 @output /dev/null
20 messages
21 @output tmp/log1.out
22 setdebug level=1 storage=File sd
23 label storage=File volume=TestVolume001
24 run job=NightlySave yes
25 wait
26 messages
27 @# 
28 @# now do a verify volume
29 @#
30 @output ${cwd}/tmp/original
31 run job=VerifyVolume
32 yes
33 wait
34 messages
35 @output
36 quit
37 END_OF_DATA
38 sleep 2
39 scripts/check_for_zombie_jobs storage=File 
40 bin/bacula stop 2>&1 >/dev/null
41 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
42 bstat=$?
43 grep "^  Termination: *Verify OK" ${cwd}/tmp/original 2>&1 >/dev/null
44 if [ $? != 0 -o $bstat != 0 ] ; then
45    echo " "
46    echo " "
47    echo "  !!!!! Verify Volume failed!!! !!!!! "
48    echo "  !!!!! Verify Volume failed!!! !!!!! " >>test.out
49    if [ $bstat != 0 ] ; then
50       echo "  !!!!! Bad Job termination status     !!!!! "
51       echo "  !!!!! Bad Job termination status     !!!!! " >>test.out
52    else
53       echo "  !!!!! Restored files differ          !!!!! "
54       echo "  !!!!! Restored files differ          !!!!! " >>test.out
55    fi
56    echo " "
57 else
58    echo "  ===== Verify Volume Test OK ===== "
59    echo "  ===== Verify Volume Test OK ===== " >>test.out
60    scripts/cleanup
61 fi