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

changeset 686
ab159748055c
parent 685
487645580b5e
--- a/test/bin-test/test-dav-sync-symlink1.sh	Sat Nov 23 17:49:18 2019 +0100
+++ b/test/bin-test/test-dav-sync-symlink1.sh	Sun Nov 24 12:40:28 2019 +0100
@@ -265,3 +265,107 @@
 check_tmpout "0 errors" "test 6: wrong error counter (pull)"
 check_tmpout "intern1" "test 6: intern1 not updated (pull)"
 
+
+# ----------------------------------------------------------------------------
+# test 7: change intern1 target on both sides
+# expected result: conflict
+
+# preparation: add regular files on both sides and sync
+
+echo "test7-new2a" > tmp-sync/test7a/new2a
+echo "test7-new2b" > tmp-sync/test7b/new2b
+
+dav_sync_push test7a "test 7: push a failed"
+check_tmpout "1 file pushed" "test 7: wrong push counter (push a)"
+check_tmpout "0 conflicts" "test 7: wrong conflict counter (push a)"
+check_tmpout "0 errors" "test 7: wrong error counter (push a)"
+
+dav_sync_push test7b "test 7: push b failed"
+check_tmpout "1 file pushed" "test 7: wrong push counter (push b)"
+check_tmpout "0 conflicts" "test 7: wrong conflict counter (push b)"
+check_tmpout "0 errors" "test 7: wrong error counter (push b)"
+
+dav_sync_pull test7a "test 7: pull a failed"
+check_tmpout "1 file pulled" "test 7: wrong pull counter (pull a)"
+check_tmpout "0 conflicts" "test 7: wrong conflict counter (pull a)"
+check_tmpout "0 errors" "test 7: wrong error counter (pull a)"
+
+dav_sync_pull test7b "test 7: pull b failed"
+check_tmpout "1 file pulled" "test 7: wrong pull counter (pull b)"
+check_tmpout "0 conflicts" "test 7: wrong conflict counter (pull b)"
+check_tmpout "0 errors" "test 7: wrong error counter (pull b)"
+
+# test: change symlinks
+
+rm -f tmp-sync/test7a/intern1
+ln -s -r tmp-sync/test7a/new2a tmp-sync/test7a/intern1
+
+rm -f tmp-sync/test7b/intern1
+ln -s -r tmp-sync/test7b/new2b tmp-sync/test7b/intern1
+
+dav_sync_push test7a "test 7: push a failed (a)"
+check_tmpout "1 file pushed" "test 7: wrong push counter (push a 2)"
+check_tmpout "0 conflicts" "test 7: wrong conflict counter (push a 2)"
+check_tmpout "0 errors" "test 7: wrong error counter (push a 2)"
+check_tmpout "intern1" "test 7: intern1 not updated (push a 2)"
+
+dav_sync_push test7b "test 7: push b failed (b)"
+check_tmpout "1 conflict" "test 7: wrong conflict counter (push b 2)"
+check_tmpout "0 errors" "test 7: wrong error counter (push b 2)"
+
+
+# ----------------------------------------------------------------------------
+# test 8: pull test7b
+# expected result: conflict
+
+dav_sync_pull test7b "test 8: pull failed"
+check_tmpout "1 file pulled" "test8: wrong pull counter (pull)"
+check_tmpout "1 conflict" "test 8: wrong conflict counter (pull)"
+check_tmpout "0 errors" "test 8: wrong error counter (pull)"
+
+$DAV_SYNC_BIN delete-conflicts test7b > /dev/null 2>&1
+if [ $? -ne 0 ]; then
+	echo "test 8: delete-conflicts failed"
+	exit 2
+fi
+
+dav_sync_pull test7b "test 8: pull 2 failed"
+check_tmpout "0 files pulled" "test8: wrong pull counter (pull 2)"
+check_tmpout "0 conflicts" "test 8: wrong conflict counter (pull 2)"
+check_tmpout "0 errors" "test 8: wrong error counter (pull 2)"
+
+dav_sync_push test7b "test 8: push b failed (b)"
+check_tmpout "0 files pushed" "test 8: wrong push counter"
+check_tmpout "0 conflicts" "test 8: wrong conflict counter (push)"
+check_tmpout "0 errors" "test 8: wrong error counter (push)"
+
+
+# ----------------------------------------------------------------------------
+# test 9: add new link on both sides
+# expected result: conflict
+
+ln -s -r tmp-sync/test7a/new2a tmp-sync/test7a/newlink1
+ln -s -r tmp-sync/test7b/new2b tmp-sync/test7b/newlink1
+
+dav_sync_push test7a "test 9: push a failed (a)"
+check_tmpout "1 file pushed" "test 9: wrong push counter (push a)"
+check_tmpout "0 conflicts" "test 9: wrong conflict counter (push a)"
+check_tmpout "0 errors" "test 9: wrong error counter (push a)"
+check_tmpout "newlink1" "test 9: intern1 not updated (push a)"
+
+dav_sync_push test7b "test 9: push b failed (b)"
+check_tmpout "1 conflict" "test 9: wrong conflict counter (push b)"
+check_tmpout "0 errors" "test 9: wrong error counter (push b)"
+
+# pull
+
+dav_sync_pull test7b "test 9: pull failed"
+check_tmpout "1 file pulled" "test9: wrong pull counter (pull)"
+check_tmpout "1 conflict" "test 9: wrong conflict counter (pull)"
+check_tmpout "0 errors" "test 9: wrong error counter (pull)"
+
+$DAV_SYNC_BIN delete-conflicts test7b > /dev/null 2>&1
+if [ $? -ne 0 ]; then
+	echo "test 9: delete-conflicts failed"
+	exit 2
+fi

mercurial