Sun, 17 Dec 2023 15:33:50 +0100
fix faulty string to int conversion utilities
Probably it was expected that errno is set to EINVAL when illegal characters are encountered. But this is not standard and does not happen on every system, allowing illegal strings to be parsed as valid integers.
635
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | #!/bin/sh |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | # |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
4 | # |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | # Copyright 2019 Olaf Wintermann. All rights reserved. |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | # |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | # Redistribution and use in source and binary forms, with or without |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | # modification, are permitted provided that the following conditions are met: |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | # |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | # 1. Redistributions of source code must retain the above copyright |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | # notice, this list of conditions and the following disclaimer. |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | # |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | # 2. Redistributions in binary form must reproduce the above copyright |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | # notice, this list of conditions and the following disclaimer in the |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | # documentation and/or other materials provided with the distribution. |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | # |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
a6b1ec1b7ba0
add push conflict tests
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 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | # POSSIBILITY OF SUCH DAMAGE. |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | # |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30 | # |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31 | # Test dav-sync pull conflict detection |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32 | # and related commands |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
33 | # |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | if [ -z "$DAV_BIN" ]; |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | then |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | echo "DAV_BIN variable not set" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | exit 1 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | fi |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | if [ -z "$DAV_SYNC_BIN" ]; |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | then |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
42 | echo "DAV_BIN variable not set" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
43 | exit 1 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
44 | fi |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
45 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
46 | # checks if tmp-sync/out.txt contains a specific text |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
47 | # arg1: pattern |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
48 | # arg2: errormsg |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
49 | check_tmpout() |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
50 | { |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51 | TEST=`cat tmp-sync/out.txt | grep "$1"` |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
52 | if [ $? -ne 0 ]; |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
53 | then |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
54 | echo "$2" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
55 | exit 2 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
56 | fi |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
57 | } |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
58 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
59 | # do dav-sync push and check return value |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
60 | # arg1: dir |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
61 | # arg2: errormsg |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
62 | dav_sync_push() |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
63 | { |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
64 | $DAV_SYNC_BIN push $1 > tmp-sync/out.txt |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
65 | if [ $? -ne 0 ]; |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
66 | then |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
67 | echo "$2" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
68 | exit 2 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
69 | fi |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
70 | } |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
71 | # do dav-sync pull and check return value |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
72 | # arg1: dir |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
73 | # arg2: errormsg |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
74 | dav_sync_pull() |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
75 | { |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
76 | $DAV_SYNC_BIN pull $1 > tmp-sync/out.txt |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
77 | if [ $? -ne 0 ]; |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
78 | then |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
79 | echo "$2" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
80 | exit 2 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
81 | fi |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
82 | } |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
83 | |
636
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
84 | # check if files in test1a and test1b are equal |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
85 | # arg1: path |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
86 | # arg2: error |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
87 | compare_files() |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
88 | { |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
89 | diff tmp-sync/test1a/$1 tmp-sync/test1a/$1 > /dev/null 2>&1 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
90 | if [ $? -ne 0 ]; then |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
91 | echo "$2" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
92 | exit 2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
93 | fi |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
94 | } |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
95 | |
635
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
96 | rm -f .dav/dav-sync-tests-test1a-db.xml |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
97 | rm -f .dav/dav-sync-tests-test1b-db.xml |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
98 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
99 | $DAV_BIN rm dav-test-repo/sync/test1 2> /dev/null |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
100 | $DAV_BIN rm dav-test-repo/sync/test2 2> /dev/null |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
101 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
102 | $DAV_BIN mkcol dav-test-repo/sync/test1 2> /dev/null |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
103 | $DAV_BIN mkcol dav-test-repo/sync/test2 2> /dev/null |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
104 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
105 | # tmp sync dir |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
106 | rm -Rf tmp-sync |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
107 | mkdir tmp-sync |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
108 | mkdir tmp-sync/test1a |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
109 | mkdir tmp-sync/test1b |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
110 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
111 | # prepare |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
112 | cp synctest/file1 tmp-sync/test1a |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
113 | cp synctest/file2 tmp-sync/test1a |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
114 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
115 | mkdir tmp-sync/test1a/dir1/ |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
116 | mkdir tmp-sync/test1a/dir1/subdir1/ |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
117 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
118 | cp synctest/file1 tmp-sync/test1a/dir1/ |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
119 | cp synctest/file2 tmp-sync/test1a/dir1/ |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
120 | cp synctest/file3 tmp-sync/test1a/dir1/ |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
121 | cp synctest/file4 tmp-sync/test1a/dir1/ |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
122 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
123 | cp synctest/file1 tmp-sync/test1a/dir1/subdir1/ |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
124 | cp synctest/file2 tmp-sync/test1a/dir1/subdir1/ |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
125 | cp synctest/file3 tmp-sync/test1a/dir1/subdir1/ |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
126 | cp synctest/file4 tmp-sync/test1a/dir1/subdir1/ |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
127 | cp synctest/empty1 tmp-sync/test1a/dir1/subdir1/ |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
128 | cp synctest/empty2 tmp-sync/test1a/dir1/subdir1/ |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
129 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
130 | dav_sync_push test1a "prepare: push failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
131 | dav_sync_pull test1b "prepare: pull failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
132 | sleep 3 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
133 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
134 | # ---------------------------------------------------------------------------- |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
135 | # 1. test: try to push a file, that has changed on the server |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
136 | # expected result: 1 conflict |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
137 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
138 | echo "test1-mod" >> tmp-sync/test1a/file1 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
139 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
140 | dav_sync_push test1a "test 1: push test1a failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
141 | check_tmpout "1 file pushed" "test 1: wrong push counter (1)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
142 | check_tmpout "0 conflicts" "test 1: wrong conflict counter(1)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
143 | check_tmpout "0 errors" "test 1: wrong erro counter(1)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
144 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
145 | echo "test1-conflict" >> tmp-sync/test1b/file1 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
146 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
147 | dav_sync_push test1b "test 1: push test1b failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
148 | check_tmpout "0 files pushed" "test 1: wrong push counter (2)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
149 | check_tmpout "1 conflict" "test 1: wrong conflict counter(2)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
150 | check_tmpout "0 errors" "test 1: wrong erro counter(2)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
151 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
152 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
153 | # ---------------------------------------------------------------------------- |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
154 | # 2. test: try again |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
155 | # expected result: 1 conflict |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
156 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
157 | dav_sync_push test1b "test 2: push test1b failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
158 | check_tmpout "0 files pushed" "test 2: wrong push counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
159 | check_tmpout "1 conflict" "test 2: wrong conflict counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
160 | check_tmpout "0 errors" "test 2: wrong erro counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
161 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
162 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
163 | # ---------------------------------------------------------------------------- |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
164 | # 3. test: try again with -c |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
165 | # expected result: 1 file pushed, 0 conflicts |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
166 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
167 | $DAV_SYNC_BIN push -c test1b > tmp-sync/out.txt |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
168 | if [ $? -ne 0 ]; |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
169 | then |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
170 | echo "test 1: push test1b failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
171 | exit 2 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
172 | fi |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
173 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
174 | check_tmpout "1 file pushed" "test 3: wrong push counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
175 | check_tmpout "0 conflicts" "test 3: wrong conflict counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
176 | check_tmpout "0 errors" "test 3: wrong erro counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
177 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
178 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
179 | # ---------------------------------------------------------------------------- |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
180 | # 4. test: get changes in test1a and retry test 1 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
181 | # expected result: 1 conflict |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
182 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
183 | sleep 3 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
184 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
185 | dav_sync_pull test1a "test 4: pull failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
186 | check_tmpout "1 file pulled" "test 4: wrong pull counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
187 | check_tmpout "0 conflicts" "test 4: wrong conflict counter (pull)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
188 | check_tmpout "0 errors" "test 4: wrong error counter (pull)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
189 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
190 | echo "test4-mod" >> tmp-sync/test1a/file1 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
191 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
192 | dav_sync_push test1a "test 4: push test1a failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
193 | check_tmpout "1 file pushed" "test 4: wrong push counter (1)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
194 | check_tmpout "0 conflicts" "test 4: wrong conflict counter(1)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
195 | check_tmpout "0 errors" "test 4: wrong erro counter(1)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
196 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
197 | echo "test4-conflict" >> tmp-sync/test1b/file1 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
198 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
199 | dav_sync_push test1b "test 4: push test1b failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
200 | check_tmpout "0 files pushed" "test 4: wrong push counter (2)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
201 | check_tmpout "1 conflict" "test 4: wrong conflict counter(2)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
202 | check_tmpout "0 errors" "test 4: wrong erro counter(2)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
203 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
204 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
205 | # ---------------------------------------------------------------------------- |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
206 | # 5. test: check if resolve-conflicts can fix push conflicts |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
207 | # expected result: resolve-conflicts only resolves pull conflicts |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
208 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
209 | $DAV_SYNC_BIN resolve-conflicts test1b > /dev/null 2>&1 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
210 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
211 | dav_sync_push test1b "test 5: push test1b failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
212 | check_tmpout "0 files pushed" "test 5: wrong push counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
213 | check_tmpout "1 conflict" "test 5: wrong conflict counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
214 | check_tmpout "0 errors" "test 5: wrong erro counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
215 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
216 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
217 | # ---------------------------------------------------------------------------- |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
218 | # 6. test: pull (with conflict), push |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
219 | # expected result: local conflict file, 0 files pushed |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
220 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
221 | sleep 3 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
222 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
223 | dav_sync_pull test1b "test 6: pull failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
224 | check_tmpout "1 conflict" "test 6: wrong conflict counter (pull)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
225 | check_tmpout "0 errors" "test 6: wrong error counter (pull)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
226 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
227 | # check if file1 is a conflict |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
228 | $DAV_SYNC_BIN list-conflicts test1b > tmp-sync/out.txt |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
229 | check_tmpout "/file1" "test 6: list-conflicts doesn't list file1 (1)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
230 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
231 | dav_sync_push test1b "test 6: push failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
232 | check_tmpout "0 files pushed" "test 6: wrong push counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
233 | check_tmpout "0 conflicts" "test 6: wrong conflict counter (push)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
234 | check_tmpout "0 errors" "test 6: wrong error counter (push)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
235 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
236 | # check if file1 is a conflict (again) |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
237 | $DAV_SYNC_BIN list-conflicts test1b > tmp-sync/out.txt |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
238 | check_tmpout "/file1" "test 6: list-conflicts doesn't list file1 (2)" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
239 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
240 | # ---------------------------------------------------------------------------- |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
241 | # 7. test: push after resolve-conflicts |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
242 | # expected result: removes conflict from orig-file -> 1 file pushed |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
243 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
244 | $DAV_SYNC_BIN resolve-conflicts test1b > /dev/null |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
245 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
246 | TEST=`$DAV_SYNC_BIN list-conflicts test1b | wc -l` |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
247 | if [ $TEST != "0" ]; then |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
248 | echo "test 7: list-conflicts not empty" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
249 | exit 2 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
250 | fi |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
251 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
252 | dav_sync_push test1b "test 7: push failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
253 | check_tmpout "1 file pushed" "test 7: wrong push counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
254 | check_tmpout "0 conflicts" "test 7: wrong conflict counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
255 | check_tmpout "0 errors" "test 7: wrong error counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
256 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
257 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
258 | # ---------------------------------------------------------------------------- |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
259 | # 8. test: pull test1a (actually not a push test, but we need to pull test1a) |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
260 | # expected result: no conflicts |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
261 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
262 | dav_sync_pull test1a "test 8: pull failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
263 | check_tmpout "0 conflicts" "test 8: wrong conflict counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
264 | check_tmpout "0 errors" "test 8: wrong error counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
265 | TEST=`cat tmp-sync/out.txt | wc -l` |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
266 | if [ $TEST == "1" ]; then |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
267 | echo "test 8: no files pulled" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
268 | exit 2 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
269 | fi |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
270 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
271 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
272 | # ---------------------------------------------------------------------------- |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
273 | # 9. test: multiple files modified locally and on the server, push |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
274 | # expected result: multiple conflicts |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
275 | |
636
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
276 | sleep 3 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
277 | |
635
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
278 | # modify 6 files in test1a |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
279 | echo "test9conflict_a" >> tmp-sync/test1a/file1 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
280 | echo "test9conflict_a" >> tmp-sync/test1a/file2 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
281 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
282 | echo "test9conflict_a" >> tmp-sync/test1a/dir1/file1 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
283 | echo "test9conflict_a" >> tmp-sync/test1a/dir1/file2 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
284 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
285 | echo "test9conflict_a" >> tmp-sync/test1a/dir1/subdir1/empty1 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
286 | echo "test9conflict_a" >> tmp-sync/test1a/dir1/subdir1/empty2 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
287 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
288 | dav_sync_push test1a "test 9: push test1a failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
289 | check_tmpout "6 files pushed" "test 9: wrong test1a push counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
290 | check_tmpout "0 conflicts" "test 9: wrong test1a conflict counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
291 | check_tmpout "0 errors" "test 9: wrong test1a error counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
292 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
293 | # modify 3 files in test1b, which are also modified in test1a |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
294 | echo "test9conflict_b" >> tmp-sync/test1b/file2 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
295 | echo "test9conflict_b" >> tmp-sync/test1b/dir1/file2 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
296 | echo "test9conflict_b" >> tmp-sync/test1b/dir1/subdir1/empty2 |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
297 | |
636
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
298 | # modify 3 files in test1b, that are NOT modified in test1a |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
299 | echo "test9change_b" >> tmp-sync/test1b/dir1/file3 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
300 | echo "test9change_b" >> tmp-sync/test1b/dir1/file4 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
301 | echo "test9change_b" >> tmp-sync/test1b/dir1/subdir1/file1 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
302 | |
635
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
303 | dav_sync_push test1b "test 9: push test1a failed" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
304 | check_tmpout "3 files pushed" "test 9: wrong test1b push counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
305 | check_tmpout "3 conflicts" "test 9: wrong test1b conflict counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
306 | check_tmpout "0 errors" "test 9: wrong test1b error counter" |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
307 | |
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
308 | |
636
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
309 | # ---------------------------------------------------------------------------- |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
310 | # 10. test: pull -c to override local changes, modify again and push |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
311 | # expected result: 3 files pulled, 3 files pushed |
635
a6b1ec1b7ba0
add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
312 | |
636
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
313 | sleep 3 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
314 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
315 | $DAV_SYNC_BIN pull -c test1b > tmp-sync/out.txt |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
316 | if [ $? -ne 0 ]; |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
317 | then |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
318 | echo "test 10: pull failed" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
319 | exit 2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
320 | fi |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
321 | check_tmpout "6 files pulled" "test 10: wrong pull counter" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
322 | check_tmpout "0 conflicts" "test 10: wrong conflict counter (pull)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
323 | check_tmpout "0 errors" "test 10: wrong error counter (pull)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
324 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
325 | # modify 3 files in test1b, which are also modified in test1a |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
326 | echo "test9conflict_b" >> tmp-sync/test1b/file2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
327 | echo "test9conflict_b" >> tmp-sync/test1b/dir1/file2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
328 | echo "test9conflict_b" >> tmp-sync/test1b/dir1/subdir1/empty2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
329 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
330 | dav_sync_push test1b "test 10: push failed" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
331 | check_tmpout "3 files pushed" "test 10: wrong push counter" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
332 | check_tmpout "0 conflicts" "test 10: wrong conflict counter (push)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
333 | check_tmpout "0 errors" "test 10: wrong error counter (push)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
334 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
335 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
336 | # ---------------------------------------------------------------------------- |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
337 | # 11. test: create 3 conflicts, push, push again with -c |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
338 | # expected result: first push: 3 conflicts, second push: 3 files pushed |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
339 | |
637
20241338740c
add first dav-sync hashing test
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
636
diff
changeset
|
340 | sleep 3 |
20241338740c
add first dav-sync hashing test
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
636
diff
changeset
|
341 | |
636
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
342 | # prepare test1a (like test 8) |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
343 | dav_sync_pull test1a "test 11: pull failed" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
344 | check_tmpout "0 conflicts" "test 11: wrong conflict counter (pull test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
345 | check_tmpout "0 errors" "test 11: wrong error counter (pull test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
346 | TEST=`cat tmp-sync/out.txt | wc -l` |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
347 | if [ $TEST == "1" ]; then |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
348 | echo "test 11: no files pulled" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
349 | exit 2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
350 | fi |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
351 | |
637
20241338740c
add first dav-sync hashing test
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
636
diff
changeset
|
352 | sleep 3 |
20241338740c
add first dav-sync hashing test
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
636
diff
changeset
|
353 | |
636
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
354 | # change some files in test1a and push the changes |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
355 | echo "test11_change_a" >> tmp-sync/test1a/file1 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
356 | echo "test11_change_a" >> tmp-sync/test1a/file2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
357 | echo "test11_change_a" >> tmp-sync/test1a/dir1/file1 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
358 | echo "test11_change_a" >> tmp-sync/test1a/dir1/file4 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
359 | echo "test11_change_a" >> tmp-sync/test1a/dir1/subdir1/file3 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
360 | echo "test11_change_a" >> tmp-sync/test1a/dir1/subdir1/file4 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
361 | echo "test11_change_a" >> tmp-sync/test1a/dir1/subdir1/empty2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
362 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
363 | dav_sync_push test1a "test 11: push test1a failed" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
364 | check_tmpout "7 files pushed" "test 11: wrong push counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
365 | check_tmpout "0 conflicts" "test 11: wrong conflict counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
366 | check_tmpout "0 errors" "test 11: wrong error counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
367 | check_tmpout "put: /dir1/subdir1/empty2" "empty2 not pushed (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
368 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
369 | # create conflicts |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
370 | echo "test11_change_a" >> tmp-sync/test1b/file2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
371 | echo "test11_change_a" >> tmp-sync/test1b/dir1/file4 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
372 | echo "test11_change_a" >> tmp-sync/test1b/dir1/subdir1/empty2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
373 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
374 | # first push with conflicts |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
375 | dav_sync_push test1b "test 11: push test1b failed" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
376 | check_tmpout "0 files pushed" "test 11: wrong push counter (test1b 1)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
377 | check_tmpout "3 conflicts" "test 11: wrong conflict counter (test1b 1)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
378 | check_tmpout "0 errors" "test 11: wrong error counter (test1b 1)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
379 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
380 | # second push without conflict detection |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
381 | $DAV_SYNC_BIN push -c test1b > tmp-sync/out.txt |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
382 | if [ $? -ne 0 ]; |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
383 | then |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
384 | echo "test 11: push test1b failed (2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
385 | exit 2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
386 | fi |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
387 | check_tmpout "3 files pushed" "test 11: wrong push counter (test1b 2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
388 | check_tmpout "0 conflicts" "test 11: wrong conflict counter (test1b 2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
389 | check_tmpout "0 errors" "test 11: wrong error counter (test1b 2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
390 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
391 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
392 | # ---------------------------------------------------------------------------- |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
393 | # 12. test: create new file with same name on both sides |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
394 | # expected result: conflict |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
395 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
396 | # prepare test1b |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
397 | dav_sync_pull test1b "test 12: prepare test1b failed" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
398 | check_tmpout "0 conflicts" "test 12: wrong conflict counter (prepare)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
399 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
400 | # create new file in test1a and push the file |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
401 | echo "test12_new_a" >> tmp-sync/test1a/file_new1 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
402 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
403 | dav_sync_push test1a "test 12: push test1a failed" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
404 | check_tmpout "1 file pushed" "test 12: wrong push counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
405 | check_tmpout "0 conflicts" "test 12: wrong conflict counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
406 | check_tmpout "0 errors" "test 12: wrong error counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
407 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
408 | # create new file in test1b and try push the file (conflict) |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
409 | echo "test12_new_b" >> tmp-sync/test1b/file_new1 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
410 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
411 | dav_sync_push test1b "test 12: push test1b failed" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
412 | check_tmpout "0 files pushed" "test 12: wrong push counter (test1b 1)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
413 | check_tmpout "1 conflict" "test 12: wrong conflict counter (test1b 1)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
414 | check_tmpout "0 errors" "test 12: wrong error counter (test1b 1)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
415 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
416 | # pull changes to resolve conflict |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
417 | dav_sync_pull test1b "test 12: pull test1b failed" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
418 | check_tmpout "1 file pulled" "test 12: wrong pull counter" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
419 | check_tmpout "1 conflict" "test 12: wrong conflict counter (pull)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
420 | check_tmpout "0 errors" "test 12: wrong error counter (pull)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
421 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
422 | $DAV_SYNC_BIN resolve-conflicts test1b > tmp-sync/out.txt |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
423 | if [ $? -ne 0 ]; |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
424 | then |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
425 | echo "test 12: resolve-conflicts failed" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
426 | exit 2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
427 | fi |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
428 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
429 | dav_sync_push test1b "test 12: push test1b failed (2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
430 | check_tmpout "1 file pushed" "test 12: wrong push counter (test1b 2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
431 | check_tmpout "0 conflicts" "test 12: wrong conflict counter (test1b 2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
432 | check_tmpout "0 errors" "test 12: wrong error counter (test1b 2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
433 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
434 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
435 | # ---------------------------------------------------------------------------- |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
436 | # 13. test: 2 new, 2 mod files with conflict |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
437 | # 2 new, 2 mod files without conflict |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
438 | # expected result: 4 conflicts, 4 files pushed |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
439 | |
637
20241338740c
add first dav-sync hashing test
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
636
diff
changeset
|
440 | dav_sync_pull test1a "test 13: prepare test1a failed" |
20241338740c
add first dav-sync hashing test
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
636
diff
changeset
|
441 | check_tmpout "0 conflicts" "test 13: wrong conflict counter (prepare test1a)" |
20241338740c
add first dav-sync hashing test
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
636
diff
changeset
|
442 | |
636
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
443 | sleep 3 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
444 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
445 | echo "test13_change_a" >> tmp-sync/test1a/file1 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
446 | echo "test13_change_a" >> tmp-sync/test1a/dir1/file4 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
447 | echo "test13_change_a" >> tmp-sync/test1a/dir1/subdir1/file4 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
448 | echo "test13_change_a" >> tmp-sync/test1a/dir1/subdir1/empty2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
449 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
450 | echo "test13_new_a" >> tmp-sync/test1a/test12_newfile1 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
451 | echo "test13_new_a" >> tmp-sync/test1a/dir1/test12_newfile2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
452 | mkdir tmp-sync/test1a/test12/ |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
453 | echo "test13_new_a" >> tmp-sync/test1a/test12/newfile3 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
454 | echo "test13_new_a" >> tmp-sync/test1a/test12/newfile4 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
455 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
456 | dav_sync_push test1a "test 13: push test1a failed" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
457 | check_tmpout "8 files pushed" "test 13: wrong push counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
458 | check_tmpout "0 conflicts" "test 13: wrong conflict counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
459 | check_tmpout "0 errors" "test 13: wrong error counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
460 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
461 | echo "test13_change_b" >> tmp-sync/test1b/file2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
462 | echo "test13_change_b" >> tmp-sync/test1b/dir1/file4 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
463 | echo "test13_change_b" >> tmp-sync/test1b/dir1/subdir1/file3 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
464 | echo "test13_change_b" >> tmp-sync/test1b/dir1/subdir1/empty2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
465 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
466 | echo "test13_new_b" >> tmp-sync/test1b/test12_newfile1 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
467 | echo "test13_new_b" >> tmp-sync/test1b/dir1/test12_newfile_b1 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
468 | mkdir tmp-sync/test1b/test12/ |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
469 | echo "test13_new_b" >> tmp-sync/test1b/test12/newfile3 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
470 | echo "test13_new_b" >> tmp-sync/test1b/test12/newfile_b1 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
471 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
472 | dav_sync_push test1b "test 13: push test1b failed" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
473 | check_tmpout "4 files pushed" "test 13: wrong push counter (test1b)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
474 | check_tmpout "4 conflicts" "test 13: wrong conflict counter (test1b)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
475 | check_tmpout "0 errors" "test 13: wrong error counter (test1b)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
476 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
477 | # second push without conflict detection |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
478 | $DAV_SYNC_BIN push -c test1b > tmp-sync/out.txt |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
479 | if [ $? -ne 0 ]; |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
480 | then |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
481 | echo "test 13: push test1b failed (2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
482 | exit 2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
483 | fi |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
484 | check_tmpout "4 files pushed" "test 13: wrong push counter (test1b 2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
485 | check_tmpout "0 conflicts" "test 13: wrong conflict counter (test1b 2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
486 | check_tmpout "0 errors" "test 13: wrong error counter (test1b 2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
487 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
488 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
489 | # ---------------------------------------------------------------------------- |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
490 | # 14. pull test1a and compare files |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
491 | # expected result: no conflicts, content of tested files is the same |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
492 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
493 | dav_sync_pull test1a "test 14: pull failed (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
494 | check_tmpout "0 conflicts" "test 14: wrong pull counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
495 | check_tmpout "0 errors" "test 14: wrong error counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
496 | TEST=`cat tmp-sync/out.txt | wc -l` |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
497 | if [ $TEST == "1" ]; then |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
498 | echo "test 14: no files pulled (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
499 | exit 2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
500 | fi |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
501 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
502 | dav_sync_pull test1b "test 14: pull failed (test1b)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
503 | check_tmpout "0 conflicts" "test 14: wrong pull counter (test1b)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
504 | check_tmpout "0 errors" "test 14: wrong error counter (test1b)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
505 | TEST=`cat tmp-sync/out.txt | wc -l` |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
506 | if [ $TEST == "1" ]; then |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
507 | echo "test 14: no files pulled (test1b)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
508 | exit 2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
509 | fi |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
510 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
511 | # compare new files |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
512 | compare_files "file1" "test 14: file1 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
513 | compare_files "dir1/file4" "test 14: dir1/file4 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
514 | compare_files "dir1/file3" "test 14: dir1/file3 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
515 | compare_files "dir1/file2" "test 14: dir1/file2 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
516 | compare_files "dir1/file1" "test 14: dir1/file1 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
517 | compare_files "dir1/subdir1/file1" "test 14: dir1/subdir1/file1 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
518 | compare_files "dir1/subdir1/file2" "test 14: dir1/subdir1/file2 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
519 | compare_files "dir1/subdir1/file3" "test 14: dir1/subdir1/file3 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
520 | compare_files "dir1/subdir1/file4" "test 14: dir1/subdir1/file4 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
521 | compare_files "dir1/subdir1/empty1" "test 14: dir1/subdir1/empty1 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
522 | compare_files "dir1/subdir1/empty1" "test 14: dir1/subdir1/empty2 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
523 | compare_files "test12_newfile1" "test 14: test12_newfile not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
524 | compare_files "dir1/test12_newfile2" "test 14: dir1/test12_newfile2 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
525 | compare_files "test12/newfile3" "test 14: test12/newfile3 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
526 | compare_files "test12/newfile4" "test 14: test12/newfile4 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
527 | compare_files "dir1/test12_newfile_b1" "test 14: dir1/test12_newfile_b1 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
528 | compare_files "test12/newfile_b1" "test 14: test12/newfile_b1 not equal" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
529 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
530 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
531 | # ---------------------------------------------------------------------------- |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
532 | # 15. modify file in test1a, delete in test1b |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
533 | # expected result: 0 delete |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
534 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
535 | echo "test15_change_a" >> tmp-sync/test1a/file1 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
536 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
537 | dav_sync_push test1a "test 15: push failed (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
538 | check_tmpout "1 file pushed" "test 15: wrong push counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
539 | check_tmpout "0 conflicts" "test 15: wrong conflict counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
540 | check_tmpout "0 errors" "test 15: wrong error counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
541 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
542 | rm tmp-sync/test1b/file1 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
543 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
544 | dav_sync_push test1b "test 15: push failed (test1b)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
545 | check_tmpout "0 files pushed" "test 15: wrong push counter (test1b)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
546 | # not sure if we have to check the conflict counter |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
547 | check_tmpout "0 errors" "test 15: wrong error counter (test1b)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
548 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
549 | dav_sync_pull test1b "test 15: pull failed" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
550 | check_tmpout "1 file pulled" "test 15: wrong pull counter" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
551 | check_tmpout "0 conflicts" "test 15: wrong conflict counter (pull)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
552 | check_tmpout "0 errors" "test 15: wrong error counter (pull)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
553 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
554 | dav_sync_push test1b "test 15: push failed (test1b 2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
555 | check_tmpout "0 files pushed" "test 15: wrong push counter (test1b 2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
556 | check_tmpout "0 conflicts" "test 15: wrong conflict counter (test1b 2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
557 | check_tmpout "0 errors" "test 15: wrong error counter (test1b 2)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
558 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
559 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
560 | # ---------------------------------------------------------------------------- |
638
b3077bdb3d77
fix hash based conflict detection
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
637
diff
changeset
|
561 | # 16. test: modify file in test1a/dir1/, delete dir1 in test1b |
636
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
562 | # expected result: many files deleted, modified file not deleted |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
563 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
564 | sleep 3 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
565 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
566 | echo "test16_change_a" >> tmp-sync/test1a/dir1/file3 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
567 | echo "test16_change_a" >> tmp-sync/test1a/file2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
568 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
569 | dav_sync_push test1a "test 16: push failed (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
570 | check_tmpout "2 files pushed" "test 16: wrong push counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
571 | check_tmpout "0 conflicts" "test 16: wrong conflict counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
572 | check_tmpout "0 errors" "test 16: wrong error counter (test1a)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
573 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
574 | rm -Rf tmp-sync/test1b/dir1/ |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
575 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
576 | dav_sync_push test1b "test 16: push failed (test1b)" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
577 | TEST=`cat tmp-sync/out.txt | grep "delete: /dir1/file3"` |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
578 | if [ $? -eq 0 ]; then |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
579 | echo "test 16: /dir1/file3 deleted" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
580 | exit 2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
581 | fi |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
582 | check_tmpout "delete: /dir1/subdir1/" "test 16: missing delete subdir1" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
583 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
584 | TEST=`$DAV_BIN list -lR dav-test-repo/sync/test1/dir1 | wc -l` |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
585 | if [ $TEST != "1" ]; then |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
586 | echo "test 16: wrong resource count" |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
587 | exit 2 |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
588 | fi |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
589 | |
cbd62e87b1c5
add more push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
635
diff
changeset
|
590 |