Sun, 21 Apr 2019 11:06:16 +0200
fix that knowledge about resource existence was fucked up by versioning_begin
571
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | #!/bin/sh |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | # |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
4 | # |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | # Copyright 2019 Olaf Wintermann. All rights reserved. |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | # |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | # Redistribution and use in source and binary forms, with or without |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | # modification, are permitted provided that the following conditions are met: |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | # |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | # 1. Redistributions of source code must retain the above copyright |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | # notice, this list of conditions and the following disclaimer. |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | # |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | # 2. Redistributions in binary form must reproduce the above copyright |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | # notice, this list of conditions and the following disclaimer in the |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | # documentation and/or other materials provided with the distribution. |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | # |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
f6de48471c9c
add first dav-sync binary 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 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | # POSSIBILITY OF SUCH DAMAGE. |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | # |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30 | if [ -z "$DAV_BIN" ]; |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31 | then |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32 | echo "DAV_BIN variable not set" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
33 | exit 1 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | fi |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | if [ -z "$DAV_SYNC_BIN" ]; |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | then |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | echo "DAV_BIN variable not set" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | exit 1 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | fi |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | # checks if tmp-sync/out.txt contains a specific text |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
42 | # arg1: pattern |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
43 | # arg2: errormsg |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
44 | check_tmpout() |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
45 | { |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
46 | TEST=`cat tmp-sync/out.txt | grep "$1"` |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
47 | if [ $? -ne 0 ]; |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
48 | then |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
49 | echo "$2" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
50 | exit 2 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51 | fi |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
52 | } |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
53 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
54 | # do dav-sync push and check return value |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
55 | # arg1: dir |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
56 | # arg2: errormsg |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
57 | dav_sync_push() |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
58 | { |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
59 | $DAV_SYNC_BIN push $1 > tmp-sync/out.txt |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
60 | if [ $? -ne 0 ]; |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
61 | then |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
62 | echo "$errormsg" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
63 | exit 2 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
64 | fi |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
65 | } |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
66 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
67 | $DAV_BIN mkcol dav-test-repo/sync/test1 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
68 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
69 | # 1. test |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
70 | # copy to files to the test1a dir and run push |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
71 | # expected result: 2 uploads, no errors or conflicts |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
72 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
73 | cp synctest/file1 tmp-sync/test1a |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
74 | cp synctest/file2 tmp-sync/test1a |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
75 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
76 | OUT=`$DAV_SYNC_BIN push test1a | tail -n 1` |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
77 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
78 | TEST=`echo $OUT | grep Result` |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
79 | if [ $? -ne 0 ]; |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
80 | then |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
81 | echo "push 1 failed" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
82 | exit 2 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
83 | fi |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
84 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
85 | TEST=`echo $OUT | grep "2 files pushed"` |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
86 | if [ $? -ne 0 ]; |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
87 | then |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
88 | echo "wrong push counter" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
89 | exit 2 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
90 | fi |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
91 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
92 | TEST=`echo $OUT | grep "0 conflicts"` |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
93 | if [ $? -ne 0 ]; |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
94 | then |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
95 | echo "wrong conflict counter" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
96 | exit 2 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
97 | fi |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
98 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
99 | TEST=`echo $OUT | grep "0 files deleted"` |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
100 | if [ $? -ne 0 ]; |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
101 | then |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
102 | echo "wrong delete counter" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
103 | exit 2 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
104 | fi |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
105 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
106 | # 2. test |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
107 | # do nothing |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
108 | # expected result: no uploads or updates, only status line with zeros |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
109 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
110 | dav_sync_push test1a "push 2 failed" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
111 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
112 | OUT=`wc -l < tmp-sync/out.txt` |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
113 | if [ "$OUT" != "1" ]; |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
114 | then |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
115 | echo "push 2: number of output lines not 1" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
116 | exit 2 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
117 | fi |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
118 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
119 | check_tmpout "0 files pushed" "push 2: wrong push counter" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
120 | check_tmpout "0 errors" "push 2: wrong error counter" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
121 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
122 | # 3. test |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
123 | # add empty dir |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
124 | # expected result: 1 mkcol |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
125 | mkdir tmp-sync/test1a/emptydir |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
126 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
127 | dav_sync_push test1a "push 3 failed" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
128 | check_tmpout "mkcol: /emptydir" "push 3: no mkcol" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
129 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
130 | # 4. test |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
131 | # do nothing again, test if double mkcol happens |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
132 | # expected result: no mkcol |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
133 | dav_sync_push test1a "push 4 failed" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
134 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
135 | OUT=`wc -l < tmp-sync/out.txt` |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
136 | if [ "$OUT" != "1" ]; |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
137 | then |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
138 | echo "push 4: number of output lines not 1" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
139 | exit 2 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
140 | fi |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
141 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
142 | check_tmpout "0 files pushed" "push 4: wrong push counter" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
143 | check_tmpout "0 errors" "push 4: wrong error counter" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
144 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
145 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
146 | # 5. test |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
147 | # touch file |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
148 | # expected result: upload touched file |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
149 | sleep 2 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
150 | touch tmp-sync/test1a/file1 |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
151 | |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
152 | dav_sync_push test1a "push 5 failed" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
153 | check_tmpout "put: /file1" "push 5: no put" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
154 | check_tmpout "1 file pushed" "push 5: wrong push counter" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
155 | check_tmpout "0 conflicts" "push 5: wrong conflict counter" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
156 | check_tmpout "0 files deleted" "push 5: wrong delete counter" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
157 | check_tmpout "0 errors" "push 5: wrong error counter" |
f6de48471c9c
add first dav-sync binary tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
158 |