]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/three-pool-test
6a472a3625e656b28dbe8607639635072fbc054e
[bacula/bacula] / regress / tests / three-pool-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory. Create three
4 #   tapes, each in a different pool, then run two jobs both of which
5 #   want the tape that is not loaded.  Note, they both have     
6 #   prefers non-mounted tapes.  This should expose bug #801
7 #
8 # This script uses the virtual disk autochanger and two drives
9 #
10 TestName="three-pool-disk"
11 JobName="threepooldisk"
12 . scripts/functions
13
14 scripts/cleanup
15 scripts/copy-2disk-drive-confs
16 scripts/prepare-two-disks
17
18 echo "${cwd}/build" >/tmp/file-list
19 change_jobname NightlySave $JobName
20 start_test
21
22 # Turn off Prefer Mounted Volumes so we use 2 drives
23 outf="tmp/sed_tmp"
24 echo "s%# Prefer Mounted Volumes%  Prefer Mounted Volumes%g" >${outf}
25 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
26 # Comment the next line out to write everything to one drive
27 #  otherwise, it writes the two jobs to different drives
28 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
29
30 # Write out bconsole commands
31 cat <<END_OF_DATA >tmp/bconcmds
32 @output /dev/null
33 messages
34 @$out tmp/log1.out
35 setdebug level=51 storage=DDS-4
36 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0
37 label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Full    drive=0
38 label storage=DDS-4 volume=TestVolume003 slot=3 Pool=Inc     drive=1
39 status storage=DDS-4
40 run job=$JobName level=Full Pool=Default yes
41 run job=$JobName level=Full Pool=Default yes
42 run job=$JobName level=Full Pool=Default yes
43 run job=$JobName level=Full Pool=Default yes
44 run job=$JobName level=Full Pool=Default yes
45 @sleep 10
46 status storage=DDS-4
47 list volumes
48 wait
49 list volumes
50 list jobs
51 status storage=DDS-4
52 messages
53 quit
54 END_OF_DATA
55
56 # exit
57
58 run_bacula
59 cat <<END_OF_DATA >tmp/bconcmds
60 @$out /dev/null
61 messages
62 @# 
63 @# now do a restore
64 @#
65 @$out tmp/log2.out
66 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
67 yes
68 wait
69 messages
70 @$out
71 quit
72 END_OF_DATA
73
74 run_bconsole
75
76 check_for_zombie_jobs storage=DDS-4
77 stop_bacula
78
79 check_two_logs
80 check_restore_diff
81
82 end_test