]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/verify-voltocat-test
ebl Add estimate test
[bacula/bacula] / regress / tests / verify-voltocat-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory
4 #   then verify the Volume to the catalog.           
5 #
6 TestName="verify-voltocat-test"
7 JobName=VerifyVol
8 . scripts/functions
9
10 cwd=`pwd`
11 scripts/cleanup
12 scripts/copy-test-confs
13 echo "${cwd}/build" >${cwd}/tmp/file-list
14 echo "${cwd}/build/po" >>${cwd}/tmp/file-list
15 cp $conf/bacula-dir.conf $tmp/1
16 sed 's/"VerifyVol"/"VerifyVol"; Accurate = yes/' $tmp/1 > $conf/bacula-dir.conf
17
18 change_jobname NightlySave $JobName
19 start_test
20
21 cat <<END_OF_DATA >tmp/bconcmds
22 @$out /dev/null
23 messages
24 @$out tmp/log1.out
25 setdebug level=1 storage=File sd
26 label storage=File volume=TestVolume001
27 run job=$JobName yes
28 wait
29 messages
30 @# 
31 @# now do a verify to catalog
32 @#
33 @$out ${cwd}/tmp/log2.out
34 setdebug level=12 dir
35 run job=VerifyVolume level=VolumeToCatalog
36 yes
37 wait
38 messages
39 @$out
40 quit
41 END_OF_DATA
42
43 run_bacula
44
45 # we make a test in accurate mode
46 mv $cwd/build/po/fr.po $cwd/build/po/fr.po.old
47
48 cat <<END_OF_DATA >tmp/bconcmds
49 @$out /dev/null
50 messages
51 @$out tmp/log11.out
52 run level=incremental job=$JobName yes
53 wait
54 messages
55 @# 
56 @# now do a verify to catalog
57 @#
58 @$out ${cwd}/tmp/log22.out
59 @# The fr.po file shouldn't be appear as new file
60 setdebug level=12 dir
61 run job=VerifyVolume level=VolumeToCatalog
62 yes
63 wait
64 messages
65 @$out
66 quit
67 END_OF_DATA
68
69 run_bconsole
70 mv $cwd/build/po/fr.po.old $cwd/build/po/fr.po
71
72 sleep 1
73 check_for_zombie_jobs storage=File 
74 stop_bacula
75
76 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
77 bstat=$?
78 grep "^  Termination: *Verify OK" tmp/log2.out 2>&1 >/dev/null
79 rstat=$?
80
81 grep "^  Termination: *Backup OK" tmp/log11.out 2>&1 >/dev/null
82 bstat=$(($bstat + $?))
83 grep "^  Termination: *Verify OK" tmp/log22.out 2>&1 >/dev/null
84 rstat=$(($bstat + $?))
85
86 dstat=0
87 end_test