]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/incremental-test
Many debug code fixes in regression scripts
[bacula/bacula] / regress / tests / incremental-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory then create some           
4 #   new files, do an Incremental and restore those two files.
5 #
6 TestName="incremental-test"
7 JobName=Incremental 
8 . scripts/functions
9
10 ${rscripts}/cleanup
11 ${rscripts}/copy-test-confs
12 echo "${tmpsrc}" >${tmp}/file-list
13 mkdir -p ${tmpsrc}
14 cp -p ${src}/src/dird/*.c ${tmpsrc}
15 cd ${tmp}
16 echo "${tmpsrc}/ficheriro1.txt" >restore-list
17 echo "${tmpsrc}/ficheriro2.txt" >>restore-list
18 cd ${cwd}
19
20 change_jobname CompressedTest $JobName
21 start_test
22
23 cat <<END_OF_DATA >${tmp}/bconcmds
24 @$out /dev/null
25 messages
26 @$out ${tmp}/log1.out
27 @#setdebug level=100 storage=File
28 @#setdebug level=200 client
29 @#setdebug level=100 director
30 label storage=File volume=TestVolume001
31 label storage=File volume=TestVolume002
32 run job=$JobName yes
33 wait
34 messages
35 quit
36 END_OF_DATA
37
38 run_bacula
39 check_for_zombie_jobs storage=File
40 #
41 # Now create two new files to be restored later
42 #
43 sleep 1
44 echo "ficheriro1.txt" >${tmpsrc}/ficheriro1.txt
45 cp -f ${tmpsrc}/dird.c ${tmpsrc}/ficheriro2.txt
46
47 cat <<END_OF_DATA >${tmp}/bconcmds
48 @$out /dev/null
49 messages
50 @$out ${tmp}/log1.out
51 @# Force Incremental on the second Volume
52 update volume=TestVolume001 VolStatus=Used
53 run level=Differential job=$JobName yes
54 wait
55 messages
56 quit
57 END_OF_DATA
58
59 run_bconsole
60
61 sleep 1
62 touch ${tmpsrc}/ficheriro1.txt
63 touch ${tmpsrc}/ficheriro2.txt
64
65 cat <<END_OF_DATA >${tmp}/bconcmds
66 @$out /dev/null
67 messages
68 @$out ${tmp}/log1.out
69 run level=Incremental job=$JobName yes
70 wait
71 messages
72 quit
73 END_OF_DATA
74
75 run_bconsole
76
77 sleep 1
78 cd ${tmpsrc}
79 cp -f ficheriro2.txt 1
80 sed "s%a%b%g" 1 >ficheriro2.txt
81 rm -f 1
82 cd ${cwd}
83 cat <<END_OF_DATA >${tmp}/bconcmds
84 @$out /dev/null
85 messages
86 @$out ${tmp}/log1.out
87 run level=Differential job=$JobName yes
88 wait
89 messages
90 quit
91 END_OF_DATA
92
93 run_bconsole
94
95 sleep 1
96 touch ${tmpsrc}/ficheriro1.txt
97 touch ${tmpsrc}/ficheriro2.txt
98 cat <<END_OF_DATA >${tmp}/bconcmds
99 @$out /dev/null
100 messages
101 @$out ${tmp}/log1.out
102 run level=Incremental job=$JobName yes
103 wait
104 messages
105 quit
106 END_OF_DATA
107
108 run_bconsole
109
110 sleep 1
111 touch ${tmpsrc}/ficheriro1.txt
112 touch ${tmpsrc}/ficheriro2.txt
113 cat <<END_OF_DATA >${tmp}/bconcmds
114 @$out /dev/null
115 messages
116 @$out ${tmp}/log1.out
117 run level=Incremental job=$JobName yes
118 wait
119 messages
120 quit
121 END_OF_DATA
122
123 run_bconsole
124
125 sleep 1
126 touch ${tmpsrc}/ficheriro1.txt
127 touch ${tmpsrc}/ficheriro2.txt
128 cat <<END_OF_DATA >${tmp}/bconcmds
129 @$out /dev/null
130 messages
131 @$out ${tmp}/log1.out
132 run level=Incremental job=$JobName yes
133 wait
134 messages
135 quit
136 END_OF_DATA
137
138 run_bconsole
139 sleep 1
140 touch ${tmpsrc}/ficheriro1.txt
141 touch ${tmpsrc}/ficheriro2.txt
142
143 cat <<END_OF_DATA >${tmp}/bconcmds
144 @$out /dev/null
145 messages
146 @$out ${tmp}/log1.out
147 setdebug level=200 storage=File
148 run level=Incremental job=$JobName yes
149 wait
150 messages
151 @# 
152 @# now do a restore
153 @#
154 @$out ${tmp}/log2.out
155 setdebug level=10 storage=File
156 restore where=${tmp}/bacula-restores storage=File file=<${tmp}/restore-list
157 yes
158 wait
159 status storage=File
160 messages
161 quit
162 END_OF_DATA
163
164 run_bconsole
165 check_for_zombie_jobs storage=File
166 stop_bacula
167
168 check_two_logs
169 #
170 # Delete .c files because we will only restored the txt files
171 #
172 rm -f ${tmpsrc}/*.c
173 check_restore_tmp_build_diff
174 end_test