]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/2drive-3pool-test
Make copy-job test handle one more job
[bacula/bacula] / regress / tests / 2drive-3pool-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 some jobs asking for the
5 #   volume on drive three.  It should find it without moving the 
6 #   volume.
7 #
8 # This script uses the virtual disk autochanger and two drives
9 #
10 TestName="2drive-3pool-disk"
11 JobName="2dr3pooldisk"
12 . scripts/functions
13
14 scripts/cleanup
15 scripts/copy-2disk-drive-confs
16 scripts/prepare-disk-changer
17 CLIENT=2drive2disk
18
19 echo "${cwd}/build" >${cwd}/tmp/file-list
20 change_jobname NightlySave $JobName
21 start_test
22
23 # Turn off Prefer Mounted Volumes so we use 2 drives
24 # outf="tmp/sed_tmp"
25 #  echo "s%# Prefer Mounted Volumes%  Prefer Mounted Volumes%g" >${outf}
26 # cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
27 # Comment the next line out to write everything to one drive
28 #  otherwise, it writes the two jobs to different drives
29 # sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
30
31 # Write out bconsole commands
32 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
33 @$out /dev/null
34 messages
35 @$out ${cwd}/tmp/log1.out
36 setdebug level=51 storage=tape
37 label storage=tape volume=TestVolume001 slot=1 Pool=Default drive=0
38 label storage=tape volume=TestVolume002 slot=2 Pool=Full    drive=1
39 @#label storage=tape volume=TestVolume003 slot=3 Pool=Inc     drive=2
40 status storage=tape
41 @#run job=$JobName level=Full Pool=Inc yes
42 run job=$JobName level=Full Pool=Full yes
43 run job=$JobName level=Full Pool=Default yes
44 setdebug level=200 storage=tape
45 run job=$JobName level=Full Pool=Default yes
46 run job=$JobName level=Full Pool=Default yes
47 @sleep 10
48 status storage=tape
49 list volumes
50 wait
51 list volumes
52 list jobs
53 status storage=tape
54 messages
55 quit
56 END_OF_DATA
57
58 # exit
59
60 run_bacula
61 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
62 @$out /dev/null
63 messages
64 @# 
65 @# now do a restore
66 @#
67 @$out ${cwd}/tmp/log2.out
68 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
69 yes
70 wait
71 messages
72 quit
73 END_OF_DATA
74
75 run_bconsole
76
77 check_for_zombie_jobs storage=tape
78 stop_bacula
79
80 check_two_logs
81 check_restore_diff
82
83 end_test