]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/stats-test
6c3dc0d660ab6c650b6b3b04afb18803e3f00f7f
[bacula/bacula] / regress / tests / stats-test
1 #!/bin/sh
2 #
3 # Do some tests with statistics commands
4 #
5 TestName="stats-test"
6 JobName=backup
7 . scripts/functions
8
9 scripts/cleanup
10 scripts/copy-confs
11
12 #
13 # Zap out any schedule in default conf file so that
14 #  it doesn't start during our test
15 #
16 outf="tmp/sed_tmp"
17 echo "s%  Schedule =%# Schedule =%g" >${outf}
18 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
19 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
20
21 change_jobname Client1 $JobName
22 start_test
23
24 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
25 @output /dev/null
26 messages
27 @$out ${cwd}/tmp/log1.out
28 label volume=TestVolume001 storage=File pool=Default
29 run job=$JobName yes
30 wait
31 messages
32 update stats days=1
33 @$out ${cwd}/tmp/log2.out
34 sql
35 SELECT * FROM JobStat;
36
37 run job=$JobName yes
38 wait
39 messages
40 @$out ${cwd}/tmp/log3.out
41 update stats
42 sql
43 SELECT * FROM JobStat;
44
45 list jobs
46 quit
47 END_OF_DATA
48
49 run_bacula
50 export dstat=0
51 export rstat=0
52 export bstat=0
53 check_for_zombie_jobs storage=File
54 stop_bacula
55
56 # TODO: do grep into log2 log3 to see differences
57
58 end_test