]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/backup-bacula-test
Doc updates
[bacula/bacula] / regress / tests / backup-bacula-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory
4 #   then restore it.
5 #
6 cwd=`pwd`
7 scripts/copy-confs
8 scripts/cleanup
9 bin/bacula stop 2>&1 >/dev/null
10 cd bin
11 ./drop_bacula_tables >/dev/null 2>&1
12 ./make_bacula_tables >/dev/null 2>&1
13 ./grant_bacula_privileges >/dev/null 2>&1
14 cd ..
15
16 echo " "
17 echo " "
18 echo " === Starting Backup Bacula Test ==="
19 echo " === Starting Backup Bacula Test ===" >>working/log
20 echo " "
21
22 bin/bacula start 2>&1 >/dev/null
23 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
24 @output /dev/null
25 messages
26 @output tmp/log1.out
27 label volume=TestVolume001
28 run job=Client1 yes
29 wait
30 messages
31 @# 
32 @# now do a restore
33 @#
34 @output tmp/log2.out  
35 restore where=${cwd}/tmp/bacula-restores select all done
36 yes
37 wait
38 messages
39 @output
40 quit
41 END_OF_DATA
42 scripts/check_for_zombie_jobs storage=File
43 bin/bacula stop 2>&1 >/dev/null
44 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
45 bstat=$?
46 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
47 rstat=$?
48 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
49 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
50    echo " "
51    echo " "
52    echo "  !!!!! Backup Bacula Test failed!!! !!!!! "
53    echo "  !!!!! Backup Bacula Test failed!!! !!!!! " >>test.out
54    echo " "
55 else
56    echo "  ===== Backup Bacula Test OK ===== "
57    echo "  ===== Backup Bacula Test OK ===== " >>test.out
58    scripts/cleanup
59 fi