]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-vol-test
Make failures more obvious
[bacula/bacula] / regress / tests / two-vol-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory but 
4 #   split the archive into two volumes
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-vol-test  ==="
17 echo " === Starting two-vol-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=File1
26 TestVolume001
27 label storage=File1
28 TestVolume002
29 update Volume=TestVolume001
30 6
31 3000000
32 10
33 run job=NightlySave storage=File1
34 yes
35 wait
36 messages
37 @# 
38 @# now do a restore
39 @#
40 @output tmp/log2.out
41 restore where=${cwd}/tmp/bacula-restores
42 5
43 done
44 yes
45 wait
46 messages
47 @output
48 quit
49 END_OF_DATA
50 bin/bacula stop 2>&1 >/dev/null
51 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
52 bstat=$?
53 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
54 rstat=$?
55 diff -r build  tmp/bacula-restores${cwd}/build
56 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
57    echo " "
58    echo " "
59    echo "  !!!!! two-vol-test Bacula source failed!!! !!!!! "
60    echo "  !!!!! two-vol-test failed!!! !!!!! " >>test.out
61    echo " "
62 else
63    echo "  ===== two-vol-test Bacula source OK ===== "
64    echo "  ===== two-vol-test OK ===== " >>test.out
65    scripts/cleanup
66 fi