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

Sun, 21 Jul 2024 23:19:40 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 21 Jul 2024 23:19:40 +0200
changeset 822
f9e40f5c6daf
parent 774
8c8aed7e1756
permissions
-rwxr-xr-x

fix dav_set_string_property crash if an unknown namespace prefix was specified

681
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 #!/bin/sh
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 #
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 #
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 # Copyright 2019 Olaf Wintermann. All rights reserved.
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 #
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 # Redistribution and use in source and binary forms, with or without
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 # modification, are permitted provided that the following conditions are met:
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 #
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 # 1. Redistributions of source code must retain the above copyright
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 # notice, this list of conditions and the following disclaimer.
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 #
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 # 2. Redistributions in binary form must reproduce the above copyright
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 # notice, this list of conditions and the following disclaimer in the
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 # documentation and/or other materials provided with the distribution.
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 #
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3320429502cf fix some split bugs and add 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
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 # POSSIBILITY OF SUCH DAMAGE.
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28 #
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 if [ -z "$DAV_BIN" ];
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31 then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 echo "DAV_BIN variable not set"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33 exit 1
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 if [ -z "$DAV_SYNC_BIN" ];
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37 echo "DAV_BIN variable not set"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38 exit 1
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41 XATTR=../../build/xattrtool
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
42
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43 # checks if tmp-sync/out.txt contains a specific text
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44 # arg1: pattern
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45 # arg2: errormsg
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46 check_tmpout()
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47 {
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 TEST=`cat tmp-sync/out.txt | grep "$1"`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 if [ $? -ne 0 ];
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50 then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 echo "$2"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54 }
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56 # checks if tmp-sync/out.txt does not contain a specific text
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57 # arg1: pattern
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58 # arg2: errormsg
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59 ncheck_tmpout()
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60 {
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 TEST=`cat tmp-sync/out.txt | grep "$1"`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 if [ $? -eq 0 ];
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64 echo "$2"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67 }
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69 # do dav-sync push and check return value
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70 # arg1: dir
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 # arg2: errormsg
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72 dav_sync_push()
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73 {
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74 $DAV_SYNC_BIN push $1 > tmp-sync/out.txt
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
75 if [ $? -ne 0 ];
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76 then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
77 echo "$2"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
78 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
79 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
80 }
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
81 # do dav-sync pull and check return value
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82 # arg1: dir
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83 # arg2: errormsg
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
84 dav_sync_pull()
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85 {
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86 $DAV_SYNC_BIN pull $1 > tmp-sync/out.txt
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87 if [ $? -ne 0 ];
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88 then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89 echo "$2"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
91 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92 }
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
94 rm -f .dav/dav-sync-tests-test6a-db.xml
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
95 rm -f .dav/dav-sync-tests-test6b-db.xml
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
97 $DAV_BIN rm dav-test-repo/sync/test6 2> /dev/null
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
98
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99 $DAV_BIN mkcol dav-test-repo/sync/test6 2> /dev/null
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101 # tmp sync dir
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102 rm -Rf tmp-sync
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103 mkdir tmp-sync
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104 mkdir tmp-sync/test6a
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
105 mkdir tmp-sync/test6b
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
106
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
107 # ----------------------------------------------------------------------------
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
108 # test 1: add some small files and sync
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109 # expected result: everything synced, no split
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
110
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
111 mkdir tmp-sync/test6a/dir1
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
112 mkdir tmp-sync/test6a/dir1/sub1
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
113
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
114 cp synctest/file1 tmp-sync/test6a
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115 cp synctest/file2 tmp-sync/test6a/dir1
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
116 cp synctest/file3 tmp-sync/test6a/dir1/sub1
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
117
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118 dav_sync_push test6a "test 1: push failed"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119 check_tmpout "3 files pushed" "test 1: wrong push counter"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120 check_tmpout "0 conflicts" "test 1: wrong conflict counter (push)"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121 check_tmpout "0 errors" "test 1: wrong error counter (push)"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
123 dav_sync_pull test6b "test 1: pull failed"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
124 check_tmpout "3 files pulled" "test 1: wrong pull counter"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125 check_tmpout "0 conflicts" "test 1: wrong conflict counter (pull)"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
126 check_tmpout "0 errors" "test 1: wrong error counter (pull)"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128 $DAV_BIN info dav-test-repo/sync/test6/file1 | grep "type: resource" > /dev/null 2>&1
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129 if [ $? -ne 0 ]; then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130 echo "test 1: file1 not a resource"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
132 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133 $DAV_BIN info dav-test-repo/sync/test6/dir1/file2 | grep "type: resource" > /dev/null 2>&1
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134 if [ $? -ne 0 ]; then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
135 echo "test 1: file2 not a resource"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
136 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
138 $DAV_BIN info dav-test-repo/sync/test6/dir1/sub1/file3 | grep "type: resource" > /dev/null 2>&1
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
139 if [ $? -ne 0 ]; then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 echo "test 1: file3 not a resource"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
141 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
142 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
144 # ----------------------------------------------------------------------------
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
145 # test 2: add a large file
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
146 # expected result: split
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
147
774
8c8aed7e1756 fix split test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 682
diff changeset
148 head -c 1048576 /dev/zero | tr '\0' 'a' > tmp-sync/xa
681
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
149 cat tmp-sync/xa | sed 's/a/b/g' > tmp-sync/xb
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150 cat tmp-sync/xa | sed 's/a/c/g' > tmp-sync/xc
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151 cat tmp-sync/xa | sed 's/a/1/g' > tmp-sync/x1
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
152 cat tmp-sync/xa | sed 's/a/2/g' > tmp-sync/x2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
153 cat tmp-sync/xa | sed 's/a/3/g' > tmp-sync/x3
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
154
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
155 cat tmp-sync/xa tmp-sync/xb tmp-sync/xc tmp-sync/x1 tmp-sync/x2 tmp-sync/x3 > tmp-sync/test6a/big1
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
156
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
157 dav_sync_push test6a "test 2: push failed"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
158 check_tmpout "1 file pushed" "test 2: wrong push counter"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
159 check_tmpout "0 conflicts" "test 2: wrong conflict counter (push)"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160 check_tmpout "0 errors" "test 2: wrong error counter (push)"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
161
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
162 dav_sync_pull test6b "test 2: pull failed"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
163 check_tmpout "1 file pulled" "test 2: wrong pull counter"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
164 check_tmpout "0 conflicts" "test 2: wrong conflict counter (pull)"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
165 check_tmpout "0 errors" "test 2: wrong error counter (pull)"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
166
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
167 $DAV_BIN info dav-test-repo/sync/test6/big1 | grep "type: collection" > /dev/null 2>&1
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
168 if [ $? -ne 0 ]; then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
169 echo "test 2: big1 not a collection"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
170 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
171 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
172
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
173 HASH1=`cat tmp-sync/test6a/big1 | sha256sum`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
174 HASH2=`cat tmp-sync/test6b/big1 | sha256sum`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
175 if [ "$HASH1" != "$HASH2" ]; then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
176 echo "test 2: big1 not equal"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
177 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
178 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
179
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
180 $DAV_BIN list -l dav-test-repo/sync/test6/big1 > tmp-sync/list.txt 2> /dev/null
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
181 if [ $? -ne 0 ]; then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
182 echo "test 2: dav list failed"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
183 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
185
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186 TEST=`cat tmp-sync/list.txt | wc -l`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
187 if [ $TEST -ne 6 ]; then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
188 echo "test 2: wrong block count"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
189 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
190 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
191
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
192 LASTMODIFIED_PART0=`$DAV_BIN get-property dav-test-repo/sync/test6/big1/0 D:getlastmodified`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
193 LASTMODIFIED_PART1=`$DAV_BIN get-property dav-test-repo/sync/test6/big1/1 D:getlastmodified`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
194 LASTMODIFIED_PART2=`$DAV_BIN get-property dav-test-repo/sync/test6/big1/2 D:getlastmodified`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
195 LASTMODIFIED_PART3=`$DAV_BIN get-property dav-test-repo/sync/test6/big1/3 D:getlastmodified`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
196 LASTMODIFIED_PART4=`$DAV_BIN get-property dav-test-repo/sync/test6/big1/4 D:getlastmodified`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
197 LASTMODIFIED_PART5=`$DAV_BIN get-property dav-test-repo/sync/test6/big1/5 D:getlastmodified`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
198
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
199
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
200 # ----------------------------------------------------------------------------
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
201 # test 3: modify first block
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
202 # expected result: first block synced
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
203
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
204 sleep 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
205
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
206 dd if=tmp-sync/xc of=tmp-sync/test6a/big1 conv=notrunc > /dev/null 2>&1
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
207
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
208 dav_sync_push test6a "test 3: push failed"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
209 check_tmpout "1 file pushed" "test 3: wrong push counter"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
210 check_tmpout "0 conflicts" "test 3: wrong conflict counter (push)"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
211 check_tmpout "0 errors" "test 3: wrong error counter (push)"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
212
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
213 dav_sync_pull test6b "test 3: pull failed"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
214 check_tmpout "1 file pulled" "test 3: wrong pull counter"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
215 check_tmpout "0 conflicts" "test 3: wrong conflict counter (pull)"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
216 check_tmpout "0 errors" "test 3: wrong error counter (pull)"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
217
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
218 HASH1=`cat tmp-sync/test6a/big1 | sha256sum`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
219 HASH2=`cat tmp-sync/test6b/big1 | sha256sum`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
220 if [ "$HASH1" != "$HASH2" ]; then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
221 echo "test 3: big1 not equal"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
222 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
223 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
224
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
225 LASTMODIFIED_PART0_2=`$DAV_BIN get-property dav-test-repo/sync/test6/big1/0 D:getlastmodified`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
226 LASTMODIFIED_PART1_2=`$DAV_BIN get-property dav-test-repo/sync/test6/big1/1 D:getlastmodified`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
227 LASTMODIFIED_PART2_2=`$DAV_BIN get-property dav-test-repo/sync/test6/big1/2 D:getlastmodified`
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
228
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
229 if [ "$LASTMODIFIED_PART0" = "$LASTMODIFIED_PART0_2" ]; then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
230 echo "test 3: part 0 not updated"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
231 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
232 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
233 if [ "$LASTMODIFIED_PART1" != "$LASTMODIFIED_PART1_2" ]; then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
234 echo "test 3: part 1 updated"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
235 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
236 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
237 if [ "$LASTMODIFIED_PART2" != "$LASTMODIFIED_PART2_2" ]; then
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
238 echo "test 3: part 2 updated"
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
239 exit 2
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
240 fi
3320429502cf fix some split bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
241
682
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
242
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
243 # ----------------------------------------------------------------------------
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
244 # test 4: add new block to big1 and sync
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
245 # expected result: block synced
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
246
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
247 sleep 2
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
248
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
249 cat tmp-sync/test6a/big1 tmp-sync/xb > tmp-sync/test6a/big_tmp
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
250 rm tmp-sync/test6a/big1
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
251 mv tmp-sync/test6a/big_tmp tmp-sync/test6a/big1
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
252
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
253 dav_sync_push test6a "test 4: push failed"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
254 check_tmpout "1 file pushed" "test 4: wrong push counter"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
255 check_tmpout "0 conflicts" "test 4: wrong conflict counter (push)"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
256 check_tmpout "0 errors" "test 4: wrong error counter (push)"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
257
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
258 dav_sync_pull test6b "test 4: pull failed"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
259 check_tmpout "1 file pulled" "test 4: wrong pull counter"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
260 check_tmpout "0 conflicts" "test 4: wrong conflict counter (pull)"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
261 check_tmpout "0 errors" "test 4: wrong error counter (pull)"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
262
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
263 HASH1=`cat tmp-sync/test6a/big1 | sha256sum`
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
264 HASH2=`cat tmp-sync/test6b/big1 | sha256sum`
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
265 if [ "$HASH1" != "$HASH2" ]; then
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
266 echo "test 4: big1 not equal"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
267 exit 2
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
268 fi
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
269
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
270
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
271 # ----------------------------------------------------------------------------
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
272 # test 5: add some extra bytes to big1 and sync
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
273 # expected result: block synced
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
274
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
275 sleep 2
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
276
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
277 echo "test5-mod1" >> tmp-sync/test6a/big1
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
278
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
279 dav_sync_push test6a "test 5: push failed"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
280 check_tmpout "1 file pushed" "test 5: wrong push counter"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
281 check_tmpout "0 conflicts" "test 5: wrong conflict counter (push)"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
282 check_tmpout "0 errors" "test 5: wrong error counter (push)"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
283
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
284 dav_sync_pull test6b "test 5: pull failed"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
285 check_tmpout "1 file pulled" "test 5: wrong pull counter"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
286 check_tmpout "0 conflicts" "test 5: wrong conflict counter (pull)"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
287 check_tmpout "0 errors" "test 5: wrong error counter (pull)"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
288
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
289 HASH1=`cat tmp-sync/test6a/big1 | sha256sum`
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
290 HASH2=`cat tmp-sync/test6b/big1 | sha256sum`
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
291 if [ "$HASH1" != "$HASH2" ]; then
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
292 echo "test 5: big1 not equal"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
293 exit 2
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
294 fi
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
295
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
296
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
297 # ----------------------------------------------------------------------------
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
298 # test 6: decrease size of big1 and sync
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
299 # expected result: file truncated
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
300
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
301 # no sleep
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
302 cat tmp-sync/xc tmp-sync/xb tmp-sync/xc > tmp-sync/test6a/big1
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
303
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
304 dav_sync_push test6a "test 6: push failed"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
305 check_tmpout "1 file pushed" "test 6: wrong push counter"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
306 check_tmpout "0 conflicts" "test 6: wrong conflict counter (push)"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
307 check_tmpout "0 errors" "test 6: wrong error counter (push)"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
308
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
309 dav_sync_pull test6b "test 6: pull failed"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
310 check_tmpout "1 file pulled" "test 6: wrong pull counter"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
311 check_tmpout "0 conflicts" "test 6: wrong conflict counter (pull)"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
312 check_tmpout "0 errors" "test 6: wrong error counter (pull)"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
313
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
314 HASH1=`cat tmp-sync/test6a/big1 | sha256sum`
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
315 HASH2=`cat tmp-sync/test6b/big1 | sha256sum`
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
316 if [ "$HASH1" != "$HASH2" ]; then
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
317 echo "test 6: big1 not equal"
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
318 exit 2
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
319 fi
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
320
a7072ebb1ce0 add more split tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 681
diff changeset
321

mercurial