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

changeset 671
5256d7eb69e7
parent 627
81e066c9ff87
child 761
a2f1d7c1755c
equal deleted inserted replaced
670:ef490647f5d1 671:5256d7eb69e7
32 echo "DAV_BIN variable not set" 32 echo "DAV_BIN variable not set"
33 exit 1 33 exit 1
34 fi 34 fi
35 if [ -z "$DAV_SYNC_BIN" ]; 35 if [ -z "$DAV_SYNC_BIN" ];
36 then 36 then
37 echo "DAV_BIN variable not set" 37 echo "DAV_SYNC_BIN variable not set"
38 exit 1 38 exit 1
39 fi 39 fi
40 40
41 # checks if tmp-sync/out.txt contains a specific text 41 # checks if tmp-sync/out.txt contains a specific text
42 # arg1: pattern 42 # arg1: pattern
71 # expected result: 2 uploads, no errors or conflicts 71 # expected result: 2 uploads, no errors or conflicts
72 72
73 cp synctest/file1 tmp-sync/test1a 73 cp synctest/file1 tmp-sync/test1a
74 cp synctest/file2 tmp-sync/test1a 74 cp synctest/file2 tmp-sync/test1a
75 75
76 OUT=`$DAV_SYNC_BIN push test1a | tail -n 1` 76 OUT=`$DAV_SYNC_BIN push test1a | tail -1`
77 77
78 TEST=`echo $OUT | grep Result` 78 TEST=`echo $OUT | grep Result`
79 if [ $? -ne 0 ]; 79 if [ $? -ne 0 ];
80 then 80 then
81 echo "push 1 failed" 81 echo "push 1 failed"
108 # expected result: no uploads or updates, only status line with zeros 108 # expected result: no uploads or updates, only status line with zeros
109 109
110 dav_sync_push test1a "push 2 failed" 110 dav_sync_push test1a "push 2 failed"
111 111
112 OUT=`wc -l < tmp-sync/out.txt` 112 OUT=`wc -l < tmp-sync/out.txt`
113 if [ "$OUT" != "1" ]; 113 if [ $OUT -ne 1 ];
114 then 114 then
115 echo "push 2: number of output lines not 1" 115 echo "push 2: number of output lines not 1"
116 exit 2 116 exit 2
117 fi 117 fi
118 118
131 # do nothing again, test if double mkcol happens 131 # do nothing again, test if double mkcol happens
132 # expected result: no mkcol 132 # expected result: no mkcol
133 dav_sync_push test1a "push 4 failed" 133 dav_sync_push test1a "push 4 failed"
134 134
135 OUT=`wc -l < tmp-sync/out.txt` 135 OUT=`wc -l < tmp-sync/out.txt`
136 if [ "$OUT" != "1" ]; 136 if [ $OUT -ne 1 ];
137 then 137 then
138 echo "push 4: number of output lines not 1" 138 echo "push 4: number of output lines not 1"
139 exit 2 139 exit 2
140 fi 140 fi
141 141
188 check_tmpout "10 files pushed" "push6: wrong push counter" 188 check_tmpout "10 files pushed" "push6: wrong push counter"
189 check_tmpout "0 files deleted" "push6: wrong delete counter" 189 check_tmpout "0 files deleted" "push6: wrong delete counter"
190 check_tmpout "0 conflicts" "push6: wrong conflict counter" 190 check_tmpout "0 conflicts" "push6: wrong conflict counter"
191 check_tmpout "0 errors" "push6: wrong error counter" 191 check_tmpout "0 errors" "push6: wrong error counter"
192 OUT=`grep mkcol tmp-sync/out.txt | wc -l` 192 OUT=`grep mkcol tmp-sync/out.txt | wc -l`
193 if [ "$OUT" != "48" ]; 193 if [ $OUT -ne 48 ];
194 then 194 then
195 echo "push 6: number of mkcol output lines not 48" 195 echo "push 6: number of mkcol output lines not 48"
196 exit 2 196 exit 2
197 fi 197 fi
198 198
269 OUT=`dav list dav-test-repo/sync/test1/ | wc -l` 269 OUT=`dav list dav-test-repo/sync/test1/ | wc -l`
270 if [ $? -ne 0 ]; then 270 if [ $? -ne 0 ]; then
271 echo "push 11: dav list failed" 271 echo "push 11: dav list failed"
272 exit 2 272 exit 2
273 fi 273 fi
274 if [ "$OUT" != "0" ]; 274 if [ $OUT -ne 0 ];
275 then 275 then
276 echo "push 11: dav-test-repo/sync/test1/ not empty" 276 echo "push 11: dav-test-repo/sync/test1/ not empty"
277 exit 2 277 exit 2
278 fi 278 fi
279 279

mercurial