Tue, 23 Jul 2024 14:40:20 +0200
also remove \r from user name
685 | 1 | #!/bin/sh |
2 | # | |
3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | |
4 | # | |
5 | # Copyright 2019 Olaf Wintermann. All rights reserved. | |
6 | # | |
7 | # Redistribution and use in source and binary forms, with or without | |
8 | # modification, are permitted provided that the following conditions are met: | |
9 | # | |
10 | # 1. Redistributions of source code must retain the above copyright | |
11 | # notice, this list of conditions and the following disclaimer. | |
12 | # | |
13 | # 2. Redistributions in binary form must reproduce the above copyright | |
14 | # notice, this list of conditions and the following disclaimer in the | |
15 | # documentation and/or other materials provided with the distribution. | |
16 | # | |
17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | |
21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
27 | # POSSIBILITY OF SUCH DAMAGE. | |
28 | # | |
29 | ||
30 | if [ -z "$DAV_BIN" ]; | |
31 | then | |
32 | echo "DAV_BIN variable not set" | |
33 | exit 1 | |
34 | fi | |
35 | if [ -z "$DAV_SYNC_BIN" ]; | |
36 | then | |
37 | echo "DAV_BIN variable not set" | |
38 | exit 1 | |
39 | fi | |
40 | ||
41 | XATTR=../../build/xattrtool | |
42 | ||
43 | # checks if tmp-sync/out.txt contains a specific text | |
44 | # arg1: pattern | |
45 | # arg2: errormsg | |
46 | check_tmpout() | |
47 | { | |
48 | TEST=`cat tmp-sync/out.txt | grep "$1"` | |
49 | if [ $? -ne 0 ]; | |
50 | then | |
51 | echo "$2" | |
52 | exit 2 | |
53 | fi | |
54 | } | |
55 | ||
56 | # checks if tmp-sync/out.txt does not contain a specific text | |
57 | # arg1: pattern | |
58 | # arg2: errormsg | |
59 | ncheck_tmpout() | |
60 | { | |
61 | TEST=`cat tmp-sync/out.txt | grep "$1"` | |
62 | if [ $? -eq 0 ]; | |
63 | then | |
64 | echo "$2" | |
65 | exit 2 | |
66 | fi | |
67 | } | |
68 | ||
69 | # do dav-sync push and check return value | |
70 | # arg1: dir | |
71 | # arg2: errormsg | |
72 | dav_sync_push() | |
73 | { | |
74 | $DAV_SYNC_BIN push $1 > tmp-sync/out.txt | |
75 | if [ $? -ne 0 ]; | |
76 | then | |
77 | echo "$2" | |
78 | exit 2 | |
79 | fi | |
80 | } | |
81 | # do dav-sync pull and check return value | |
82 | # arg1: dir | |
83 | # arg2: errormsg | |
84 | dav_sync_pull() | |
85 | { | |
86 | $DAV_SYNC_BIN pull $1 > tmp-sync/out.txt | |
87 | if [ $? -ne 0 ]; | |
88 | then | |
89 | echo "$2" | |
90 | exit 2 | |
91 | fi | |
92 | } | |
93 | ||
94 | rm -f .dav/dav-sync-tests-test7a-db.xml | |
95 | rm -f .dav/dav-sync-tests-test7b-db.xml | |
96 | ||
97 | $DAV_BIN rm dav-test-repo/sync/test7 2> /dev/null | |
98 | ||
99 | $DAV_BIN mkcol dav-test-repo/sync/test7 2> /dev/null | |
100 | ||
101 | # tmp sync dir | |
102 | rm -Rf tmp-sync | |
103 | mkdir tmp-sync | |
104 | mkdir tmp-sync/test7a | |
105 | mkdir tmp-sync/test7b | |
106 | ||
107 | # ---------------------------------------------------------------------------- | |
108 | # test 1: try to sync symlinks with symlinks disabled (test7a1) | |
109 | # expected result: only normal files synced | |
110 | ||
111 | mkdir tmp-sync/files | |
112 | mkdir tmp-sync/test7a/dir1 | |
113 | mkdir tmp-sync/test7a/dir1/sub1 | |
114 | ||
115 | echo "extern-file1" > tmp-sync/extern1 | |
116 | echo "extern-file2" > tmp-sync/files/extern2 | |
117 | echo "extern-file3" > tmp-sync/files/extern3 | |
118 | ||
119 | which ln > /dev/null 2>&1 | |
120 | if [ $? -ne 0 ]; then | |
121 | exit 0 # symlinks unsupported on this platform | |
122 | fi | |
123 | ||
124 | ln -s -r tmp-sync/extern1 tmp-sync/test7a/extern1 > /dev/null 2>&1 | |
125 | if [ $? -ne 0 ]; then | |
126 | exit 0 # symlinks unsupported on this platform | |
127 | fi | |
128 | ||
129 | ln -s -r tmp-sync/files/extern2 tmp-sync/test7a/extern2 | |
130 | ln -s -r tmp-sync/files/extern3 tmp-sync/test7a/dir1/sub1/extern3 | |
131 | ||
132 | cp synctest/file1 tmp-sync/test7a | |
133 | cp synctest/file2 tmp-sync/test7a/dir1 | |
134 | cp synctest/file3 tmp-sync/test7a/dir1/sub1 | |
135 | ||
136 | ln -s -r tmp-sync/test7a/file1 tmp-sync/test7a/intern1 | |
137 | ln -s -r tmp-sync/test7a/dir1/file2 tmp-sync/test7a/intern2 | |
138 | ln -s -r tmp-sync/test7a/file1 tmp-sync/test7a/dir1/sub1/intern3 | |
139 | ||
140 | dav_sync_push test7a1 "test 1: push failed" | |
141 | check_tmpout "3 files pushed" "test 1: wrong push counter" | |
142 | check_tmpout "0 conflicts" "test 1: wrong conflict counter (push)" | |
143 | check_tmpout "0 errors" "test 1: wrong error counter (push)" | |
144 | ncheck_tmpout "extern" "test 1: external symlinks pushed" | |
145 | ncheck_tmpout "intern" "test 1: internal symlinks pushed" | |
146 | ||
147 | dav_sync_pull test7b "test 1: pull failed" | |
148 | check_tmpout "3 files pulled" "test 1: wrong pull counter" | |
149 | check_tmpout "0 conflicts" "test 1: wrong conflict counter (pull)" | |
150 | check_tmpout "0 errors" "test 1: wrong error counter (pull)" | |
151 | ||
152 | ||
153 | # ---------------------------------------------------------------------------- | |
154 | # test 2: try to sync internal symlinks (test7a2) | |
155 | # expected result: internal symlinks synced, external symlinks ignored | |
156 | ||
157 | dav_sync_push test7a2 "test 2: push failed" | |
158 | check_tmpout "3 files pushed" "test 2: wrong push counter" | |
159 | check_tmpout "0 conflicts" "test 2: wrong conflict counter (push)" | |
160 | check_tmpout "0 errors" "test 2: wrong error counter (push)" | |
161 | check_tmpout "link: /intern1" "test 2: no links created (push)" | |
162 | ncheck_tmpout "extern" "test 2: external symlinks pushed" | |
163 | ||
164 | dav_sync_pull test7b "test 2: pull failed" | |
165 | check_tmpout "3 files pulled" "test 2: wrong pull counter" | |
166 | check_tmpout "0 conflicts" "test 2: wrong conflict counter (pull)" | |
167 | check_tmpout "0 errors" "test 2: wrong error counter (pull)" | |
168 | check_tmpout "link: /intern1" "test 2: no links created (pull)" | |
169 | ||
170 | # compare links | |
171 | HASH_A=`cat tmp-sync/test7a/intern1 | sha256sum` | |
172 | HASH_B=`cat tmp-sync/test7b/intern1 | sha256sum` | |
173 | if [ "$HASH_A" != "$HASH_B" ]; then | |
174 | echo "test 2: intern1 has wrong content" | |
175 | exit 2 | |
176 | fi | |
177 | HASH_A=`cat tmp-sync/test7a/intern2 | sha256sum` | |
178 | HASH_B=`cat tmp-sync/test7b/intern2 | sha256sum` | |
179 | if [ "$HASH_A" != "$HASH_B" ]; then | |
180 | echo "test 2: intern2 has wrong content" | |
181 | exit 2 | |
182 | fi | |
183 | HASH_A=`cat tmp-sync/test7a/dir1/sub1/intern3 | sha256sum` | |
184 | HASH_B=`cat tmp-sync/test7b/dir1/sub1/intern3 | sha256sum` | |
185 | if [ "$HASH_A" != "$HASH_B" ]; then | |
186 | echo "test 2: intern3 has wrong content" | |
187 | exit 2 | |
188 | fi | |
189 | ||
190 | ||
191 | # ---------------------------------------------------------------------------- | |
192 | # test 3: push with symlink-extern follow (test7a) | |
193 | # expected result: external links pushed as regular files | |
194 | ||
195 | dav_sync_push test7a "test 3: push failed" | |
196 | check_tmpout "3 files pushed" "test 3: wrong push counter" | |
197 | check_tmpout "0 conflicts" "test 3: wrong conflict counter (push)" | |
198 | check_tmpout "0 errors" "test 3: wrong error counter (push)" | |
199 | check_tmpout "extern" "test 3: no links created (push)" | |
200 | ||
201 | dav_sync_pull test7b "test 3: pull failed" | |
202 | check_tmpout "3 files pulled" "test 3: wrong pull counter" | |
203 | check_tmpout "0 conflicts" "test 3: wrong conflict counter (pull)" | |
204 | check_tmpout "0 errors" "test 3: wrong error counter (pull)" | |
205 | ||
206 | ||
207 | # ---------------------------------------------------------------------------- | |
208 | # test 4: push, add new file, push (test if double sync happens) | |
209 | # expected result: push1: 0 files pushed, push2: 1 file pushed | |
210 | ||
211 | dav_sync_push test7a "test 4: push failed" | |
212 | check_tmpout "0 files pushed" "test 4: wrong push counter" | |
213 | check_tmpout "0 conflicts" "test 4: wrong conflict counter (push)" | |
214 | check_tmpout "0 errors" "test 4: wrong error counter (push)" | |
215 | ||
216 | echo "test3-new1" > tmp-sync/test7a/new1 | |
217 | ||
218 | dav_sync_push test7a "test 4: push 2 failed" | |
219 | check_tmpout "1 file pushed" "test 4: wrong push counter (2)" | |
220 | check_tmpout "0 conflicts" "test 4: wrong conflict counter (2)" | |
221 | check_tmpout "0 errors" "test 4: wrong error counter (2)" | |
222 | ||
223 | dav_sync_pull test7b "test 4: pull failed" | |
224 | check_tmpout "1 file pulled" "test 4: wrong pull counter" | |
225 | check_tmpout "0 conflicts" "test 4: wrong conflict counter (pull)" | |
226 | check_tmpout "0 errors" "test 4: wrong error counter (pull)" | |
227 | ||
228 | ||
229 | # ---------------------------------------------------------------------------- | |
230 | # test 5: modify file1, sync | |
231 | # expected result: file1 synced, intern1 not synced | |
232 | ||
233 | sleep 2 | |
234 | ||
235 | echo "test5-mod1" >> tmp-sync/test7a/file1 | |
236 | ||
237 | dav_sync_push test7a "test 5: push failed" | |
238 | check_tmpout "1 file pushed" "test 5: wrong push counter" | |
239 | check_tmpout "0 conflicts" "test 5: wrong conflict counter (push)" | |
240 | check_tmpout "0 errors" "test 5: wrong error counter (push)" | |
241 | ncheck_tmpout "intern1" "test 5: intern1 updated (push)" | |
242 | ||
243 | dav_sync_pull test7b "test 5: pull failed" | |
244 | check_tmpout "1 file pulled" "test 5: wrong pull counter" | |
245 | check_tmpout "0 conflicts" "test 5: wrong conflict counter (pull)" | |
246 | check_tmpout "0 errors" "test 5: wrong error counter (pull)" | |
247 | ||
248 | ||
249 | # ---------------------------------------------------------------------------- | |
250 | # test 6: change intern1 target | |
251 | # expected result: intern1 updated | |
252 | ||
253 | rm -f tmp-sync/test7a/intern1 | |
254 | ln -s -r tmp-sync/test7a/new1 tmp-sync/test7a/intern1 | |
255 | ||
256 | dav_sync_push test7a "test 6: push failed" | |
257 | check_tmpout "1 file pushed" "test 6: wrong push counter" | |
258 | check_tmpout "0 conflicts" "test 6: wrong conflict counter (push)" | |
259 | check_tmpout "0 errors" "test 6: wrong error counter (push)" | |
260 | check_tmpout "intern1" "test 6: intern1 not updated (push)" | |
261 | ||
262 | dav_sync_pull test7b "test 6: pull failed" | |
263 | check_tmpout "1 file pulled" "test 6: wrong pull counter" | |
264 | check_tmpout "0 conflicts" "test 6: wrong conflict counter (pull)" | |
265 | check_tmpout "0 errors" "test 6: wrong error counter (pull)" | |
266 | check_tmpout "intern1" "test 6: intern1 not updated (pull)" | |
267 | ||
686
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
268 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
269 | # ---------------------------------------------------------------------------- |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
270 | # test 7: change intern1 target on both sides |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
271 | # expected result: conflict |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
272 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
273 | # preparation: add regular files on both sides and sync |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
274 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
275 | echo "test7-new2a" > tmp-sync/test7a/new2a |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
276 | echo "test7-new2b" > tmp-sync/test7b/new2b |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
277 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
278 | dav_sync_push test7a "test 7: push a failed" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
279 | check_tmpout "1 file pushed" "test 7: wrong push counter (push a)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
280 | check_tmpout "0 conflicts" "test 7: wrong conflict counter (push a)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
281 | check_tmpout "0 errors" "test 7: wrong error counter (push a)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
282 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
283 | dav_sync_push test7b "test 7: push b failed" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
284 | check_tmpout "1 file pushed" "test 7: wrong push counter (push b)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
285 | check_tmpout "0 conflicts" "test 7: wrong conflict counter (push b)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
286 | check_tmpout "0 errors" "test 7: wrong error counter (push b)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
287 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
288 | dav_sync_pull test7a "test 7: pull a failed" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
289 | check_tmpout "1 file pulled" "test 7: wrong pull counter (pull a)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
290 | check_tmpout "0 conflicts" "test 7: wrong conflict counter (pull a)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
291 | check_tmpout "0 errors" "test 7: wrong error counter (pull a)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
292 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
293 | dav_sync_pull test7b "test 7: pull b failed" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
294 | check_tmpout "1 file pulled" "test 7: wrong pull counter (pull b)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
295 | check_tmpout "0 conflicts" "test 7: wrong conflict counter (pull b)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
296 | check_tmpout "0 errors" "test 7: wrong error counter (pull b)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
297 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
298 | # test: change symlinks |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
299 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
300 | rm -f tmp-sync/test7a/intern1 |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
301 | ln -s -r tmp-sync/test7a/new2a tmp-sync/test7a/intern1 |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
302 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
303 | rm -f tmp-sync/test7b/intern1 |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
304 | ln -s -r tmp-sync/test7b/new2b tmp-sync/test7b/intern1 |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
305 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
306 | dav_sync_push test7a "test 7: push a failed (a)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
307 | check_tmpout "1 file pushed" "test 7: wrong push counter (push a 2)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
308 | check_tmpout "0 conflicts" "test 7: wrong conflict counter (push a 2)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
309 | check_tmpout "0 errors" "test 7: wrong error counter (push a 2)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
310 | check_tmpout "intern1" "test 7: intern1 not updated (push a 2)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
311 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
312 | dav_sync_push test7b "test 7: push b failed (b)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
313 | check_tmpout "1 conflict" "test 7: wrong conflict counter (push b 2)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
314 | check_tmpout "0 errors" "test 7: wrong error counter (push b 2)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
315 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
316 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
317 | # ---------------------------------------------------------------------------- |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
318 | # test 8: pull test7b |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
319 | # expected result: conflict |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
320 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
321 | dav_sync_pull test7b "test 8: pull failed" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
322 | check_tmpout "1 file pulled" "test8: wrong pull counter (pull)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
323 | check_tmpout "1 conflict" "test 8: wrong conflict counter (pull)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
324 | check_tmpout "0 errors" "test 8: wrong error counter (pull)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
325 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
326 | $DAV_SYNC_BIN delete-conflicts test7b > /dev/null 2>&1 |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
327 | if [ $? -ne 0 ]; then |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
328 | echo "test 8: delete-conflicts failed" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
329 | exit 2 |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
330 | fi |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
331 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
332 | dav_sync_pull test7b "test 8: pull 2 failed" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
333 | check_tmpout "0 files pulled" "test8: wrong pull counter (pull 2)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
334 | check_tmpout "0 conflicts" "test 8: wrong conflict counter (pull 2)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
335 | check_tmpout "0 errors" "test 8: wrong error counter (pull 2)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
336 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
337 | dav_sync_push test7b "test 8: push b failed (b)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
338 | check_tmpout "0 files pushed" "test 8: wrong push counter" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
339 | check_tmpout "0 conflicts" "test 8: wrong conflict counter (push)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
340 | check_tmpout "0 errors" "test 8: wrong error counter (push)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
341 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
342 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
343 | # ---------------------------------------------------------------------------- |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
344 | # test 9: add new link on both sides |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
345 | # expected result: conflict |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
346 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
347 | ln -s -r tmp-sync/test7a/new2a tmp-sync/test7a/newlink1 |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
348 | ln -s -r tmp-sync/test7b/new2b tmp-sync/test7b/newlink1 |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
349 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
350 | dav_sync_push test7a "test 9: push a failed (a)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
351 | check_tmpout "1 file pushed" "test 9: wrong push counter (push a)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
352 | check_tmpout "0 conflicts" "test 9: wrong conflict counter (push a)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
353 | check_tmpout "0 errors" "test 9: wrong error counter (push a)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
354 | check_tmpout "newlink1" "test 9: intern1 not updated (push a)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
355 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
356 | dav_sync_push test7b "test 9: push b failed (b)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
357 | check_tmpout "1 conflict" "test 9: wrong conflict counter (push b)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
358 | check_tmpout "0 errors" "test 9: wrong error counter (push b)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
359 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
360 | # pull |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
361 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
362 | dav_sync_pull test7b "test 9: pull failed" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
363 | check_tmpout "1 file pulled" "test9: wrong pull counter (pull)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
364 | check_tmpout "1 conflict" "test 9: wrong conflict counter (pull)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
365 | check_tmpout "0 errors" "test 9: wrong error counter (pull)" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
366 | |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
367 | $DAV_SYNC_BIN delete-conflicts test7b > /dev/null 2>&1 |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
368 | if [ $? -ne 0 ]; then |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
369 | echo "test 9: delete-conflicts failed" |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
370 | exit 2 |
ab159748055c
add more symlink tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
685
diff
changeset
|
371 | fi |