3 # Test different cancel cases
15 # Zap out any schedule in default conf file so that
16 # it doesn't start during our test
19 echo "s% Schedule =%# Schedule =%g" >$outf
20 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
21 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
25 # Add some jobs and fileset for this test
26 cat <<EOF >>${cwd}/bin/bacula-dir.conf
33 file = "\\</path/to/nowhere"
38 ClientRunBeforeJob = "/bin/false"
44 Command = "/bin/false"
51 ClientRunBeforeJob="/bin/sleep 10"
53 Command = "/bin/sleep 600"
61 change_jobname Client1 $JobName
64 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
67 @$out ${cwd}/tmp/logfile1.out
68 @################################################################
69 @# run a first test without volume
70 @# Expect: duration < 60
71 @################################################################
79 @$out ${cwd}/tmp/logfile2.out
80 @################################################################
81 @# run test with a small volume
82 @# Expect: duration < 60
83 @################################################################
84 label volume=TestVolume001 storage=File pool=Default
85 update volume=TestVolume001 MaxVolBytes=1MB
94 @$out ${cwd}/tmp/logfile3.out
95 @################################################################
96 @# run test with 2 jobs in // (limit 1)
97 @# expect that the second job don't stay in the list
98 @# Expect: Job2 not present at the end
99 @################################################################
100 label volume=TestVolume002 storage=File pool=Default
116 @$out ${cwd}/tmp/logfile4.out
117 @################################################################
118 @# test with a broken fileset
119 @# Expect: duration < 20s
120 @################################################################
121 run job=$JobName fileset=FS_ERR yes
127 @$out ${cwd}/tmp/logfile5.out
128 @################################################################
129 @# test with a broken runscript
130 @# Expect: duration < 20s
131 @################################################################
138 @$out ${cwd}/tmp/logfile6.out
139 @################################################################
140 @# test with a broken runscript
141 @# Expect: duration < 20s
142 @################################################################
149 @$out ${cwd}/tmp/logfile7.out
150 @################################################################
151 @# test with a broken runscript and a very long AfterJob
152 @# we broke the backup during the ClientRunBeforeJob
153 @# Expect: duration > 600
154 @################################################################
166 @$out ${cwd}/tmp/logfile8.out
167 @################################################################
168 @# test with a broken runscript and a very long AfterJob
169 @# we broke the backup during the ClientRunAfterJob
170 @# Expect: duration > 600
171 @################################################################
183 @$out ${cwd}/tmp/logfile9.out
184 @################################################################
185 @# test with a broken runscript and a very long AfterJob
186 @# we broke the backup during the backup
187 @# Expect: duration > 600
188 @################################################################
189 update volume=TestVolume002 volstatus=Used
190 label volume=TestVolume003 storage=File pool=Default
191 update volume=TestVolume003 MaxVolBytes=1MB
203 @$out ${cwd}/tmp/logfile20.out
204 @################################################################
205 @# test with a broken connexion between DIR/FD
206 @# the test will run a job that will stop, and we send
207 @# the STOP signal to the FD process
208 @# Expect: duration < 400
209 @################################################################
210 update volume=TestVolume003 volstatus=Used
211 label volume=TestVolume004 storage=File pool=Default
212 update volume=TestVolume004 MaxVolBytes=1MB
221 print_debug "Stopping FD"
222 # stop the bacula-fd and cancel the job
223 #kill -STOP $(pidof bacula-fd)
225 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
226 @$out ${cwd}/tmp/logfile20.out
240 kill -CONT $(pidof bacula-fd)
242 check_for_zombie_jobs storage=File
245 # A fileset or runscript error goes fast
246 check_duration ${cwd}/tmp/logfile4.out 30
247 check_duration ${cwd}/tmp/logfile5.out 30
248 check_duration ${cwd}/tmp/logfile6.out 30
250 # Verify the broken connection
251 check_duration ${cwd}/tmp/logfile20.out 400