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