3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Do some tests with statistics commands
18 # Zap out any schedule in default conf file so that
19 # it doesn't start during our test
22 echo "s% Schedule =%# Schedule =%g" > $outf
23 echo "s% DIRport%Statistics Retention = 1 sec; DIRport%g" >> $outf
24 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
25 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
27 change_jobname BackupClient1 $JobName
30 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
33 @$out ${cwd}/tmp/log1.out
34 label volume=TestVolume001 storage=File1 pool=File slot=1 drive=0
40 SELECT 'FOUND' AS test FROM JobHisto;
46 @$out ${cwd}/tmp/log2.out
49 SELECT 'FOUND' AS test FROM JobHisto;
53 @$out ${cwd}/tmp/log3.out
55 SELECT 'FOUND' AS test FROM JobHisto;
66 check_for_zombie_jobs storage=File1
70 COUNT=`grep FOUND ${cwd}/tmp/log1.out | wc -l`
71 if [ $COUNT -ne 1 ]; then
72 print_debug "Bad count in JobHisto table"
76 COUNT=`grep FOUND ${cwd}/tmp/log2.out | wc -l`
77 if [ $COUNT -ne 3 ]; then
78 print_debug "Bad count in JobHisto table"
82 COUNT=`grep FOUND ${cwd}/tmp/log3.out | wc -l`
83 if [ $COUNT -ne 1 ]; then
84 print_debug "Bad count in JobHisto table"