]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/restart2-job-test
Add more debug to restart regress scripts
[bacula/bacula] / regress / tests / restart2-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="restart2-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 setbandwidth limit=1000 client
22 @#setdebug level=0 trace=0 hangup=100 client
23 @#setdebug level=20 dir
24 label storage=File volume=TestVolume001
25 run job=$JobName yes
26 @sleep 15
27 status client
28 END_OF_DATA
29
30 run_bacula  
31
32 # Note, the following stops and restarts the FD while it
33 #  is running to simulate a crash, so it is normal if
34 #  orphanned buffers are reported
35 sleep 5
36 $bin/bacula-ctl-fd stop
37 sleep 5
38 $bin/bacula-ctl-fd start
39 sleep 5
40
41 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
42 @$out ${cwd}/tmp/log1.out
43 wait
44 messages
45 sql
46 select * from JobMedia where JobId=1;
47
48 quit
49 END_OF_DATA
50
51 run_bconsole  
52
53 scripts/check_for_zombie_jobs storage=File
54
55 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
56 @$out /dev/null
57 messages
58 @# 
59 @# now do a restore
60 @#
61 @$out ${cwd}/tmp/log2.out
62 restore where=$tmp/bacula-restores storage=File select all done
63 yes
64 wait
65 messages
66 quit
67 END_OF_DATA
68
69 run_bconsole
70 scripts/check_for_zombie_jobs storage=File
71 stop_bacula
72
73 check_two_logs
74 check_restore_diff
75
76 grep "Sending Accurate" $tmp/log1.out >/dev/null
77 if [ $? != 0 ]; then
78     print_debug "ERROR: Second job should use Accurate"
79     estat=1
80 fi
81
82 end_test