]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-jobs-test
Make failures more obvious
[bacula/bacula] / regress / tests / two-jobs-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory using the compressed option
4 #   then backup a second time and finally restore it
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 two-jobs-test  ==="
17 echo " === Starting two-jobs-test  ===" >>working/log
18 echo " "
19
20 bin/bacula start 2>&1 >/dev/null
21 bin/console -c bin/console.conf <<END_OF_DATA
22 @output /dev/null
23 messages
24 @output tmp/log1.out
25 label storage=File
26 TestVolume001
27 run job=CompressedTest
28 yes
29 wait
30 messages
31 quit
32 END_OF_DATA
33 echo "Backup 1 done"
34 touch ${cwd}/build/src/dird/*.c
35 #
36 # run a second job
37 #
38 bin/console -c bin/console.conf <<END_OF_DATA
39 @output /dev/null
40 messages
41 @output tmp/log1.out
42 run job=CompressedTest
43 yes
44 wait
45 messages
46 @# 
47 @# now do a restore
48 @#
49 @output tmp/log2.out
50 restore
51 5
52 done
53 yes
54 wait
55 messages
56 @output
57 quit
58 END_OF_DATA
59 bin/bacula stop 2>&1 >/dev/null
60 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
61 bstat=$?
62 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
63 rstat=$?
64 diff -r build /tmp/bacula-restores${cwd}/build
65 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
66    echo " "
67    echo " "
68    echo "  !!!!! two-jobs-test Bacula source failed!!! !!!!! "
69    echo "  !!!!! two-jobs-test failed!!! !!!!! " >>test.out
70    echo " "
71 else
72    echo "  ===== two-jobs-test Bacula source OK ===== "
73    echo "  ===== two-jobs-test OK ===== " >>test.out
74    scripts/cleanup
75 fi