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

changeset 667
6cdcd3e4e368
parent 665
ec8c9201a974
child 671
5256d7eb69e7
--- a/test/bin-test/test-dav-sync-metadata1.sh	Sun Oct 20 10:35:02 2019 +0200
+++ b/test/bin-test/test-dav-sync-metadata1.sh	Sun Oct 20 11:11:22 2019 +0200
@@ -397,7 +397,7 @@
 check_tmpout "0 errors" "test 9: wrong error counter (push)"
 LN=`cat tmp-sync/out.txt | wc -l`
 if [ "$LN" != "1" ]; then
-	echo "test 7: wrong output (push)"
+	echo "test 9: wrong output (push)"
 	exit 2
 fi
 
@@ -411,6 +411,7 @@
 	exit 2
 fi
 
+
 # ----------------------------------------------------------------------------
 # test 10: add tags to files and sync
 # expected result: tags synced
@@ -448,3 +449,89 @@
 $DAV_SYNC_BIN list-tags -s test4b tmp-sync/test4b/dir1/file2 > tmp-sync/out.txt
 check_tmpout "test" "test 10: file2 missing tag"
 
+
+# ----------------------------------------------------------------------------
+# test 11: check if double update happens
+# expected result: nothing happens
+
+dav_sync_push test4a "test 11: push failed"
+check_tmpout "0 files pushed" "test 11: wrong push counter"
+check_tmpout "0 conflicts" "test 11: wrong conflict counter (push)"
+check_tmpout "0 errors" "test 11: wrong error counter (push)"
+LN=`cat tmp-sync/out.txt | wc -l`
+if [ "$LN" != "1" ]; then
+	echo "test 11: wrong output (push)"
+	exit 2
+fi
+
+dav_sync_pull test4b "test 11: pull failed"
+check_tmpout "0 files pulled" "test 11: wrong pull counter"
+check_tmpout "0 conflicts" "test 11: wrong conflict counter (pull)"
+check_tmpout "0 errors" "test 11: wrong error counter (pull)"
+LN=`cat tmp-sync/out.txt | wc -l`
+if [ "$LN" != "1" ]; then
+	echo "test 11: wrong output (pull)"
+	exit 2
+fi
+
+
+# ----------------------------------------------------------------------------
+# test 12: add tag, push test4a and pull test4a
+# expected result: tags pushed, nothing pulled
+
+$DAV_SYNC_BIN add-tag -s test4a tmp-sync/test4a/file1 work
+touch -t 03011100 tmp-sync/test4a/file1
+
+dav_sync_push test4a "test 12: push failed"
+check_tmpout "0 conflicts" "test 12: wrong conflict counter (push)"
+check_tmpout "0 errors" "test 12: wrong error counter (push)"
+check_tmpout "update: /file1" "test 12: file 1 not pushed"
+
+dav_sync_pull test4a "test 12: pull failed"
+check_tmpout "0 files pulled" "test 12: wrong pull counter"
+check_tmpout "0 conflicts" "test 12: wrong conflict counter (pull)"
+check_tmpout "0 errors" "test 12: wrong error counter (pull)"
+LN=`cat tmp-sync/out.txt | wc -l`
+if [ "$LN" != "1" ]; then
+	echo "test 12: wrong output (pull)"
+	exit 2
+fi
+
+
+# ----------------------------------------------------------------------------
+# test 13: pull test4b
+# expected result: update file1, sync tags
+
+dav_sync_pull test4b "test 13: pull failed"
+check_tmpout "0 conflicts" "test 13: wrong conflict counter (pull)"
+check_tmpout "0 errors" "test 13: wrong error counter (pull)"
+check_tmpout "update: /file1" "test 13: file 1 not pulled"
+
+$DAV_SYNC_BIN list-tags -s test4b tmp-sync/test4b/file1 > tmp-sync/out.txt
+check_tmpout "test" "test 13: file1 missing tag 'test'"
+check_tmpout "work" "test 13: file1 missing tag 'work'"
+
+
+# ----------------------------------------------------------------------------
+# test 14: remove tags from file4 and sync
+# expected result: tags removed
+
+$DAV_SYNC_BIN remove-tag -s test4a tmp-sync/test4a/file4 test
+touch -t 04011100 tmp-sync/test4a/file4
+
+dav_sync_push test4a "test 14: push failed"
+check_tmpout "0 conflicts" "test 14: wrong conflict counter (push)"
+check_tmpout "0 errors" "test 14: wrong error counter (push)"
+check_tmpout "update: /file4" "test 14: file 4 not pushed"
+
+dav_sync_pull test4b "test 14: pull failed"
+check_tmpout "0 conflicts" "test 14: wrong conflict counter (pull)"
+check_tmpout "0 errors" "test 14: wrong error counter (pull)"
+check_tmpout "update: /file4" "test 14: file 4 not pulled"
+
+LN=`$DAV_SYNC_BIN list-tags -s test4b tmp-sync/test4b/file4 | wc -l`
+if [ "$LN" != "0" ]; then
+	echo "test 14: wrong tag count"
+	exit 2
+fi
+

mercurial