]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-pool-tape
Updates
[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=0
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 5 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
28 echo " "
29 echo " "
30 echo " === Starting Two Pool Tape test at `date +%R:%S` ==="
31 echo " === Starting Two Pool Tape test at `date +%R:%S` ===" >>working/log
32 echo " "
33 # Write out bconsole commands to a file
34 cat <<END_OF_DATA >tmp/bconcmds
35 @output /dev/null
36 messages
37 @$out tmp/log1.out
38 label storage=DDS-4 volume=TestVolume001 slot=1 pool=Full drive=0
39 label storage=DDS-4 volume=TestVolume002 slot=2 pool=Default drive=0
40 list volumes
41 @# Start job with Client run before and sleep
42 run job=NightlySave1 level=Full pool=Default yes
43 run job=NightlySave1 level=Full pool=Default yes
44 run job=NightlySave1 level=Full pool=Default yes
45 @# wait between starting jobs
46 @sleep 60
47 @#setdebug level=100 storage=DDS-4
48 run job=NightlySave2 level=Full pool=Full yes
49 run job=NightlySave2 level=Full pool=Full yes
50 run job=NightlySave2 level=Full pool=Full yes
51 @sleep 10
52 messages
53 @sleep 10
54 messages
55 @sleep 10
56 status storage=DDS-4
57 messages
58 wait
59 list volumes
60 messages
61 @# 
62 @# now do a restore
63 @#
64 @$out tmp/log2.out
65 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
66 yes
67 wait
68 messages
69 @$out
70 quit
71 END_OF_DATA
72
73 # start Bacula and run bconsole commands
74 if test "$debug" -eq 1 ; then
75   bin/bacula start
76   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
77 else
78   bin/bacula start 2>&1 >/dev/null
79   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
80 fi
81 # Make sure no jobs are still running (debug check)
82 scripts/check_for_zombie_jobs storage=DDS-4
83
84 # stop Bacula
85 bin/bacula stop 2>&1 >/dev/null
86 # Check if backup done correctly
87 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
88 bstat=$?
89 grep "^  Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
90 rstat=$?
91 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
92 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
93    echo " "
94    echo " "
95    echo "  !!!!! Two Pool Tape test Bacula source failed!!! !!!!! "
96    echo "  !!!!! Two Pool Tape test failed!!! !!!!! " >>test.out
97    echo " "
98 else
99    echo "  ===== Two Pool Tape test Bacula source OK ===== "
100    echo "  ===== Two Pool Tape test OK ===== " >>test.out
101 #  scripts/cleanup
102 fi