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

changeset 682
a7072ebb1ce0
parent 681
3320429502cf
child 774
8c8aed7e1756
--- a/test/bin-test/test-dav-sync-split1.sh	Wed Nov 20 11:57:45 2019 +0100
+++ b/test/bin-test/test-dav-sync-split1.sh	Wed Nov 20 12:17:55 2019 +0100
@@ -239,3 +239,83 @@
 	exit 2
 fi
 
+
+# ----------------------------------------------------------------------------
+# test 4: add new block to big1 and sync
+# expected result: block synced
+
+sleep 2
+
+cat tmp-sync/test6a/big1 tmp-sync/xb > tmp-sync/test6a/big_tmp
+rm tmp-sync/test6a/big1
+mv tmp-sync/test6a/big_tmp tmp-sync/test6a/big1
+
+dav_sync_push test6a "test 4: push failed"
+check_tmpout "1 file pushed" "test 4: wrong push counter"
+check_tmpout "0 conflicts" "test 4: wrong conflict counter (push)"
+check_tmpout "0 errors" "test 4: wrong error counter (push)"
+
+dav_sync_pull test6b "test 4: pull failed"
+check_tmpout "1 file pulled" "test 4: wrong pull counter"
+check_tmpout "0 conflicts" "test 4: wrong conflict counter (pull)"
+check_tmpout "0 errors" "test 4: wrong error counter (pull)"
+
+HASH1=`cat tmp-sync/test6a/big1 | sha256sum`
+HASH2=`cat tmp-sync/test6b/big1 | sha256sum`
+if [ "$HASH1" != "$HASH2" ]; then
+	echo "test 4: big1 not equal"
+	exit 2
+fi
+
+
+# ----------------------------------------------------------------------------
+# test 5: add some extra bytes to big1 and sync
+# expected result: block synced
+
+sleep 2
+
+echo "test5-mod1" >> tmp-sync/test6a/big1
+
+dav_sync_push test6a "test 5: push failed"
+check_tmpout "1 file pushed" "test 5: wrong push counter"
+check_tmpout "0 conflicts" "test 5: wrong conflict counter (push)"
+check_tmpout "0 errors" "test 5: wrong error counter (push)"
+
+dav_sync_pull test6b "test 5: pull failed"
+check_tmpout "1 file pulled" "test 5: wrong pull counter"
+check_tmpout "0 conflicts" "test 5: wrong conflict counter (pull)"
+check_tmpout "0 errors" "test 5: wrong error counter (pull)"
+
+HASH1=`cat tmp-sync/test6a/big1 | sha256sum`
+HASH2=`cat tmp-sync/test6b/big1 | sha256sum`
+if [ "$HASH1" != "$HASH2" ]; then
+	echo "test 5: big1 not equal"
+	exit 2
+fi
+
+
+# ----------------------------------------------------------------------------
+# test 6: decrease size of big1 and sync
+# expected result: file truncated
+
+# no sleep
+cat tmp-sync/xc tmp-sync/xb tmp-sync/xc > tmp-sync/test6a/big1
+
+dav_sync_push test6a "test 6: push failed"
+check_tmpout "1 file pushed" "test 6: wrong push counter"
+check_tmpout "0 conflicts" "test 6: wrong conflict counter (push)"
+check_tmpout "0 errors" "test 6: wrong error counter (push)"
+
+dav_sync_pull test6b "test 6: pull failed"
+check_tmpout "1 file pulled" "test 6: wrong pull counter"
+check_tmpout "0 conflicts" "test 6: wrong conflict counter (pull)"
+check_tmpout "0 errors" "test 6: wrong error counter (pull)"
+
+HASH1=`cat tmp-sync/test6a/big1 | sha256sum`
+HASH2=`cat tmp-sync/test6b/big1 | sha256sum`
+if [ "$HASH1" != "$HASH2" ]; then
+	echo "test 6: big1 not equal"
+	exit 2
+fi
+
+

mercurial