237 if [ "$LASTMODIFIED_PART2" != "$LASTMODIFIED_PART2_2" ]; then |
237 if [ "$LASTMODIFIED_PART2" != "$LASTMODIFIED_PART2_2" ]; then |
238 echo "test 3: part 2 updated" |
238 echo "test 3: part 2 updated" |
239 exit 2 |
239 exit 2 |
240 fi |
240 fi |
241 |
241 |
|
242 |
|
243 # ---------------------------------------------------------------------------- |
|
244 # test 4: add new block to big1 and sync |
|
245 # expected result: block synced |
|
246 |
|
247 sleep 2 |
|
248 |
|
249 cat tmp-sync/test6a/big1 tmp-sync/xb > tmp-sync/test6a/big_tmp |
|
250 rm tmp-sync/test6a/big1 |
|
251 mv tmp-sync/test6a/big_tmp tmp-sync/test6a/big1 |
|
252 |
|
253 dav_sync_push test6a "test 4: push failed" |
|
254 check_tmpout "1 file pushed" "test 4: wrong push counter" |
|
255 check_tmpout "0 conflicts" "test 4: wrong conflict counter (push)" |
|
256 check_tmpout "0 errors" "test 4: wrong error counter (push)" |
|
257 |
|
258 dav_sync_pull test6b "test 4: pull failed" |
|
259 check_tmpout "1 file pulled" "test 4: wrong pull counter" |
|
260 check_tmpout "0 conflicts" "test 4: wrong conflict counter (pull)" |
|
261 check_tmpout "0 errors" "test 4: wrong error counter (pull)" |
|
262 |
|
263 HASH1=`cat tmp-sync/test6a/big1 | sha256sum` |
|
264 HASH2=`cat tmp-sync/test6b/big1 | sha256sum` |
|
265 if [ "$HASH1" != "$HASH2" ]; then |
|
266 echo "test 4: big1 not equal" |
|
267 exit 2 |
|
268 fi |
|
269 |
|
270 |
|
271 # ---------------------------------------------------------------------------- |
|
272 # test 5: add some extra bytes to big1 and sync |
|
273 # expected result: block synced |
|
274 |
|
275 sleep 2 |
|
276 |
|
277 echo "test5-mod1" >> tmp-sync/test6a/big1 |
|
278 |
|
279 dav_sync_push test6a "test 5: push failed" |
|
280 check_tmpout "1 file pushed" "test 5: wrong push counter" |
|
281 check_tmpout "0 conflicts" "test 5: wrong conflict counter (push)" |
|
282 check_tmpout "0 errors" "test 5: wrong error counter (push)" |
|
283 |
|
284 dav_sync_pull test6b "test 5: pull failed" |
|
285 check_tmpout "1 file pulled" "test 5: wrong pull counter" |
|
286 check_tmpout "0 conflicts" "test 5: wrong conflict counter (pull)" |
|
287 check_tmpout "0 errors" "test 5: wrong error counter (pull)" |
|
288 |
|
289 HASH1=`cat tmp-sync/test6a/big1 | sha256sum` |
|
290 HASH2=`cat tmp-sync/test6b/big1 | sha256sum` |
|
291 if [ "$HASH1" != "$HASH2" ]; then |
|
292 echo "test 5: big1 not equal" |
|
293 exit 2 |
|
294 fi |
|
295 |
|
296 |
|
297 # ---------------------------------------------------------------------------- |
|
298 # test 6: decrease size of big1 and sync |
|
299 # expected result: file truncated |
|
300 |
|
301 # no sleep |
|
302 cat tmp-sync/xc tmp-sync/xb tmp-sync/xc > tmp-sync/test6a/big1 |
|
303 |
|
304 dav_sync_push test6a "test 6: push failed" |
|
305 check_tmpout "1 file pushed" "test 6: wrong push counter" |
|
306 check_tmpout "0 conflicts" "test 6: wrong conflict counter (push)" |
|
307 check_tmpout "0 errors" "test 6: wrong error counter (push)" |
|
308 |
|
309 dav_sync_pull test6b "test 6: pull failed" |
|
310 check_tmpout "1 file pulled" "test 6: wrong pull counter" |
|
311 check_tmpout "0 conflicts" "test 6: wrong conflict counter (pull)" |
|
312 check_tmpout "0 errors" "test 6: wrong error counter (pull)" |
|
313 |
|
314 HASH1=`cat tmp-sync/test6a/big1 | sha256sum` |
|
315 HASH2=`cat tmp-sync/test6b/big1 | sha256sum` |
|
316 if [ "$HASH1" != "$HASH2" ]; then |
|
317 echo "test 6: big1 not equal" |
|
318 exit 2 |
|
319 fi |
|
320 |
|
321 |