154 check_tmpout "1 file pushed" "push 5: wrong push counter" |
154 check_tmpout "1 file pushed" "push 5: wrong push counter" |
155 check_tmpout "0 conflicts" "push 5: wrong conflict counter" |
155 check_tmpout "0 conflicts" "push 5: wrong conflict counter" |
156 check_tmpout "0 files deleted" "push 5: wrong delete counter" |
156 check_tmpout "0 files deleted" "push 5: wrong delete counter" |
157 check_tmpout "0 errors" "push 5: wrong error counter" |
157 check_tmpout "0 errors" "push 5: wrong error counter" |
158 |
158 |
|
159 # 6. test |
|
160 # add deep dir hierarchy and some files, test if mkcol order is fine |
|
161 # expected result: multiple mkcol requests and some puts after that |
|
162 mkdir -p tmp-sync/test1a/dir_a/1/2/3/4/5/6/7/8 |
|
163 mkdir -p tmp-sync/test1a/dir_a/1/2/3/a/b/c/d |
|
164 mkdir -p tmp-sync/test1a/dir_a/i/j/k |
|
165 mkdir -p tmp-sync/test1a/dir_b/1/2/3/4/5/6/7/8 |
|
166 mkdir -p tmp-sync/test1a/dir_b/1/2/3/a/b/c/d |
|
167 mkdir -p tmp-sync/test1a/dir_b/i/j/k |
|
168 mkdir -p tmp-sync/test1a/dir_c/sub1/sub2/sub3/sub4 |
|
169 mkdir -p tmp-sync/test1a/dir_c/sub1/sub2/1 |
|
170 mkdir -p tmp-sync/test1a/dir_c/sub1/sub2/2 |
|
171 mkdir -p tmp-sync/test1a/dir_c/sub1/sub2/3 |
|
172 mkdir -p tmp-sync/test1a/dir_c/sub1/sub2/4 |
|
173 mkdir -p tmp-sync/test1a/dir_c/sub1/sub2/5 |
|
174 mkdir -p tmp-sync/test1a/dir_c/sub_a/x |
|
175 mkdir -p tmp-sync/test1a/dir_c/sub_a/y/d1/d2/d3 |
|
176 touch tmp-sync/test1a/dir_a/1/2/3/4/5/6/7/8/file1 |
|
177 touch tmp-sync/test1a/dir_a/1/2/3/4/5/6/7/file1 |
|
178 touch tmp-sync/test1a/dir_a/1/2/3/4/5/6/file1 |
|
179 touch tmp-sync/test1a/dir_a/1/2/3/a/b/c/d/d_file1 |
|
180 touch tmp-sync/test1a/dir_a/1/2/3/a/b/b_file1 |
|
181 touch tmp-sync/test1a/dir_a/a_file |
|
182 echo "test6-file-1" > tmp-sync/test1a/dir_b/1/2/3/4/5/6/7/8/t6f1-8 |
|
183 echo "test6-file-2" > tmp-sync/test1a/dir_b/i/t6f2-i |
|
184 echo "test6-file-3" > tmp-sync/test1a/dir_c/sub1/sub2/sub3/sub4/t6f3-s4 |
|
185 echo "test6-file-4" > tmp-sync/test1a/dir_c/sub1/sub2/3/t6f4-3 |
|
186 |
|
187 dav_sync_push test1a "push 6 failed" |
|
188 check_tmpout "10 files pushed" "push6: wrong push counter" |
|
189 check_tmpout "0 files deleted" "push6: wrong delete counter" |
|
190 check_tmpout "0 conflicts" "push6: wrong conflict counter" |
|
191 check_tmpout "0 errors" "push6: wrong error counter" |
|
192 OUT=`grep mkcol tmp-sync/out.txt | wc -l` |
|
193 if [ "$OUT" != "48" ]; |
|
194 then |
|
195 echo "push 6: number of mkcol output lines not 48" |
|
196 exit 2 |
|
197 fi |
|
198 |
|
199 # 7. test |
|
200 # delete file |
|
201 # expected result: delete file on server |
|
202 rm -f tmp-sync/test1a/file1 |
|
203 |
|
204 dav_sync_push test1a "push 7 failed" |
|
205 check_tmpout "0 files pushed" "push7: wrong push counter" |
|
206 check_tmpout "1 file deleted" "push7: wrong delete counter" |
|
207 check_tmpout "0 conflicts" "push7: wrong conflict counter" |
|
208 check_tmpout "0 errors" "push7: wrong error counter" |
|
209 |
|
210 # 8. test |
|
211 # do nothing, test if double delete happens |
|
212 # expected result: no delete |
|
213 |
|
214 dav_sync_push test1a "push 8 failed" |
|
215 check_tmpout "0 files pushed" "push8: wrong push counter" |
|
216 check_tmpout "0 files deleted" "push8: wrong delete counter" |
|
217 check_tmpout "0 conflicts" "push8: wrong conflict counter" |
|
218 check_tmpout "0 errors" "push8: wrong error counter" |
|
219 |
|
220 # 9. test |
|
221 # delete multiple files |
|
222 # expected result: multiple delete requests |
|
223 |
|
224 rm -Rf tmp-sync/test1a/dir_a |
|
225 rm -f tmp-sync/test1a/dir_b/1/2/3/4/5/6/7/8/t6f1-8 |
|
226 rm -f tmp-sync/test1a/dir_b/i/t6f2-i |
|
227 |
|
228 dav_sync_push test1a "push 9 failed" |
|
229 |
|
230 # don't test if there was a single delete for each collection |
|
231 # and don't check if the delete counter has a specific value |
|
232 # because maybe there will be some optimizations |
|
233 check_tmpout "0 files pushed" "push8: wrong push counter" |
|
234 check_tmpout "0 conflicts" "push8: wrong conflict counter" |
|
235 check_tmpout "0 errors" "push8: wrong error counter" |
|
236 |
|
237 OUT=`grep "delete: /dir_a/" tmp-sync/out.txt` |
|
238 if [ $? -ne 0 ]; |
|
239 then |
|
240 echo "missing: delete /dir_a/" |
|
241 exit 2 |
|
242 fi |
|
243 OUT=`grep "delete: /dir_b/i/t6f2-i" tmp-sync/out.txt` |
|
244 if [ $? -ne 0 ]; |
|
245 then |
|
246 echo "missing: delete: /dir_b/i/t6f2-i" |
|
247 exit 2 |
|
248 fi |
|
249 OUT=`grep "delete: /dir_b/1/2/3/4/5/6/7/8/t6f1-8" tmp-sync/out.txt` |
|
250 if [ $? -ne 0 ]; |
|
251 then |
|
252 echo "missing: delete: /dir_b/1/2/3/4/5/6/7/8/t6f1-8" |
|
253 exit 2 |
|
254 fi |
|
255 |
|
256 |
|
257 |