]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bscan-1t1d-tape
Update
[bacula/bacula] / regress / tests / bscan-1t1d-tape
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory using the compressed option
4 #   then backup four times, each with incremental then 
5 #   do a bscan and restore.
6 #   It should require at least 4 different bsrs.
7 #
8 TestName="bscan-1t1d-tape"
9 JobName=bscantape
10 . scripts/functions
11
12 copy_tape_confs
13
14 echo "${cwd}/build" >tmp/file-list
15
16 cp ${cwd}/bin/bacula-sd.conf tmp/1
17 sed "s%# Maximum File Size%  Maximum File Size%" tmp/1 >${cwd}/bin/bacula-sd.conf
18
19 change_jobname NightlySave $JobName
20 start_test
21
22 cat <<END_OF_DATA >tmp/bconcmds
23 @output /dev/null
24 estimate job=$JobName listing
25 estimate job=$JobName listing
26 messages
27 @$out tmp/log1.out
28 setdebug level=2 storage=DDS-4
29 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
30 run job=$JobName level=Full yes 
31 wait
32 run job=$JobName level=Full yes
33 wait
34 messages
35 quit
36 END_OF_DATA
37
38 run_bacula
39 check_for_zombie_jobs storage=DDS-4
40
41 echo "Backup 1 done"
42 # make some files for the incremental to pick up
43 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
44 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
45    
46 #
47 # run a second job
48 #
49 cat <<END_OF_DATA >tmp/bconcmds
50 @$out /dev/null
51 messages
52 @$out tmp/log1.out
53 run job=$JobName level=Incremental yes
54 wait
55 messages
56 quit
57 END_OF_DATA
58
59 run_bconsole
60 scripts/check_for_zombie_jobs storage=DDS-4
61
62 echo "Backup 2 done"
63 touch ${cwd}/build/src/dird/*.c
64 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
65 #
66 # run a third job
67 #
68
69 run_bconsole
70 scripts/check_for_zombie_jobs storage=DDS-4
71
72 echo "Backup 3 done"
73 # make some files for the incremental to pick up
74 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
75 #echo "abc" > ${cwd}/build/src/lib/dummy
76 #
77 # run a fourth job
78 #
79
80 run_bconsole
81 scripts/check_for_zombie_jobs storage=DDS-4
82
83 stop_bacula
84
85 echo "Backup 4 done"
86 #
87 # now drop and recreate the database
88 #
89 cd bin
90 ./drop_bacula_tables >/dev/null 2>&1
91 ./make_bacula_tables >/dev/null 2>&1
92 ./grant_bacula_privileges 2>&1 >/dev/null
93 cd ..
94
95 echo "volume=TestVolume001" >tmp/bscan.bsr
96 if test "$debug" -eq 1 ; then
97   bin/bscan -w working -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4                
98 else
99   bin/bscan -w working -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 2>&1 >/dev/null
100 fi
101
102 cat <<END_OF_DATA >tmp/bconcmds
103 @$out /dev/null
104 messages
105 @$out tmp/log2.out
106 @# 
107 @# now do a restore
108 @#
109 restore where=tmp/bacula-restores select all storage=DDS-4 done
110 yes
111 wait
112 messages
113 @$out
114 quit
115 END_OF_DATA
116
117 run_bacula
118 check_for_zombie_jobs storage=DDS-4
119 stop_bacula
120 rm -f  ${cwd}/build/src/lib/dummy
121
122 check_two_logs
123 check_restore_diff
124 end_test