]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-pool-tape
Update
[bacula/bacula] / regress / tests / two-pool-tape
1 #!/bin/sh
2 #
3 # This is Arno's test.  It uses two pools, two tapes, and
4 #  an autochanger. Note, the Director has three Pools in its 
5 #  conf:  Default, Full, and Inc.  Default is used in the
6 #  NightlySave job by default.  What is backed up is what
7 #  is in /tmp/file-list, which is by default the Bacula
8 #  source code (i.e. the build directory).
9 #
10 debug=1
11 if test "$debug" -eq 1 ; then
12   out="tee"
13 else
14   out="output"
15 fi
16 cwd=`pwd`
17 scripts/cleanup
18 scripts/copy-2tape-confs
19 scripts/prepare-two-tapes
20  
21 # Make a relatively large backup set 10 x source code directory
22 echo "${cwd}/build" >/tmp/file-list
23 echo "${cwd}/build" >>/tmp/file-list
24 echo "${cwd}/build" >>/tmp/file-list
25 echo "${cwd}/build" >>/tmp/file-list
26 echo "${cwd}/build" >>/tmp/file-list
27 echo "${cwd}/build" >>/tmp/file-list
28 echo "${cwd}/build" >>/tmp/file-list
29 echo "${cwd}/build" >>/tmp/file-list
30 echo "${cwd}/build" >>/tmp/file-list
31 echo "${cwd}/build" >>/tmp/file-list
32
33 echo " "
34 echo " "
35 echo " === Starting Two Pool Tape test at `date +%R:%S` ==="
36 echo " === Starting Two Pool Tape test at `date +%R:%S` ===" >>working/log
37 echo " "
38 # Write out bconsole commands to a file
39 cat <<END_OF_DATA >tmp/bconcmds
40 @$out /dev/null
41 messages
42 @$out tmp/log1.out
43 label storage=DDS-4 volume=TestVolume001 slot=1 pool=Full drive=0
44 label storage=DDS-4 volume=TestVolume002 slot=2 pool=Default drive=0
45 run job=NightlySave level=Full pool=Default yes
46 @sleep 10
47 @#setdebug level=200 storage=DDS-4
48 run job=NightlySave level=Full pool=Full yes
49 @sleep 10
50 messages
51 @sleep 10
52 messages
53 @sleep 10
54 status storage=DDS-4
55 messages
56 wait
57 messages
58 @# 
59 @# now do a restore
60 @#
61 @$out tmp/log2.out
62 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
63 yes
64 wait
65 messages
66 @$out
67 quit
68 END_OF_DATA
69
70 # start Bacula and run bconsole commands
71 if test "$debug" -eq 1 ; then
72   bin/bacula start
73   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
74 else
75   bin/bacula start 2>&1 >/dev/null
76   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
77 fi
78 # Make sure no jobs are still running (debug check)
79 scripts/check_for_zombie_jobs storage=DDS-4
80
81 # stop Bacula
82 bin/bacula stop 2>&1 >/dev/null
83 # Check if backup done correctly
84 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
85 bstat=$?
86 grep "^  Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
87 rstat=$?
88 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
89 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
90    echo " "
91    echo " "
92    echo "  !!!!! Two Pool Tape test Bacula source failed!!! !!!!! "
93    echo "  !!!!! Two Pool Tape test failed!!! !!!!! " >>test.out
94    echo " "
95 else
96    echo "  ===== Two Pool Tape test Bacula source OK ===== "
97    echo "  ===== Two Pool Tape test OK ===== " >>test.out
98 #  scripts/cleanup
99 fi