]> 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 echo "${cwd}/build" >/tmp/file-list
22
23 echo " "
24 echo " "
25 echo " === Starting Two Pool Tape test at `date +%R:%S` ==="
26 echo " === Starting Two Pool Tape test at `date +%R:%S` ===" >>working/log
27 echo " "
28 # Write out bconsole commands to a file
29 cat <<END_OF_DATA >tmp/bconcmds
30 @$out /dev/null
31 messages
32 @$out tmp/log1.out
33 label storage=DDS-4 volume=TestVolume001 slot=1 pool=Default drive=0
34 label storage=DDS-4 volume=TestVolume002 slot=2 pool=Default drive=0
35 @#setdebug level=1000 client 
36 run job=NightlySave yes
37 @sleep 10
38 run job=NightlySave level=Full pool=Full yes
39 wait
40 messages
41 @# 
42 @# now do a restore
43 @#
44 @$out tmp/log2.out
45 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
46 yes
47 wait
48 messages
49 @$out
50 quit
51 END_OF_DATA
52
53 # start Bacula and run bconsole commands
54 if test "$debug" -eq 1 ; then
55   bin/bacula start
56   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
57 else
58   bin/bacula start 2>&1 >/dev/null
59   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
60 fi
61 # Make sure no jobs are still running (debug check)
62 scripts/check_for_zombie_jobs storage=DDS-4
63
64 # stop Bacula
65 bin/bacula stop 2>&1 >/dev/null
66 # Check if backup done correctly
67 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
68 bstat=$?
69 grep "^  Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
70 rstat=$?
71 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
72 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
73    echo " "
74    echo " "
75    echo "  !!!!! Two Pool Tape test Bacula source failed!!! !!!!! "
76    echo "  !!!!! Two Pool Tape test failed!!! !!!!! " >>test.out
77    echo " "
78 else
79    echo "  ===== Two Pool Tape test Bacula source OK ===== "
80    echo "  ===== Two Pool Tape test OK ===== " >>test.out
81 #  scripts/cleanup
82 fi