3 # Do some tests with statistics commands
13 # Zap out any schedule in default conf file so that
14 # it doesn't start during our test
17 echo "s% Schedule =%# Schedule =%g" > $outf
18 echo "s% DIRport%Statistics Retention = 1 sec; DIRport%g" >> $outf
19 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
20 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
22 change_jobname BackupClient1 $JobName
25 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
28 @$out ${cwd}/tmp/log1.out
29 label volume=TestVolume001 storage=File pool=File
35 SELECT 'FOUND' AS test FROM JobHisto;
41 @$out ${cwd}/tmp/log2.out
44 SELECT 'FOUND' AS test FROM JobHisto;
48 @$out ${cwd}/tmp/log3.out
50 SELECT 'FOUND' AS test FROM JobHisto;
61 check_for_zombie_jobs storage=File
65 COUNT=`grep FOUND ${cwd}/tmp/log1.out | wc -l`
66 if [ $COUNT -ne 1 ]; then
67 print_debug "Bad count in JobHisto table"
71 COUNT=`grep FOUND ${cwd}/tmp/log2.out | wc -l`
72 if [ $COUNT -ne 3 ]; then
73 print_debug "Bad count in JobHisto table"
77 COUNT=`grep FOUND ${cwd}/tmp/log3.out | wc -l`
78 if [ $COUNT -ne 1 ]; then
79 print_debug "Bad count in JobHisto table"