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