]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/verify-vol-test
Update smtp to bsmtp and console to bconsole
[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 bin/bacula stop 2>&1 >/dev/null
11 bin/drop_sqlite_tables
12 bin/make_sqlite_tables
13
14 echo " "
15 echo " "
16 echo " === Starting verify Volume Test ==="
17 echo " === Starting verify Volume Test ===" >>working/log
18 echo " "
19
20 bin/bacula start 2>&1 >/dev/null
21 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
22 @output /dev/null
23 messages
24 @output tmp/log1.out
25 label storage=File volume=TestVolume001
26 run job=NightlySave yes
27 wait
28 messages
29 @# 
30 @# now do a verify volume
31 @#
32 @output ${cwd}/tmp/original
33 run job=VerifyVolume
34 yes
35 wait
36 messages
37 @output
38 quit
39 END_OF_DATA
40 sleep 2
41 bin/bacula stop 2>&1 >/dev/null
42 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
43 bstat=$?
44 grep "^Termination: *Verify OK" ${cwd}/tmp/original 2>&1 >/dev/null
45 if [ $? != 0 -o $bstat != 0 ] ; then
46    echo " "
47    echo " "
48    echo "  !!!!! Verify Volume failed!!! !!!!! "
49    echo "  !!!!! Verify Volume failed!!! !!!!! " >>test.out
50    echo " "
51 else
52    echo "  ===== Verify Volume Test OK ===== "
53    echo "  ===== Verify Volume Test OK ===== " >>test.out
54    scripts/cleanup
55 fi