]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/verify-vol-test
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / verify-vol-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6
7 #
8 # Run a simple backup of the Bacula build directory
9 #   then verify the catalog.           
10 #
11 TestName="verify-vol-test"
12 JobName=VerifyVol
13 . scripts/functions
14
15 cwd=`pwd`
16 scripts/cleanup
17 scripts/copy-test-confs
18 echo "${cwd}/build" >${cwd}/tmp/file-list
19 rm -f ${cwd}/build/sparsefile
20 #
21 # Add this back when verify can handle sparse files
22 #  the same way that backup does
23 #
24 #dd if=${cwd}/build/configure of=${cwd}/build/sparsefile bs=1 count=1 seek=10M
25
26 change_jobname NightlySave $JobName
27 start_test
28
29 cat <<END_OF_DATA >tmp/bconcmds
30 @output /dev/null
31 messages
32 @$out tmp/log1.out
33 setdebug level=1 storage=File sd
34 label storage=File volume=TestVolume001
35 run job=$JobName yes
36 wait
37 messages
38 @# 
39 @# now do a verify volume
40 @#
41 @$out ${cwd}/tmp/log2.out
42 setdebug level=12 dir
43 run job=VerifyVolume
44 yes
45 wait
46 messages
47 @$out ${cwd}/tmp/log3.out
48 run job=VerifyVolume level=DiskToCatalog
49 yes
50 wait
51 messages
52 quit
53 END_OF_DATA
54
55 #
56 #  ***FIXME***
57 # Note, add sparse file backup and check that checksum is
58 #  correct.  Bug #1140
59 #  create sparse file
60 #  dd if=/dev/zero of=sparsefile bs=1 count=0 seek=10M
61 #
62
63 run_bacula
64
65 sleep 2
66 check_for_zombie_jobs storage=File 
67 stop_bacula
68
69 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
70 bstat=$?
71 grep "^  Termination: *Verify OK" tmp/log2.out 2>&1 >/dev/null
72 rstat=$?
73 if test $rstat=0; then
74    grep "^  Termination: *Verify OK" tmp/log3.out 2>&1 >/dev/null
75    rstat=$?
76 fi
77 dstat=0
78 end_test