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