]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/verify-vol-test
UPdate verify-vol-test
[bacula/bacula] / regress / tests / verify-vol-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory
4 #   then verify the catalog.           
5 #
6 TestName="verify-vol-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 rm -f ${cwd}/build/sparsefile
15 dd if=${cwd}/build/configure of=${cwd}/build/sparsefile bs=1 count=1 seek=10M
16
17 change_jobname NightlySave $JobName
18 start_test
19
20 cat <<END_OF_DATA >tmp/bconcmds
21 @$out /dev/null
22 messages
23 @$out tmp/log1.out
24 setdebug level=1 storage=File sd
25 label storage=File volume=TestVolume001
26 run job=$JobName yes
27 wait
28 messages
29 @# 
30 @# now do a verify volume
31 @#
32 @$out ${cwd}/tmp/log2.out
33 setdebug level=12 dir
34 run job=VerifyVolume
35 yes
36 wait
37 messages
38 @$out ${cwd}/tmp/log3.out
39 run job=VerifyVolume level=DiskToCatalog
40 yes
41 wait
42 messages
43 @$out
44 quit
45 END_OF_DATA
46
47 #
48 #  ***FIXME***
49 # Note, add sparse file backup and check that checksum is
50 #  correct.  Bug #1140
51 #  create sparse file
52 #  dd if=/dev/zero of=sparsefile bs=1 count=0 seek=10M
53 #
54
55 run_bacula
56
57 sleep 2
58 check_for_zombie_jobs storage=File 
59 stop_bacula
60
61 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
62 bstat=$?
63 grep "^  Termination: *Verify OK" tmp/log2.out 2>&1 >/dev/null
64 rstat=$?
65 if test $rstat=0; then
66    grep "^  Termination: *Verify OK" tmp/log3.out 2>&1 >/dev/null
67    rstat=$?
68 fi
69 dstat=0
70 end_test