]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-vol-test
ddf093180396f3ffad9608044b5dc2e49b69abd2
[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
11 echo " "
12 echo " "
13 echo " === Starting two-vol-test at `date +%R:%S` ==="
14 echo " === Starting two-vol-test at `date +%R:%S` ===" >working/log
15 echo " "
16
17 bin/bacula start 2>&1 >/dev/null
18 # bin/bacula start
19 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
20 #bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
21 @output /dev/null
22 messages
23 @output tmp/log1.out
24 label storage=File1 volume=TestVolume001
25 label storage=File1 volume=TestVolume002
26 update Volume=TestVolume001 MaxVolBytes=3000000
27 run job=NightlySave storage=File1 yes
28 wait
29 messages
30 @# 
31 @# now do a restore
32 @#
33 @output tmp/log2.out
34 restore where=${cwd}/tmp/bacula-restores select all storage=File1 done
35 yes
36 wait
37 messages
38 @output
39 quit
40 END_OF_DATA
41 scripts/check_for_zombie_jobs storage=File1
42 bin/bacula stop 2>&1 >/dev/null
43 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
44 bstat=$?
45 grep "^  Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
46 rstat=$?
47 diff -r build  tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
48 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
49    echo " "
50    echo " "
51    echo "  !!!!! two-vol-test Bacula source failed!!! !!!!! "
52    echo "  !!!!! two-vol-test failed!!! !!!!! " >>test.out
53    if [ $bstat != 0 -o $rstat != 0 ] ; then
54       echo "  !!!!! Bad Job termination status     !!!!! "
55       echo "  !!!!! Bad Job termination status     !!!!! " >>test.out
56    else
57       echo "  !!!!! Restored files differ          !!!!! "
58       echo "  !!!!! Restored files differ          !!!!! " >>test.out
59    fi
60    echo " "
61 else
62    echo "  ===== two-vol-test Bacula source OK ===== "
63    echo "  ===== two-vol-test OK ===== " >>test.out
64    scripts/cleanup
65 fi