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