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-base-job-test"
7 JobName=RestartJobWithBase
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', 'Base', '$JobName', 'Job', '$JobName')"
17 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'Accurate', 'yes', 'Job', '$JobName')"
20 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
23 @$out ${cwd}/tmp/log1.out
24 label storage=File volume=TestVolume001
25 run job=$JobName level=Base yes
28 @exec "touch $cwd/build/po/fr.po"
29 setdebug level=0 trace=0 hangup=100 client
30 setdebug level=200 trace=1 dir
34 setdebug level=0 trace=0 dir
35 @$out ${cwd}/tmp/log3.out
42 scripts/check_for_zombie_jobs storage=File
44 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
50 @$out ${cwd}/tmp/log2.out
51 restore where=$tmp/bacula-restores storage=File select all done
59 scripts/check_for_zombie_jobs storage=File
65 nb_B=`awk -F '|' '/RestartJob.+ B.+ B/ { gsub(/,/, "");print $7}' $tmp/log3.out`
66 nb_F=`awk -F '|' '/RestartJob.+F/ { gsub(/,/, ""); print $7}' $tmp/log3.out`
68 if [ $nb_F -ne $nb_B ]; then
69 print_debug "ERROR: Base and Full should have the same number of files"
73 nb_B=`awk -F '|' '/RestartJob.+B.+B/ { gsub(/,/, ""); print $8}' $tmp/log3.out`
74 nb_F=`awk -F '|' '/RestartJob.+F/ { gsub(/,/, ""); print $8}' $tmp/log3.out`
76 if [ $nb_F -gt 1000000 ]; then
77 print_debug "ERROR: Base job should backup only one file"