test/bin-test/test-dav-sync-symlink1.sh

changeset 686
ab159748055c
parent 685
487645580b5e
equal deleted inserted replaced
685:487645580b5e 686:ab159748055c
263 check_tmpout "1 file pulled" "test 6: wrong pull counter" 263 check_tmpout "1 file pulled" "test 6: wrong pull counter"
264 check_tmpout "0 conflicts" "test 6: wrong conflict counter (pull)" 264 check_tmpout "0 conflicts" "test 6: wrong conflict counter (pull)"
265 check_tmpout "0 errors" "test 6: wrong error counter (pull)" 265 check_tmpout "0 errors" "test 6: wrong error counter (pull)"
266 check_tmpout "intern1" "test 6: intern1 not updated (pull)" 266 check_tmpout "intern1" "test 6: intern1 not updated (pull)"
267 267
268
269 # ----------------------------------------------------------------------------
270 # test 7: change intern1 target on both sides
271 # expected result: conflict
272
273 # preparation: add regular files on both sides and sync
274
275 echo "test7-new2a" > tmp-sync/test7a/new2a
276 echo "test7-new2b" > tmp-sync/test7b/new2b
277
278 dav_sync_push test7a "test 7: push a failed"
279 check_tmpout "1 file pushed" "test 7: wrong push counter (push a)"
280 check_tmpout "0 conflicts" "test 7: wrong conflict counter (push a)"
281 check_tmpout "0 errors" "test 7: wrong error counter (push a)"
282
283 dav_sync_push test7b "test 7: push b failed"
284 check_tmpout "1 file pushed" "test 7: wrong push counter (push b)"
285 check_tmpout "0 conflicts" "test 7: wrong conflict counter (push b)"
286 check_tmpout "0 errors" "test 7: wrong error counter (push b)"
287
288 dav_sync_pull test7a "test 7: pull a failed"
289 check_tmpout "1 file pulled" "test 7: wrong pull counter (pull a)"
290 check_tmpout "0 conflicts" "test 7: wrong conflict counter (pull a)"
291 check_tmpout "0 errors" "test 7: wrong error counter (pull a)"
292
293 dav_sync_pull test7b "test 7: pull b failed"
294 check_tmpout "1 file pulled" "test 7: wrong pull counter (pull b)"
295 check_tmpout "0 conflicts" "test 7: wrong conflict counter (pull b)"
296 check_tmpout "0 errors" "test 7: wrong error counter (pull b)"
297
298 # test: change symlinks
299
300 rm -f tmp-sync/test7a/intern1
301 ln -s -r tmp-sync/test7a/new2a tmp-sync/test7a/intern1
302
303 rm -f tmp-sync/test7b/intern1
304 ln -s -r tmp-sync/test7b/new2b tmp-sync/test7b/intern1
305
306 dav_sync_push test7a "test 7: push a failed (a)"
307 check_tmpout "1 file pushed" "test 7: wrong push counter (push a 2)"
308 check_tmpout "0 conflicts" "test 7: wrong conflict counter (push a 2)"
309 check_tmpout "0 errors" "test 7: wrong error counter (push a 2)"
310 check_tmpout "intern1" "test 7: intern1 not updated (push a 2)"
311
312 dav_sync_push test7b "test 7: push b failed (b)"
313 check_tmpout "1 conflict" "test 7: wrong conflict counter (push b 2)"
314 check_tmpout "0 errors" "test 7: wrong error counter (push b 2)"
315
316
317 # ----------------------------------------------------------------------------
318 # test 8: pull test7b
319 # expected result: conflict
320
321 dav_sync_pull test7b "test 8: pull failed"
322 check_tmpout "1 file pulled" "test8: wrong pull counter (pull)"
323 check_tmpout "1 conflict" "test 8: wrong conflict counter (pull)"
324 check_tmpout "0 errors" "test 8: wrong error counter (pull)"
325
326 $DAV_SYNC_BIN delete-conflicts test7b > /dev/null 2>&1
327 if [ $? -ne 0 ]; then
328 echo "test 8: delete-conflicts failed"
329 exit 2
330 fi
331
332 dav_sync_pull test7b "test 8: pull 2 failed"
333 check_tmpout "0 files pulled" "test8: wrong pull counter (pull 2)"
334 check_tmpout "0 conflicts" "test 8: wrong conflict counter (pull 2)"
335 check_tmpout "0 errors" "test 8: wrong error counter (pull 2)"
336
337 dav_sync_push test7b "test 8: push b failed (b)"
338 check_tmpout "0 files pushed" "test 8: wrong push counter"
339 check_tmpout "0 conflicts" "test 8: wrong conflict counter (push)"
340 check_tmpout "0 errors" "test 8: wrong error counter (push)"
341
342
343 # ----------------------------------------------------------------------------
344 # test 9: add new link on both sides
345 # expected result: conflict
346
347 ln -s -r tmp-sync/test7a/new2a tmp-sync/test7a/newlink1
348 ln -s -r tmp-sync/test7b/new2b tmp-sync/test7b/newlink1
349
350 dav_sync_push test7a "test 9: push a failed (a)"
351 check_tmpout "1 file pushed" "test 9: wrong push counter (push a)"
352 check_tmpout "0 conflicts" "test 9: wrong conflict counter (push a)"
353 check_tmpout "0 errors" "test 9: wrong error counter (push a)"
354 check_tmpout "newlink1" "test 9: intern1 not updated (push a)"
355
356 dav_sync_push test7b "test 9: push b failed (b)"
357 check_tmpout "1 conflict" "test 9: wrong conflict counter (push b)"
358 check_tmpout "0 errors" "test 9: wrong error counter (push b)"
359
360 # pull
361
362 dav_sync_pull test7b "test 9: pull failed"
363 check_tmpout "1 file pulled" "test9: wrong pull counter (pull)"
364 check_tmpout "1 conflict" "test 9: wrong conflict counter (pull)"
365 check_tmpout "0 errors" "test 9: wrong error counter (pull)"
366
367 $DAV_SYNC_BIN delete-conflicts test7b > /dev/null 2>&1
368 if [ $? -ne 0 ]; then
369 echo "test 9: delete-conflicts failed"
370 exit 2
371 fi

mercurial