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

Sun, 08 Aug 2021 11:38:55 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 08 Aug 2021 11:38:55 +0200
changeset 729
5433f0f3dd48
parent 650
14e7101d7604
permissions
-rwxr-xr-x

disable error in case of unknown config elements

650
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 #!/bin/sh
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 #
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 #
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 # Copyright 2019 Olaf Wintermann. All rights reserved.
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 #
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 # Redistribution and use in source and binary forms, with or without
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 # modification, are permitted provided that the following conditions are met:
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 #
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 # 1. Redistributions of source code must retain the above copyright
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 # notice, this list of conditions and the following disclaimer.
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 #
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 # 2. Redistributions in binary form must reproduce the above copyright
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 # notice, this list of conditions and the following disclaimer in the
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 # documentation and/or other materials provided with the distribution.
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 #
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 # POSSIBILITY OF SUCH DAMAGE.
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28 #
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 if [ -z "$DAV_BIN" ];
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31 then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 echo "DAV_BIN variable not set"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33 exit 1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 if [ -z "$DAV_SYNC_BIN" ];
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37 echo "DAV_BIN variable not set"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38 exit 1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41 # checks if tmp-sync/out.txt contains a specific text
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
42 # arg1: pattern
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43 # arg2: errormsg
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44 check_tmpout()
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45 {
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46 TEST=`cat tmp-sync/out.txt | grep "$1"`
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47 if [ $? -ne 0 ];
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 echo "$2"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 }
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54 # do dav-sync push and check return value
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55 # arg1: dir
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56 # arg2: errormsg
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57 dav_sync_push()
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58 {
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59 $DAV_SYNC_BIN push $1 > tmp-sync/out.txt
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60 if [ $? -ne 0 ];
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 echo "$2"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 }
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 # do dav-sync pull and check return value
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67 # arg1: dir
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68 # arg2: errormsg
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69 dav_sync_pull()
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70 {
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 $DAV_SYNC_BIN pull $1 > tmp-sync/out.txt
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72 if [ $? -ne 0 ];
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73 then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74 echo "$2"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
75 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
77 }
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
78
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
79 rm -f .dav/dav-sync-tests-test2a-db.xml
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
80 rm -f .dav/dav-sync-tests-test2b-db.xml
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
81
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82 $DAV_BIN rm dav-test-repo/sync/test2 2> /dev/null
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
84 $DAV_BIN mkcol dav-test-repo/sync/test2 2> /dev/null
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86 # tmp sync dir
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87 rm -Rf tmp-sync
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88 mkdir tmp-sync
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89 mkdir tmp-sync/test2a
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90 mkdir tmp-sync/test2b
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
91
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92 # ----------------------------------------------------------------------------
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93 # 1. test: add 4 files, push, pull (not really an hashing test)
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
94 # expected result: 4 files pushed, 4 files pulled
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
95
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96 mkdir tmp-sync/test2a/dir1/
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
97 mkdir tmp-sync/test2a/dir1/subdir1/
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
98
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99 cp synctest/file1 tmp-sync/test2a/
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100 cp synctest/file2 tmp-sync/test2a/dir1/
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101 cp synctest/file3 tmp-sync/test2a/dir1/subdir1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102 cp synctest/file4 tmp-sync/test2a/dir1/subdir1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104 dav_sync_push test2a "test 1: push failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
105 check_tmpout "4 files pushed" "test 1: wrong push counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
106 check_tmpout "0 conflicts" "test 1: wrong conflict counter (push)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
107 check_tmpout "0 errors" "test 1: wrong error counter (push)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
108
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109 dav_sync_pull test2b "test 1: pull failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
110 check_tmpout "4 files pulled" "test 1: wrong pull counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
111 check_tmpout "0 conflicts" "test 1: wrong conflict counter (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
112 check_tmpout "0 errors" "test 1: wrong error counter (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
113
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
114
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115 # ----------------------------------------------------------------------------
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
116 # 2. test: touch 2 files, push
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
117 # expected result: 0 files pushed
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119 sleep 3
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121 touch tmp-sync/test2a/file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122 touch tmp-sync/test2a/dir1/file2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
123
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
124 dav_sync_push test2a "test 2: push failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125 check_tmpout "0 files pushed" "test 2: wrong push counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
126 check_tmpout "0 conflicts" "test 2: wrong conflict counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127 check_tmpout "0 errors" "test 2: wrong error counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130 # ----------------------------------------------------------------------------
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131 # 3. test: copy file1 to test2a again
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
132 # expected result: 0 files pushed
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134 sleep 3
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
135
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
136 cp synctest/file1 tmp-sync/test2a/
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
138 dav_sync_push test2a "test 3: push failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
139 check_tmpout "0 files pushed" "test 3: wrong push counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 check_tmpout "0 conflicts" "test 3: wrong conflict counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
141 check_tmpout "0 errors" "test 3: wrong error counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
142
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
144 # ----------------------------------------------------------------------------
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
145 # 4. test: change content but don't change mtime
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
146 # expected result: 1 file pushed
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
147
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148 # modify file and mtime to update mtime in the database
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
149 echo "test4-change1-a" >> tmp-sync/test2a/file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150 touch -t 01011200 tmp-sync/test2a/file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
152 dav_sync_push test2a "test 4: push failed (1)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
153 check_tmpout "1 file pushed" "test 4: wrong push counter (1)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
154 check_tmpout "0 conflicts" "test 4: wrong conflict counter (1)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
155 check_tmpout "0 errors" "test 4: wrong error counter (1)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
156
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
157 # modify file again and set mtime to same value
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
158 echo "test4-change2-a" >> tmp-sync/test2a/file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
159 touch -t 01011200 tmp-sync/test2a/file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
161 dav_sync_push test2a "test 4: push failed (2)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
162 check_tmpout "1 file pushed" "test 4: wrong push counter (2)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
163 check_tmpout "0 conflicts" "test 4: wrong conflict counter (2)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
164 check_tmpout "0 errors" "test 4: wrong error counter (2)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
165
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
166
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
167 # ----------------------------------------------------------------------------
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
168 # 5. test: set same content on both sides
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
169 # expected result: no conflict
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
170
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
171 # prepare test2b
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
172 dav_sync_pull test2b "test 5: pull failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
173 check_tmpout "1 file pulled" "test 5: wrong pull counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
174 check_tmpout "0 conflicts" "test 5: wrong conflict counter (prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
175 check_tmpout "0 errors" "test 5: wrong error counter (prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
176
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
177 # change content on both sides
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
178 echo "test5-change" >> tmp-sync/test2a/file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
179 echo "test5-change" >> tmp-sync/test2b/file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
180
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
181 # push both sides
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
182 dav_sync_push test2a "test 5: push failed (test2a)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
183 check_tmpout "1 file pushed" "test 5: wrong push counter (test2a)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184 check_tmpout "0 conflicts" "test 5: wrong conflict counter (test2a)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
185 check_tmpout "0 errors" "test 5: wrong error counter (test2a)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
187 dav_sync_push test2b "test 5: push failed (test2b)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
188 # don't check push counter
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
189 check_tmpout "0 conflicts" "test 5: wrong conflict counter (test2b)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
190 check_tmpout "0 errors" "test 5: wrong error counter (test2b)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
191
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
192
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
193 # ----------------------------------------------------------------------------
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
194 # 6. test: upload same new file on both sides
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
195 # expected result: no conflict
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
196
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
197 echo "test6-newfile" >> tmp-sync/test2a/newfile1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
198 echo "test6-newfile" >> tmp-sync/test2b/newfile1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
199
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
200 # push both sides
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
201 dav_sync_push test2a "test 6: push failed (test2a)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
202 check_tmpout "1 file pushed" "test 6: wrong push counter (test2a)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
203 check_tmpout "0 conflicts" "test 6: wrong conflict counter (test2a)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
204 check_tmpout "0 errors" "test 6: wrong error counter (test2a)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
205
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
206 dav_sync_push test2b "test 6: push failed (test2b)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
207 # don't check push counter
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
208 check_tmpout "0 conflicts" "test 6: wrong conflict counter (test2b)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
209 check_tmpout "0 errors" "test 6: wrong error counter (test2b)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
210
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
211
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
212 # ----------------------------------------------------------------------------
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
213 # 7. test: rename file
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
214 # expected result: move
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
215
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
216 mv tmp-sync/test2a/newfile1 tmp-sync/test2a/move1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
217
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
218 dav_sync_push test2a "test 7: push failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
219 check_tmpout "move:" "test 7: no move"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
220 check_tmpout "0 conflicts" "test 7: wrong conflict counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
221 check_tmpout "0 errors" "test 7: wrong error counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
222
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
223
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
224 # ----------------------------------------------------------------------------
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
225 # 8. test: copy file
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
226 # expected result: copy
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
227
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
228 cp tmp-sync/test2a/file1 tmp-sync/test2a/copy1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
229
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
230 dav_sync_push test2a "test 8: push failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
231 check_tmpout "copy:" "test 8: no move"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
232 check_tmpout "0 conflicts" "test 8: wrong conflict counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
233 check_tmpout "0 errors" "test 8: wrong error counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
234
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
235
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
236 # ----------------------------------------------------------------------------
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
237 # 9. test: copy file1 multiple times and than delete it
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
238 # expected result: multiple copies, maybe one move, no errors
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
239
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
240 echo "test9-change" >> tmp-sync/test2a/file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
241 dav_sync_push test2a "test 9: push failed (prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
242 check_tmpout "1 file pushed" "test 9: wrong push counter (prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
243 check_tmpout "0 conflicts" "test 9: wrong conflict counter (prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
244 check_tmpout "0 errors" "test 9: wrong error counter (prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
245
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
246 cp tmp-sync/test2a/file1 tmp-sync/test2a/copyx1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
247 cp tmp-sync/test2a/file1 tmp-sync/test2a/copyx2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
248 cp tmp-sync/test2a/file1 tmp-sync/test2a/copyx3
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
249 cp tmp-sync/test2a/file1 tmp-sync/test2a/copyx4
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
250 cp tmp-sync/test2a/file1 tmp-sync/test2a/copyx5
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
251 rm -f tmp-sync/test2a/file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
252
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
253 dav_sync_push test2a "test 9: push failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
254 check_tmpout "copy:" "test 9: no move"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
255 check_tmpout "0 conflicts" "test 9: wrong conflict counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
256 check_tmpout "0 errors" "test 9: wrong error counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
257
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
258 # to check if everything worked, pull test2b and check the files
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
259
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
260 dav_sync_pull test2b
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
261 check_tmpout "0 conflicts" "test 9: wrong conflict counter (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
262 check_tmpout "0 errors" "test 9: wrong error counter (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
263
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
264 cat tmp-sync/test2b/file1 > /dev/null 2>&1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
265 if [ $? -eq 0 ]; then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
266 echo "test 9: file1 not deleted (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
267 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
268 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
269
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
270 diff tmp-sync/test2a/copyx1 tmp-sync/test2b/copyx1 > /dev/null 2>&1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
271 if [ $? -ne 0 ]; then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
272 echo "test 9: copyx1 missing or wrong content"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
273 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
274 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
275 diff tmp-sync/test2a/copyx2 tmp-sync/test2b/copyx2 > /dev/null 2>&1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
276 if [ $? -ne 0 ]; then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
277 echo "test 9: copyx2 missing or wrong content"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
278 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
279 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
280 diff tmp-sync/test2a/copyx3 tmp-sync/test2b/copyx3 > /dev/null 2>&1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
281 if [ $? -ne 0 ]; then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
282 echo "test 9: copyx3 missing or wrong content"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
283 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
284 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
285 diff tmp-sync/test2a/copyx4 tmp-sync/test2b/copyx4 > /dev/null 2>&1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
286 if [ $? -ne 0 ]; then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
287 echo "test 9: copyx4 missing or wrong content"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
288 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
289 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
290 diff tmp-sync/test2a/copyx5 tmp-sync/test2b/copyx5 > /dev/null 2>&1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
291 if [ $? -ne 0 ]; then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
292 echo "test 9: copyx5 missing or wrong content"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
293 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
294 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
295
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
296
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
297 # ----------------------------------------------------------------------------
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
298 # 10. test: rename all copyx files, which will have all the same content hash
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
299 # we don't test if everything is moved (instead of deleted), but to make sure
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
300 # no errors occur when working with files with the same content
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
301 # expected result: no errors
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
302
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
303 mv tmp-sync/test2a/copyx1 tmp-sync/test2a/movex1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
304 mv tmp-sync/test2a/copyx2 tmp-sync/test2a/movex2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
305 mv tmp-sync/test2a/copyx3 tmp-sync/test2a/movex3
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
306 mv tmp-sync/test2a/copyx4 tmp-sync/test2a/movex4
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
307 mv tmp-sync/test2a/copyx5 tmp-sync/test2a/movex5
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
308
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
309 dav_sync_push test2a "test 10: push failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
310 check_tmpout "move:" "test 10: no move"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
311 check_tmpout "0 conflicts" "test 10: wrong conflict counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
312 check_tmpout "0 errors" "test 10: wrong error counter"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
313
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
314 # to check if everything worked, pull test2b and check the files
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
315
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
316 dav_sync_pull test2b
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
317 check_tmpout "0 conflicts" "test 9: wrong conflict counter (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
318 check_tmpout "0 errors" "test 9: wrong error counter (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
319
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
320 diff tmp-sync/test2a/movex1 tmp-sync/test2b/movex1 > /dev/null 2>&1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
321 if [ $? -ne 0 ]; then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
322 echo "test 10: movex1 missing or wrong content"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
323 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
324 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
325 diff tmp-sync/test2a/movex2 tmp-sync/test2b/movex2 > /dev/null 2>&1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
326 if [ $? -ne 0 ]; then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
327 echo "test 10: movex2 missing or wrong content"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
328 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
329 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
330 diff tmp-sync/test2a/movex3 tmp-sync/test2b/movex3 > /dev/null 2>&1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
331 if [ $? -ne 0 ]; then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
332 echo "test 10: movex3 missing or wrong content"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
333 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
334 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
335 diff tmp-sync/test2a/movex4 tmp-sync/test2b/movex4 > /dev/null 2>&1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
336 if [ $? -ne 0 ]; then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
337 echo "test 10: movex4 missing or wrong content"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
338 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
339 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
340 diff tmp-sync/test2a/movex5 tmp-sync/test2b/movex5 > /dev/null 2>&1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
341 if [ $? -ne 0 ]; then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
342 echo "test 10: movex5 missing or wrong content"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
343 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
344 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
345
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
346
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
347 # ----------------------------------------------------------------------------
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
348 # 11. test: copy file, push test2a, pull test2b
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
349 # expected result: pull copies file
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
350
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
351 cp tmp-sync/test2a/movex5 tmp-sync/test2a/newcopyt11
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
352 dav_sync_push test2a "test 11: push failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
353 check_tmpout "copy:" "test 11: no copy (push)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
354 check_tmpout "0 conflicts" "test 11: wrong conflict counter (push)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
355 check_tmpout "0 errors" "test 11: wrong error counter (push)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
356
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
357 dav_sync_pull test2b "test 11: pull failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
358 check_tmpout "copy:" "test 11: no copy (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
359 check_tmpout "0 conflicts" "test 11: wrong conflict counter (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
360 check_tmpout "0 errors" "test 11: wrong error counter (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
361
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
362
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
363 # ----------------------------------------------------------------------------
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
364 # 12. test: move file, push test2a, pull test2b
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
365 # expected result: pull moves file
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
366
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
367 # we need a fresh file with new content hash for this test
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
368 echo "test12-newfile" >> tmp-sync/test2a/t12file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
369 dav_sync_push test2a "test 12: push failed (prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
370 check_tmpout "1 file pushed" "test 12: wrong push counter (prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
371 check_tmpout "0 conflicts" "test 12: wrong conflict counter (push, prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
372 check_tmpout "0 errors" "test 12: wrong error counter (push, prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
373
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
374 dav_sync_pull test2b "test 12: pull failed (prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
375 check_tmpout "1 file pulled" "test 12: wrong pull counter (prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
376 check_tmpout "0 conflicts" "test 12: wrong conflict counter (pull, prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
377 check_tmpout "0 errors" "test 12: wrong error counter (pull, prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
378
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
379 # actual test
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
380 mv tmp-sync/test2a/t12file1 tmp-sync/test2a/t12move1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
381 dav_sync_push test2a "test 12: push failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
382 check_tmpout "move:" "test 12: no copy (push)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
383 check_tmpout "0 conflicts" "test 12: wrong conflict counter (push)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
384 check_tmpout "0 errors" "test 12: wrong error counter (push)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
385
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
386 dav_sync_pull test2b "test 12: pull failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
387 check_tmpout "move:" "test 12: no move (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
388 check_tmpout "0 conflicts" "test 12: wrong conflict counter (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
389 check_tmpout "0 errors" "test 12: wrong error counter (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
390
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
391
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
392 # ----------------------------------------------------------------------------
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
393 # 13. test: delete file, change name of other file to deleted file's name
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
394 # expected result: first file has content of second file, second file deleted
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
395
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
396 # prepare
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
397 echo "test13-file1" > tmp-sync/test2a/t13file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
398 sleep 3 # make sure t13file2 doesn't has the same mtime as t13file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
399 echo "test13-file2" > tmp-sync/test2a/t13file2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
400
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
401 dav_sync_push test2a "test 13: push failed (prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
402 check_tmpout "2 files pushed" "test 13: wrong push counter (prepare, push)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
403 check_tmpout "0 conflicts" "test 13: wrong conflict counter (prepare, push)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
404 check_tmpout "0 errors" "test 13: wrong error counter (prepare, push)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
405
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
406 dav_sync_pull test2b "test 13: pull failed (prepare)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
407 check_tmpout "2 files pulled" "test 13: wrong pull counter (prepare, pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
408 check_tmpout "0 conflicts" "test 13: wrong conflict counter (prepare, pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
409 check_tmpout "0 errors" "test 13: wrong error counter (prepare, pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
410
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
411 # do test
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
412 rm -f tmp-sync/test2a/t13file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
413 mv tmp-sync/test2a/t13file2 tmp-sync/test2a/t13file1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
414
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
415 sleep 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
416
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
417 dav_sync_push test2a "test 13: push failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
418 # we can't check the exact output, because there are multiple valid ways
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
419 # to sync the changes
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
420 check_tmpout "0 conflicts" "test 13: wrong conflict counter (push)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
421 check_tmpout "0 errors" "test 13: wrong error counter (push)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
422
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
423 dav_sync_pull test2b "test 13: pull failed"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
424 check_tmpout "0 conflicts" "test 13: wrong conflict counter (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
425 check_tmpout "0 errors" "test 13: wrong error counter (pull)"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
426
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
427 TEST=`cat tmp-sync/test2b/t13file1`
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
428 if [ $TEST != "test13-file2" ]; then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
429 echo "test 13: t13file1 has wrong content"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
430 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
431 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
432
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
433 cat tmp-sync/test2b/t13file2 > /dev/null 2>&1
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
434 if [ $? -eq 0 ]; then
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
435 echo "test 13: t13file2 not deleted"
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
436 exit 2
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
437 fi
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
438
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
439
14e7101d7604 fix some hash based conflict resolution bugs and add tests for it
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
440

mercurial