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