]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/restart-accurate-job-test
Add new restart regression tests from master
[bacula/bacula] / regress / tests / restart-accurate-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-accurate-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
16 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'Accurate', 'yes', 'Job', 'RestartJob')"
17 start_test
18
19 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
20 @$out /dev/null
21 messages
22 @$out ${cwd}/tmp/log1.out
23 label storage=File volume=TestVolume001
24 setdebug level=0 trace=0 hangup=100 client
25 @#setdebug level=20 dir
26 run job=$JobName yes
27 wait
28 messages
29 quit
30 END_OF_DATA
31
32 run_bacula  
33
34 scripts/check_for_zombie_jobs storage=File
35
36 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
37 @$out /dev/null
38 setdebug level=0 trace=0 hangup=50 client
39 @exec "sh -c 'touch $cwd/build/po/*'"
40 @exec "sh -c 'touch $cwd/build/src/dird/*'"
41 run job=$JobName yes
42 wait
43 messages
44 @# 
45 @# now do a restore
46 @#
47 @$out ${cwd}/tmp/log2.out
48 restore where=$tmp/bacula-restores storage=File select all done
49 yes
50 wait
51 messages
52 quit
53 END_OF_DATA
54
55 run_bconsole
56 scripts/check_for_zombie_jobs storage=File
57 stop_bacula
58
59 check_two_logs
60 check_restore_diff
61 end_test