test/bin-test/test-dav-sync-pull-conflict.sh

Tue, 03 Sep 2019 21:24:17 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Tue, 03 Sep 2019 21:24:17 +0200
changeset 636
cbd62e87b1c5
parent 635
a6b1ec1b7ba0
child 637
20241338740c
permissions
-rwxr-xr-x

add more push conflict tests

632
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 #!/bin/sh
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 #
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 #
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 # Copyright 2019 Olaf Wintermann. All rights reserved.
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 #
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 # Redistribution and use in source and binary forms, with or without
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 # modification, are permitted provided that the following conditions are met:
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 #
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 # 1. Redistributions of source code must retain the above copyright
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 # notice, this list of conditions and the following disclaimer.
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 #
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 # 2. Redistributions in binary form must reproduce the above copyright
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 # notice, this list of conditions and the following disclaimer in the
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 # documentation and/or other materials provided with the distribution.
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 #
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2e1b59290829 rename conflict test script
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
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 # POSSIBILITY OF SUCH DAMAGE.
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28 #
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 #
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31 # Test dav-sync pull conflict detection
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 # and related commands
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33 #
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 if [ -z "$DAV_BIN" ];
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37 echo "DAV_BIN variable not set"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38 exit 1
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40 if [ -z "$DAV_SYNC_BIN" ];
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41 then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
42 echo "DAV_BIN variable not set"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43 exit 1
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46 # checks if tmp-sync/out.txt contains a specific text
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47 # arg1: pattern
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 # arg2: errormsg
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 check_tmpout()
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50 {
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 TEST=`cat tmp-sync/out.txt | grep "$1"`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 if [ $? -ne 0 ];
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53 then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54 echo "$2"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57 }
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59 # do dav-sync push and check return value
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60 # arg1: dir
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 # arg2: errormsg
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 dav_sync_push()
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 {
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64 $DAV_SYNC_BIN push $1 > tmp-sync/out.txt
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 if [ $? -ne 0 ];
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67 echo "$2"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70 }
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 # do dav-sync pull and check return value
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72 # arg1: dir
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73 # arg2: errormsg
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74 dav_sync_pull()
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
75 {
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76 $DAV_SYNC_BIN pull $1 > tmp-sync/out.txt
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
77 if [ $? -ne 0 ];
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
78 then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
79 echo "$2"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
80 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
81 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82 }
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
84 rm -f .dav/dav-sync-tests-test1a-db.xml
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85 rm -f .dav/dav-sync-tests-test1b-db.xml
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87 $DAV_BIN rm dav-test-repo/sync/test1 2> /dev/null
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88 $DAV_BIN rm dav-test-repo/sync/test2 2> /dev/null
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90 $DAV_BIN mkcol dav-test-repo/sync/test1 2> /dev/null
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
91 $DAV_BIN mkcol dav-test-repo/sync/test2 2> /dev/null
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92
635
a6b1ec1b7ba0 add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 634
diff changeset
93 # tmp sync dir
a6b1ec1b7ba0 add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 634
diff changeset
94 rm -Rf tmp-sync
a6b1ec1b7ba0 add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 634
diff changeset
95 mkdir tmp-sync
a6b1ec1b7ba0 add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 634
diff changeset
96 mkdir tmp-sync/test1a
a6b1ec1b7ba0 add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 634
diff changeset
97 mkdir tmp-sync/test1b
a6b1ec1b7ba0 add push conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 634
diff changeset
98
632
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99 # prepare
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100 cp synctest/file1 tmp-sync/test1a
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101 cp synctest/file2 tmp-sync/test1a
634
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
102
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
103 mkdir tmp-sync/test1a/dir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
104 mkdir tmp-sync/test1a/dir2/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
105 mkdir tmp-sync/test1a/dir1/subdir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
106 mkdir tmp-sync/test1a/dir2/subdir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
107
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
108 cp synctest/file1 tmp-sync/test1a/dir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
109 cp synctest/file2 tmp-sync/test1a/dir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
110 cp synctest/file3 tmp-sync/test1a/dir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
111 cp synctest/file4 tmp-sync/test1a/dir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
112
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
113 cp synctest/file1 tmp-sync/test1a/dir2/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
114 cp synctest/file2 tmp-sync/test1a/dir2/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
115 cp synctest/file3 tmp-sync/test1a/dir2/subdir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
116 cp synctest/file4 tmp-sync/test1a/dir2/subdir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
117
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
118 cp synctest/file1 tmp-sync/test1a/dir1/subdir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
119 cp synctest/file2 tmp-sync/test1a/dir1/subdir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
120 cp synctest/file3 tmp-sync/test1a/dir1/subdir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
121 cp synctest/file4 tmp-sync/test1a/dir1/subdir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
122 cp synctest/empty1 tmp-sync/test1a/dir1/subdir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
123 cp synctest/empty2 tmp-sync/test1a/dir1/subdir1/
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
124
632
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125 dav_sync_push test1a "prepare: push failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
126 dav_sync_pull test1b "prepare: pull failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127 sleep 3
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129 # ----------------------------------------------------------------------------
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130 # 1. test: pull, local file also modified
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131 # expected result: 1 conflict
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
132
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133 echo "conflict1-test1" >> tmp-sync/test1a/file1
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134 dav_sync_push test1a "prepare: push failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
135 check_tmpout "1 file pushed" "test 1: wrong push counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
136
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137 TEST1B_COUNT1=`ls tmp-sync/test1b/ | wc -l`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
138
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
139 echo "conflict1-test1-conflict" >> tmp-sync/test1b/file1
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 dav_sync_pull test1b "prepare: pull failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
141 check_tmpout "1 file pulled" "test 1: wrong pull counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
142 check_tmpout "1 conflict" "test 1: wrong conflict counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143 check_tmpout "0 errors" "test 1: wrong error counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
144
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
145 TEST1B_COUNT2=`ls tmp-sync/test1b/ | wc -l`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
146 # check if the conflict file was moved
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
147 if [ $TEST1B_COUNT1 = $TEST1B_COUNT2 ]; then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148 echo "test 1: conflict file not renamed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
149 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
152 # warning: never check if the moved conflict file has a specific
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
153 # name like "orig.0.file1"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
154
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
155 # ----------------------------------------------------------------------------
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
156 # 2. test: check list-conflicts command
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
157 # expected result: "/file1" output
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
158
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
159 $DAV_SYNC_BIN list-conflicts test1b > tmp-sync/out.txt
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160 if [ $? -ne 0 ]; then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
161 echo "test 2: list-conflicts failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
162 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
163 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
164 TEST=`cat tmp-sync/out.txt | grep "/file1"`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
165 if [ $? -ne 0 ];
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
166 then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
167 echo "test 2: wrong list-conflicts output"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
168 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
169 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
170
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
171 # ----------------------------------------------------------------------------
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
172 # 3. test: check delete-conflicts command
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
173 # expected result: conflict file ("/orig.0.file1") deleted
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
174
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
175 # don't check if the conflict file has this specific name
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
176
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
177 $DAV_SYNC_BIN delete-conflicts test1b > tmp-sync/out.txt
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
178 if [ $? -ne 0 ]; then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
179 echo "test 3: delete-conflicts failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
180 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
181 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
182 TEST=`cat tmp-sync/out.txt | grep "1 conflict file deleted"`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
183 if [ $? -ne 0 ];
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184 then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
185 echo "test 3: wrong delete-conflicts output"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
187 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
188
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
189 TEST1B_COUNT3=`ls tmp-sync/test1b/ | wc -l`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
190
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
191 if [ $TEST1B_COUNT1 != $TEST1B_COUNT3 ]; then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
192 echo "test 3: file not removed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
193 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
194 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
195
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
196 # ----------------------------------------------------------------------------
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
197 # 4. test: pull after deleted conflicts
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
198 # expected result: 0 files pulled, 0 conflicts
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
199
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
200 dav_sync_pull test1b "test 4: pull failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
201 check_tmpout "0 files pulled" "test 4: wrong pull counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
202 check_tmpout "0 conflicts" "test 4: wrong conflict counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
203 check_tmpout "0 errors" "test 4: wrong error counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
204
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
205 # ----------------------------------------------------------------------------
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
206 # 5. test: pull, local file also modified, delete-conflicts
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
207 # this test prepares test 6, to test 'push' after 'delete-conflicts'
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
208 # expected result: 0 files pulled, 0 conflicts
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
209
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
210 sleep 3 # make sure mtime changes
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
211
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
212 echo "conflict1-test5" >> tmp-sync/test1a/file1
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
213 dav_sync_push test1a "prepare: push failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
214 check_tmpout "1 file pushed" "test 1: wrong push counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
215
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
216 echo "conflict1-test5-conflict" >> tmp-sync/test1b/file1
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
217 dav_sync_pull test1b "prepare: pull failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
218 check_tmpout "1 file pulled" "test 1: wrong pull counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
219 check_tmpout "1 conflict" "test 1: wrong conflict counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
220 check_tmpout "0 errors" "test 1: wrong error counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
221
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
222 $DAV_SYNC_BIN delete-conflicts test1b > tmp-sync/out.txt
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
223 if [ $? -ne 0 ]; then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
224 echo "test 3: delete-conflicts failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
225 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
226 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
227 TEST=`cat tmp-sync/out.txt | grep "1 conflict file deleted"`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
228 if [ $? -ne 0 ];
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
229 then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
230 echo "test 3: wrong delete-conflicts output"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
231 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
232 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
233
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
234
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
235 # ----------------------------------------------------------------------------
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
236 # 6. test: push after deleted conflicts
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
237 # expected result: 0 files pushed, 0 conflicts
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
238
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
239 dav_sync_push test1b "test 6: push failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
240 check_tmpout "0 files pushed" "test 6: wrong push counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
241 check_tmpout "0 conflicts" "test 6: wrong conflict counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
242 check_tmpout "0 errors" "test 6: wrong error counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
243
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
244
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
245 # ----------------------------------------------------------------------------
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
246 # 7. test: resolve-conflicts after pull, followed by push
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
247 # expected result: pull with 1 conflict, resolve-conflicts removes conflicts
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
248 # from db (list-conflicts doesn't show conflicts after that)
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
249
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
250 sleep 3 # make sure mtime changes
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
251
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
252 echo "conflict1-test7" >> tmp-sync/test1a/file1
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
253 dav_sync_push test1a "prepare: push failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
254 check_tmpout "1 file pushed" "test 7: wrong push counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
255
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
256 echo "conflict1-test7-conflict" >> tmp-sync/test1b/file1
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
257 dav_sync_pull test1b "prepare: pull failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
258 check_tmpout "1 file pulled" "test 7: wrong pull counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
259 check_tmpout "1 conflict" "test 7: wrong conflict counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
260 check_tmpout "0 errors" "test 7: wrong error counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
261
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
262 TEST1B_COUNT_T7_1=`ls tmp-sync/test1b/ | wc -l`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
263
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
264 $DAV_SYNC_BIN resolve-conflicts test1b > tmp-sync/out.txt
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
265 if [ $? -ne 0 ]; then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
266 echo "test 7: resolve-conflicts failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
267 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
268 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
269 TEST=`cat tmp-sync/out.txt | grep "1 conflict resolved"`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
270 if [ $? -ne 0 ];
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
271 then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
272 echo "test 7: wrong resolve-conflicts output"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
273 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
274 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
275
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
276 TEST1B_COUNT_T7_2=`ls tmp-sync/test1b/ | wc -l`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
277
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
278 if [ $TEST1B_COUNT_T7_1 != $TEST1B_COUNT_T7_2 ]; then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
279 echo "test 7: number of files has changed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
280 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
281 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
282
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
283 TEST7=`dav-sync list-conflicts test1b | wc -l`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
284 if [ $TEST7 != "0" ]; then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
285 echo "test 7: list-conflicts must not show conflicts"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
286 return 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
287 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
288
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
289 # pull again, should do nothing
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
290
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
291 dav_sync_pull test1b "test 7: pull(2) failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
292 check_tmpout "0 files pulled" "test 7: wrong pull counter (2)"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
293 check_tmpout "0 conflicts" "test 7: wrong conflict counter (2)"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
294 check_tmpout "0 errors" "test 7: wrong error counter (2)"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
295
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
296 # ----------------------------------------------------------------------------
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
297 # 8. test: resolve-conflicts after pull, followed by push
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
298 # expected result: pull with 1 conflict, resolve-conflicts removes conflicts
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
299 # from db (list-conflicts doesn't show conflicts after that)
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
300
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
301 # test mostly the same as test 7
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
302
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
303 sleep 3 # make sure mtime changes
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
304
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
305 echo "conflict1-test8" >> tmp-sync/test1a/file1
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
306 dav_sync_push test1a "prepare: push failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
307 check_tmpout "1 file pushed" "test 8: wrong push counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
308
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
309 echo "conflict1-test8-conflict" >> tmp-sync/test1b/file1
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
310 dav_sync_pull test1b "prepare: pull failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
311 check_tmpout "1 file pulled" "test 8: wrong pull counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
312 check_tmpout "1 conflict" "test 8: wrong conflict counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
313 check_tmpout "0 errors" "test 8: wrong error counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
314
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
315 TEST1B_COUNT_T7_1=`ls tmp-sync/test1b/ | wc -l`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
316
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
317 $DAV_SYNC_BIN resolve-conflicts test1b > tmp-sync/out.txt
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
318 if [ $? -ne 0 ]; then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
319 echo "test 8: resolve-conflicts failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
320 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
321 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
322 TEST=`cat tmp-sync/out.txt | grep "1 conflict resolved"`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
323 if [ $? -ne 0 ];
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
324 then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
325 echo "test 8: wrong resolve-conflicts output"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
326 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
327 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
328
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
329 TEST1B_COUNT_T7_2=`ls tmp-sync/test1b/ | wc -l`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
330
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
331 if [ $TEST1B_COUNT_T7_1 != $TEST1B_COUNT_T7_2 ]; then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
332 echo "test 8: number of files has changed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
333 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
334 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
335
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
336 TEST7=`dav-sync list-conflicts test1b | wc -l`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
337 if [ $TEST7 != "0" ]; then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
338 echo "test 8: list-conflicts must not show conflicts"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
339 return 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
340 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
341
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
342 # push, 2 resolved conflict files (test 7 and test 8 'orig' file)
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
343
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
344 dav_sync_push test1b "test 8: push failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
345 check_tmpout "2 files pushed" "test 8: wrong push counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
346 check_tmpout "0 conflicts" "test 8: wrong conflicts counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
347 check_tmpout "0 errors" "test 8: wrong error counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
348
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
349 # push again, shoud do nothing
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
350 dav_sync_push test1b "test 8: push(2) failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
351 check_tmpout "0 files pushed" "test 8: wrong push counter (2)"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
352 check_tmpout "0 conflicts" "test 8: wrong conflicts counter (2)"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
353 check_tmpout "0 errors" "test 8: wrong error counter (2)"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
354
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
355
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
356 # ----------------------------------------------------------------------------
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
357 # 9. test: test1a deleted file, test1b modified file
634
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
358 # expected result: no delete
632
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
359
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
360 sleep 3 # make sure mtime changes
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
361
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
362 rm -f tmp-sync/test1a/file1
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
363
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
364 dav_sync_push test1a "test 9: push failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
365 check_tmpout "1 file deleted" "test 9: wrong delete counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
366 check_tmpout "0 conflicts" "test 9: wrong conflict counter"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
367
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
368 echo "conflict1-test9-conflict" >> tmp-sync/test1b/file1
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
369
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
370 dav_sync_pull test1b "test 9: pull failed"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
371 # don't check conflict counter
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
372 TEST=`cat tmp-sync/out.txt | grep "1 file deleted"`
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
373 if [ $? -eq 0 ];
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
374 then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
375 echo "test 9: file1 deleted"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
376 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
377 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
378
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
379 cat tmp-sync/test1b/file1 > /dev/null 2>&1
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
380 if [ $? -ne 0 ]; then
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
381 echo "test 9: file1 deleted (2)"
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
382 exit 2
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
383 fi
2e1b59290829 rename conflict test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
384
634
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
385 # ----------------------------------------------------------------------------
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
386 # 10. test: test1a deleted 2 files in subdir, test1b modified one file
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
387 # expected result: 1 delete
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
388
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
389 # no sleep required, because we are working with other files
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
390
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
391 rm -f tmp-sync/test1a/dir2/subdir1/file3
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
392 rm -f tmp-sync/test1a/dir2/subdir1/file4
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
393
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
394 dav_sync_push test1a "test 10: push failed"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
395 check_tmpout "2 files deleted" "test 10: wrong delete counter"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
396 check_tmpout "0 conflicts" "test 9: wrong conflict counter"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
397
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
398 echo "conflict1-test10-conflict" >> tmp-sync/test1b/dir2/subdir1/file4
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
399
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
400 dav_sync_pull test1b "test 10: pull failed"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
401 # don't check conflict counter
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
402 check_tmpout "1 file deleted" "test 10: wrong delete counter"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
403
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
404 cat tmp-sync/test1b/dir2/subdir1/file4 > /dev/null 2>&1
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
405 if [ $? -ne 0 ]; then
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
406 echo "test 10: file4 deleted"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
407 exit 2
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
408 fi
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
409
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
410
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
411 # ----------------------------------------------------------------------------
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
412 # 11. test: delete dir in test1a, modify 1 file in test1b
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
413 # expected result: 1 remaining file
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
414
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
415 # no sleep required, because we are working with other files
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
416
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
417 rm -Rf tmp-sync/test1a/dir1
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
418
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
419 dav_sync_push test1a "test 11: push failed"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
420 check_tmpout "0 conflicts" "test 11: wrong conflict counter (push)"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
421 check_tmpout "0 errors" "test 11: wrong error counter (push)"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
422
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
423 echo "conflict1-test11-conflict" >> tmp-sync/test1b/dir1/file3
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
424
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
425 dav_sync_pull test1b "test 11: pull failed"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
426 check_tmpout "0 errors" "test 11: wrong error counter (pull)"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
427 check_tmpout "delete: " "test 11: no deletes (pull)"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
428
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
429 TEST=`ls tmp-sync/test1b/dir1/ | wc -l`
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
430 if [ $TEST != "1" ]; then
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
431 echo "test 11: wrong file count"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
432 exit 2
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
433 fi
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
434
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
435
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
436 # ----------------------------------------------------------------------------
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
437 # 12. test: test1a modifies file, test1b deletes file
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
438 # expected result: pull test1b restores deleted file
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
439
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
440 # no sleep required, because we are working with other files
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
441
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
442 echo "modified" >> tmp-sync/test1a/file2
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
443
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
444 dav_sync_push test1a "test 12: push failed"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
445 check_tmpout "1 file pushed" "test 12: wrong push counter"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
446 check_tmpout "0 conflicts" "test 12: wrong conflict counter (push)"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
447 check_tmpout "0 errors" "test 12: wrong error counter (push)"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
448
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
449 rm tmp-sync/test1b/file2
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
450
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
451 dav_sync_pull test1b "test 12: pull failed"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
452 check_tmpout "1 file pulled" "test 12: wrong pull counter"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
453 check_tmpout "0 conflicts" "test 12: wrong conflict counter (pull)"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
454 check_tmpout "0 errors" "test 12: wrong error counter (pull)"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
455
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
456 cat tmp-sync/test1b/file2 > /dev/null 2>&1
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
457 if [ $? -ne 0 ]; then
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
458 echo "test 12: file2 missing"
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
459 exit 2
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
460 fi
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
461
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
462
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
463
3ae1410b9d13 add more pull conflict tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 632
diff changeset
464

mercurial