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