]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/backup-bacula-test
Make failures more obvious
[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
25 TestVolume001
26 run job=Client1
27 yes
28 wait
29 messages
30 @# 
31 @# now do a restore
32 @#
33 @output tmp/log2.out  
34 restore
35 5
36 done
37 yes
38 @sleep 1
39 wait
40 messages
41 @output
42 quit
43 END_OF_DATA
44 bin/bacula stop 2>&1 >/dev/null
45 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
46 bstat=$?
47 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
48 rstat=$?
49 diff -r build /tmp/bacula-restores${cwd}/build
50 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
51    echo " "
52    echo " "
53    echo "  !!!!! Backup Bacula Test failed!!! !!!!! "
54    echo "  !!!!! Backup Bacula Test failed!!! !!!!! " >>test.out
55    echo " "
56 else
57    echo "  ===== Backup Bacula Test OK ===== "
58    echo "  ===== Backup Bacula Test OK ===== " >>test.out
59    scripts/cleanup
60 fi