3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a backup of the build directory but force it to have
9 # a comm error, and check that it restarts correctly.
11 # NOTE!!! This test will always fail, because currently we cannot
12 # restart a Backup Job that has Base files specified.
14 TestName="restart-base-job-test"
15 JobName=RestartJobWithBase
19 scripts/copy-test-confs
20 echo "${cwd}/build" >${cwd}/tmp/file-list
22 change_jobname NightlySave $JobName
24 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'Base', '$JobName', 'Job', '$JobName')"
25 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'Accurate', 'yes', 'Job', '$JobName')"
28 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
31 @$out ${cwd}/tmp/log1.out
32 label storage=File volume=TestVolume001
33 run job=$JobName level=Base yes
36 @exec "touch $cwd/build/po/fr.po"
37 setdebug level=0 trace=0 hangup=100 client
38 setdebug level=200 trace=1 dir
43 select * from JobMedia;
45 setdebug level=0 trace=0 dir
46 @$out ${cwd}/tmp/log3.out
53 scripts/check_for_zombie_jobs storage=File
55 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
61 @$out ${cwd}/tmp/log2.out
62 restore where=$tmp/bacula-restores storage=File select all done
70 scripts/check_for_zombie_jobs storage=File1
76 nb_B=`awk -F '|' '/RestartJob.+ B.+ B/ { gsub(/,/, "");print $7}' $tmp/log3.out`
77 nb_F=`awk -F '|' '/RestartJob.+F/ { gsub(/,/, ""); print $7}' $tmp/log3.out`
79 if [ $nb_F -ne $nb_B ]; then
80 print_debug "ERROR: Base and Full should have the same number of files"
84 nb_B=`awk -F '|' '/RestartJob.+B.+B/ { gsub(/,/, ""); print $8}' $tmp/log3.out`
85 nb_F=`awk -F '|' '/RestartJob.+F/ { gsub(/,/, ""); print $8}' $tmp/log3.out`
87 if [ $nb_F -gt 1000000 ]; then
88 print_debug "ERROR: Base job should backup only one file"