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