]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/restart-job-test
backport code from master
[bacula/bacula] / regress / tests / restart-job-test
1 #!/bin/sh
2 #
3 # Run a backup of the build directory but force it to have
4 #   a comm error, and check that it restarts correctly.
5 #
6 TestName="restart-job-test"
7 JobName=RestartJob
8 . scripts/functions
9
10 scripts/cleanup
11 scripts/copy-test-confs
12 echo "${cwd}/build" >${cwd}/tmp/file-list
13
14 change_jobname NightlySave $JobName
15 start_test
16
17 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
18 @$out /dev/null
19 messages
20 @$out ${cwd}/tmp/log1.out
21 setdebug level=0 trace=0 hangup=100 client
22 @#setdebug level=20 dir
23 label storage=File volume=TestVolume001
24 run job=$JobName yes
25 wait
26 messages
27 sql
28 select * from JobMedia where JobId=1;
29
30 quit
31 END_OF_DATA
32
33 run_bacula  
34
35 scripts/check_for_zombie_jobs storage=File
36
37 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
38 @$out /dev/null
39 messages
40 @# 
41 @# now do a restore
42 @#
43 @$out ${cwd}/tmp/log2.out
44 restore where=$tmp/bacula-restores storage=File select all done
45 yes
46 wait
47 messages
48 quit
49 END_OF_DATA
50
51 run_bconsole
52 scripts/check_for_zombie_jobs storage=File
53 stop_bacula
54
55 check_two_logs
56 check_restore_diff
57 end_test