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