]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/big-virtual-changer-test
Merge branch 'master' into basejobv3
[bacula/bacula] / regress / tests / big-virtual-changer-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 disk that is not loaded.  Note, they both have     
6 #   prefers non-mounted tapes.  This should expose bug #801
7 #
8 #  This test the SD Virtual autochanger feature.  It is a disk based
9 #    "autochanger", but does not use any changer script.
10 #
11 # This script uses the Virtual disk autochanger and two drives
12 #
13 TestName="virtual-changer-disk"
14 JobName="virtualchangerdisk"
15 . scripts/functions
16
17 scripts/cleanup
18 scripts/copy-2disk-drive-confs
19 scripts/prepare-disk-changer
20
21 CLIENT=2drive2disk
22
23 echo "${cwd}/build" >${cwd}/tmp/file-list
24 echo "${cwd}/build" >>${cwd}/tmp/file-list
25 echo "${cwd}/build" >>${cwd}/tmp/file-list
26 echo "${cwd}/build" >>${cwd}/tmp/file-list
27 echo "${cwd}/build" >>${cwd}/tmp/file-list
28 echo "${cwd}/build" >>${cwd}/tmp/file-list
29 #change_jobname Virtual $JobName
30 start_test
31
32 # Turn off Prefer Mounted Volumes so we use 2 drives
33 outf="${cwd}/tmp/sed_tmp"
34 echo "s%# Prefer Mounted Volumes%  Prefer Mounted Volumes%g" >${outf}
35 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
36 # Comment the next line out to write everything to one drive
37 #  otherwise, it writes the two jobs to different drives
38 #sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
39
40 # Write out bconsole commands
41 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
42 @output /dev/null
43 messages
44 @$out ${cwd}/tmp/log1.out
45 setdebug level=10 storage=Virtual
46 @#setdebug level=200 client=$CLIENT 
47 label storage=Virtual volume=TestVolume001 slot=1 Pool=Default drive=0
48 label storage=Virtual volume=TestVolume002 slot=2 Pool=Full    drive=0
49 label storage=Virtual volume=TestVolume003 slot=3 Pool=Inc     drive=1
50 label storage=Virtual volume=TestVolume004 slot=4 Pool=Default drive=0
51 status storage=Virtual
52 run job=Virtual level=Full Pool=Default yes
53 run job=Virtual level=Full Pool=Default yes
54 run job=Virtual level=Full Pool=Default yes
55 run job=Virtual level=Full Pool=Default yes
56 run job=Virtual level=Full Pool=Default yes
57 run job=Virtual level=Full Pool=Default yes
58 run job=Virtual level=Full Pool=Default yes
59 run job=Virtual level=Full Pool=Default yes
60 run job=Virtual level=Full Pool=Default yes
61 status storage=Virtual
62 status client
63 @sleep 1
64 status storage=Virtual
65 status client
66 @sleep 1
67 status storage=Virtual
68 status client
69 @sleep 1
70 status storage=Virtual
71 status client
72 @sleep 1
73 status storage=Virtual
74 status client
75 @sleep 1
76 status storage=Virtual
77 status client
78 @sleep 1
79 status storage=Virtual
80 status client
81 @sleep 1
82 status storage=Virtual
83 status client
84 @sleep 1
85 status storage=Virtual
86 status client
87 @sleep 1
88 status storage=Virtual
89 status client
90 @sleep 1
91 status storage=Virtual
92 status client
93 @sleep 1
94 status storage=Virtual
95 status client
96 @sleep 1
97 status storage=Virtual
98 status client
99 @sleep 5
100 status storage=Virtual
101 status client
102 list volumes
103 wait
104 list volumes
105 list jobs
106 status storage=Virtual
107 status client
108 messages
109 quit
110 END_OF_DATA
111
112 # exit
113
114 run_bacula
115 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
116 @$out /dev/null
117 messages
118 @# 
119 @# now do a restore
120 @#
121 @$out ${cwd}/tmp/log2.out
122 restore where=${cwd}/tmp/bacula-restores select all storage=Virtual done
123 yes
124 wait
125 messages
126 @$out
127 quit
128 END_OF_DATA
129
130 run_bconsole
131
132 check_for_zombie_jobs storage=Virtual
133 stop_bacula
134
135 check_two_logs
136 check_restore_diff
137
138 end_test