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

changeset 667
6cdcd3e4e368
parent 665
ec8c9201a974
child 671
5256d7eb69e7
equal deleted inserted replaced
666:97061483d06e 667:6cdcd3e4e368
395 check_tmpout "0 files pushed" "test 9: wrong push counter" 395 check_tmpout "0 files pushed" "test 9: wrong push counter"
396 check_tmpout "0 conflicts" "test 9: wrong conflict counter (push)" 396 check_tmpout "0 conflicts" "test 9: wrong conflict counter (push)"
397 check_tmpout "0 errors" "test 9: wrong error counter (push)" 397 check_tmpout "0 errors" "test 9: wrong error counter (push)"
398 LN=`cat tmp-sync/out.txt | wc -l` 398 LN=`cat tmp-sync/out.txt | wc -l`
399 if [ "$LN" != "1" ]; then 399 if [ "$LN" != "1" ]; then
400 echo "test 7: wrong output (push)" 400 echo "test 9: wrong output (push)"
401 exit 2 401 exit 2
402 fi 402 fi
403 403
404 dav_sync_pull test4b "test 9: pull failed" 404 dav_sync_pull test4b "test 9: pull failed"
405 check_tmpout "0 files pulled" "test 9: wrong pull counter" 405 check_tmpout "0 files pulled" "test 9: wrong pull counter"
408 LN=`cat tmp-sync/out.txt | wc -l` 408 LN=`cat tmp-sync/out.txt | wc -l`
409 if [ "$LN" != "1" ]; then 409 if [ "$LN" != "1" ]; then
410 echo "test 9: wrong output (pull)" 410 echo "test 9: wrong output (pull)"
411 exit 2 411 exit 2
412 fi 412 fi
413
413 414
414 # ---------------------------------------------------------------------------- 415 # ----------------------------------------------------------------------------
415 # test 10: add tags to files and sync 416 # test 10: add tags to files and sync
416 # expected result: tags synced 417 # expected result: tags synced
417 418
446 $DAV_SYNC_BIN list-tags -s test4b tmp-sync/test4b/file4 > tmp-sync/out.txt 447 $DAV_SYNC_BIN list-tags -s test4b tmp-sync/test4b/file4 > tmp-sync/out.txt
447 check_tmpout "test" "test 10: file3 missing tag" 448 check_tmpout "test" "test 10: file3 missing tag"
448 $DAV_SYNC_BIN list-tags -s test4b tmp-sync/test4b/dir1/file2 > tmp-sync/out.txt 449 $DAV_SYNC_BIN list-tags -s test4b tmp-sync/test4b/dir1/file2 > tmp-sync/out.txt
449 check_tmpout "test" "test 10: file2 missing tag" 450 check_tmpout "test" "test 10: file2 missing tag"
450 451
452
453 # ----------------------------------------------------------------------------
454 # test 11: check if double update happens
455 # expected result: nothing happens
456
457 dav_sync_push test4a "test 11: push failed"
458 check_tmpout "0 files pushed" "test 11: wrong push counter"
459 check_tmpout "0 conflicts" "test 11: wrong conflict counter (push)"
460 check_tmpout "0 errors" "test 11: wrong error counter (push)"
461 LN=`cat tmp-sync/out.txt | wc -l`
462 if [ "$LN" != "1" ]; then
463 echo "test 11: wrong output (push)"
464 exit 2
465 fi
466
467 dav_sync_pull test4b "test 11: pull failed"
468 check_tmpout "0 files pulled" "test 11: wrong pull counter"
469 check_tmpout "0 conflicts" "test 11: wrong conflict counter (pull)"
470 check_tmpout "0 errors" "test 11: wrong error counter (pull)"
471 LN=`cat tmp-sync/out.txt | wc -l`
472 if [ "$LN" != "1" ]; then
473 echo "test 11: wrong output (pull)"
474 exit 2
475 fi
476
477
478 # ----------------------------------------------------------------------------
479 # test 12: add tag, push test4a and pull test4a
480 # expected result: tags pushed, nothing pulled
481
482 $DAV_SYNC_BIN add-tag -s test4a tmp-sync/test4a/file1 work
483 touch -t 03011100 tmp-sync/test4a/file1
484
485 dav_sync_push test4a "test 12: push failed"
486 check_tmpout "0 conflicts" "test 12: wrong conflict counter (push)"
487 check_tmpout "0 errors" "test 12: wrong error counter (push)"
488 check_tmpout "update: /file1" "test 12: file 1 not pushed"
489
490 dav_sync_pull test4a "test 12: pull failed"
491 check_tmpout "0 files pulled" "test 12: wrong pull counter"
492 check_tmpout "0 conflicts" "test 12: wrong conflict counter (pull)"
493 check_tmpout "0 errors" "test 12: wrong error counter (pull)"
494 LN=`cat tmp-sync/out.txt | wc -l`
495 if [ "$LN" != "1" ]; then
496 echo "test 12: wrong output (pull)"
497 exit 2
498 fi
499
500
501 # ----------------------------------------------------------------------------
502 # test 13: pull test4b
503 # expected result: update file1, sync tags
504
505 dav_sync_pull test4b "test 13: pull failed"
506 check_tmpout "0 conflicts" "test 13: wrong conflict counter (pull)"
507 check_tmpout "0 errors" "test 13: wrong error counter (pull)"
508 check_tmpout "update: /file1" "test 13: file 1 not pulled"
509
510 $DAV_SYNC_BIN list-tags -s test4b tmp-sync/test4b/file1 > tmp-sync/out.txt
511 check_tmpout "test" "test 13: file1 missing tag 'test'"
512 check_tmpout "work" "test 13: file1 missing tag 'work'"
513
514
515 # ----------------------------------------------------------------------------
516 # test 14: remove tags from file4 and sync
517 # expected result: tags removed
518
519 $DAV_SYNC_BIN remove-tag -s test4a tmp-sync/test4a/file4 test
520 touch -t 04011100 tmp-sync/test4a/file4
521
522 dav_sync_push test4a "test 14: push failed"
523 check_tmpout "0 conflicts" "test 14: wrong conflict counter (push)"
524 check_tmpout "0 errors" "test 14: wrong error counter (push)"
525 check_tmpout "update: /file4" "test 14: file 4 not pushed"
526
527 dav_sync_pull test4b "test 14: pull failed"
528 check_tmpout "0 conflicts" "test 14: wrong conflict counter (pull)"
529 check_tmpout "0 errors" "test 14: wrong error counter (pull)"
530 check_tmpout "update: /file4" "test 14: file 4 not pulled"
531
532 LN=`$DAV_SYNC_BIN list-tags -s test4b tmp-sync/test4b/file4 | wc -l`
533 if [ "$LN" != "0" ]; then
534 echo "test 14: wrong tag count"
535 exit 2
536 fi
537

mercurial