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 Client1 $JobName
25 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
28 @$out ${cwd}/tmp/log1.out
29 label volume=TestVolume001 storage=File pool=Default
35 SELECT 'FOUND' AS test FROM JobStat;
41 @$out ${cwd}/tmp/log2.out
44 SELECT 'FOUND' AS test FROM JobStat;
48 @$out ${cwd}/tmp/log3.out
50 SELECT 'FOUND' AS test FROM JobStat;
59 check_for_zombie_jobs storage=File
63 COUNT=$(grep FOUND ${cwd}/tmp/log1.out | wc -l)
64 if [ $COUNT -ne 1 ]; then
65 print_debug "Bad count in jobstat table"
69 COUNT=$(grep FOUND ${cwd}/tmp/log2.out | wc -l)
70 if [ $COUNT -ne 3 ]; then
71 print_debug "Bad count in jobstat table"
75 COUNT=$(grep FOUND ${cwd}/tmp/log3.out | wc -l)
76 if [ $COUNT -ne 1 ]; then
77 print_debug "Bad count in jobstat table"