]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/no-chksum-test
Backport from BEE
[bacula/bacula] / regress / tests / no-chksum-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory without
4 # md5 signature then restore it.
5 #
6 TestName="no-chksum-test"
7 JobName=backup
8 . scripts/functions
9
10 scripts/cleanup
11 scripts/copy-confs
12
13 #
14 # Zap out any schedule in default conf file so that
15 #  it doesn't start during our test
16 #
17 outf="$tmp/sed_tmp"
18 echo "s%  Schedule =%# Schedule =%g" > $outf
19 echo "s%  signature =%# signature =%g" >> $outf
20 cp $scripts/bacula-dir.conf $tmp/1
21 sed -f $outf $tmp/1 >$scripts/bacula-dir.conf
22
23 change_jobname BackupClient1 $JobName
24 start_test
25
26 cat <<END_OF_DATA >$tmp/bconcmds
27 @$out /dev/null
28 messages
29 @$out $tmp/log1.out
30 label volume=TestVolume001 storage=File pool=File
31 END_OF_DATA
32
33 run_bacula
34
35 cat <<END_OF_DATA >$tmp/bconcmds
36 @$out $tmp/log1.out
37 run job=$JobName yes
38 wait
39 messages
40 quit
41 END_OF_DATA
42
43 run_bconsole
44
45 #
46 # Now do a second backup after making a few changes
47 #
48 touch ${cwd}/build/po/fr.po
49 #
50
51 run_bconsole
52
53 dd if=/dev/zero of=$cwd/build/bigfile count=500000 > /dev/null
54
55 run_bconsole
56
57 rm -f $cwd/build/bigfile 
58
59 cat <<END_OF_DATA >$tmp/bconcmds
60 @$out /dev/null
61 messages
62 @$out $tmp/log1.out
63 @# don't restore the bigfile, and try to see if it reads the whole volume
64 list files jobid=3
65 delete jobid=3
66 @# 
67 @# now do a restore
68 @#
69 @$out $tmp/log2.out  
70 setdebug level=150 trace=1 storage=File
71 restore where=$tmp/bacula-restores select all done
72 yes
73 wait
74 messages
75 quit
76 END_OF_DATA
77
78 run_bconsole
79
80 check_for_zombie_jobs storage=File
81 stop_bacula
82
83 check_two_logs
84 check_restore_diff
85 end_test