3 # Run a backup of the build directory but force it to have
4 # a comm error, and check that it restarts correctly.
6 TestName="restart-accurate-job-test"
11 scripts/copy-test-confs
12 echo "${cwd}/build" >${cwd}/tmp/file-list
14 change_jobname NightlySave $JobName
16 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'Accurate', 'yes', 'Job', 'RestartJob')"
19 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
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
30 select * from JobMedia;
37 scripts/check_for_zombie_jobs storage=File
39 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
41 @$out ${cwd}/tmp/log1.out
42 setdebug level=0 trace=0 hangup=50 client
43 @exec "sh -c 'touch $cwd/build/po/*'"
44 @exec "sh -c 'touch $cwd/build/src/dird/*'"
49 select * from JobMedia;
54 @$out ${cwd}/tmp/log2.out
55 restore where=$tmp/bacula-restores storage=File select all done
59 @$out ${cwd}/tmp/log3.out
65 scripts/check_for_zombie_jobs storage=File
71 nb_F=`awk -F '|' '/RestartJob.+F/ { gsub(/,/, ""); print $7}' $tmp/log3.out`
72 nb_I=`awk -F '|' '/RestartJob.+I/ { gsub(/,/, ""); print $7}' $tmp/log3.out`
73 nb1=`ls $cwd/build/po/* $cwd/build/src/dird/* | wc -l`
76 if [ "$nb_I" -eq "$nb_F" ]; then
77 print_debug "ERROR: Incremental saves too much files (nb Incr == nb Full)"
81 if [ "$nb_I" -ge "$nb1" ]; then
82 print_debug "ERROR: Incremental saves too much files (more than $nb1)"