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