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

Wed, 10 Apr 2024 22:07:17 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 10 Apr 2024 22:07:17 +0200
changeset 812
5fe4453fc025
parent 773
78e501f6370d
permissions
-rwxr-xr-x

make sure a LocalResource path has never a trailing path separator, fixes multiple dav-sync tests

679
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 #!/bin/sh
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 #
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 #
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 # Copyright 2019 Olaf Wintermann. All rights reserved.
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 #
0d352b79363a fix some versioning related 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
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 # modification, are permitted provided that the following conditions are met:
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 #
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 # 1. Redistributions of source code must retain the above copyright
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 # notice, this list of conditions and the following disclaimer.
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 #
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 # 2. Redistributions in binary form must reproduce the above copyright
0d352b79363a fix some versioning related 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
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 # documentation and/or other materials provided with the distribution.
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 #
0d352b79363a fix some versioning related 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"
0d352b79363a fix some versioning related 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
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0d352b79363a fix some versioning related 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
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0d352b79363a fix some versioning related 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
0d352b79363a fix some versioning related 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
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0d352b79363a fix some versioning related 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
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 # POSSIBILITY OF SUCH DAMAGE.
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28 #
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 if [ -z "$DAV_BIN" ];
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31 then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 echo "DAV_BIN variable not set"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33 exit 1
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 if [ -z "$DAV_SYNC_BIN" ];
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37 echo "DAV_BIN variable not set"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38 exit 1
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41 XATTR=../../build/xattrtool
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
42
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43 # checks if tmp-sync/out.txt contains a specific text
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44 # arg1: pattern
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45 # arg2: errormsg
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46 check_tmpout()
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47 {
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 TEST=`cat tmp-sync/out.txt | grep "$1"`
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 if [ $? -ne 0 ];
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50 then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 echo "$2"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54 }
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55
0d352b79363a fix some versioning related 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
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57 # arg1: pattern
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58 # arg2: errormsg
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59 ncheck_tmpout()
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60 {
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 TEST=`cat tmp-sync/out.txt | grep "$1"`
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 if [ $? -eq 0 ];
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64 echo "$2"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67 }
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69 # do dav-sync push and check return value
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70 # arg1: dir
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 # arg2: errormsg
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72 dav_sync_push()
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73 {
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74 $DAV_SYNC_BIN push $1 > tmp-sync/out.txt
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
75 if [ $? -ne 0 ];
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76 then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
77 echo "$2"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
78 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
79 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
80 }
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
81 # do dav-sync pull and check return value
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82 # arg1: dir
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83 # arg2: errormsg
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
84 dav_sync_pull()
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85 {
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86 $DAV_SYNC_BIN pull $1 > tmp-sync/out.txt
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87 if [ $? -ne 0 ];
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88 then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89 echo "$2"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
91 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92 }
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
94 rm -f .dav/dav-sync-tests-test5a-db.xml
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
95 rm -f .dav/dav-sync-tests-test5b-db.xml
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
97 $DAV_BIN rm dav-test-repo/sync/test5 2> /dev/null
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
98
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99 $DAV_BIN mkcol dav-test-repo/sync/test5 2> /dev/null
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101 # tmp sync dir
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102 rm -Rf tmp-sync
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103 mkdir tmp-sync
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104 mkdir tmp-sync/test5a
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
105 mkdir tmp-sync/test5b
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
106
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
107 # ----------------------------------------------------------------------------
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
108 # test 1: add some files (preparation, make sure everything works)
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109 # expected result: everything synced
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
110
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
111 mkdir tmp-sync/test5a/dir1
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
112 mkdir tmp-sync/test5a/dir1/sub1
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
113
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
114 cp synctest/file1 tmp-sync/test5a
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115 cp synctest/file2 tmp-sync/test5a/dir1
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
116 cp synctest/file3 tmp-sync/test5a/dir1/sub1
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
117
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118 dav_sync_push test5a "test 1: push failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119 check_tmpout "3 files pushed" "test 1: wrong push counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120 check_tmpout "0 conflicts" "test 1: wrong conflict counter (push)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121 check_tmpout "0 errors" "test 1: wrong error counter (push)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
123 dav_sync_pull test5b "test 1: pull failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
124 check_tmpout "3 files pulled" "test 1: wrong pull counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125 check_tmpout "0 conflicts" "test 1: wrong conflict counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
126 check_tmpout "0 errors" "test 1: wrong error counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129 # ----------------------------------------------------------------------------
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130 # test 2: modify file, sync
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131 # expected result: old resource moved to history collection
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
132
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133 echo "test2-mod1" >> tmp-sync/test5a/file1
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134 touch -t 01011200 tmp-sync/test5a/file1
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
135
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
136 dav_sync_push test5a "test 2: push failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137 check_tmpout "1 file pushed" "test 2: wrong push counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
138 check_tmpout "0 conflicts" "test 2: wrong conflict counter (push)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
139 check_tmpout "0 errors" "test 2: wrong error counter (push)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
141 dav_sync_pull test5b "test 2: pull failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
142 check_tmpout "1 file pulled" "test 2: wrong pull counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143 check_tmpout "0 conflicts" "test 2: wrong conflict counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
144 check_tmpout "0 errors" "test 2: wrong error counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
145
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
146 dav list -R dav-test-repo/sync/test5/.dav-version-history/ > tmp-sync/out.txt 2> /dev/null
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
147 if [ $? -ne 0 ]; then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148 echo "test 2: dav list failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
149 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
152 TEST=`cat tmp-sync/out.txt | wc -l 2> /dev/null`
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
153 if [ -z "$TEST" ]; then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
154 echo "test 2: wc failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
155 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
156 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
157
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
158 # line count is 1 (sub-history-collection) + 1 file version = 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
159 if [ $TEST -ne 2 ]; then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160 echo "test 2: wrong line count"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
161 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
162 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
163
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
164
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
165 # ----------------------------------------------------------------------------
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
166 # test 3: modify file again, sync
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
167 # expected result: old resource moved to history collection, 2 old versions
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
168
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
169 echo "test3-mod1" >> tmp-sync/test5a/file1
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
170 touch -t 02011200 tmp-sync/test5a/file1
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
171
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
172 dav_sync_push test5a "test 3: push failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
173 check_tmpout "1 file pushed" "test 3: wrong push counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
174 check_tmpout "0 conflicts" "test 3: wrong conflict counter (push)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
175 check_tmpout "0 errors" "test 3: wrong error counter (push)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
176
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
177 dav_sync_pull test5b "test 3: pull failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
178 check_tmpout "1 file pulled" "test 3: wrong pull counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
179 check_tmpout "0 conflicts" "test 3: wrong conflict counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
180 check_tmpout "0 errors" "test 3: wrong error counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
181
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
182 dav list -R dav-test-repo/sync/test5/.dav-version-history/ > tmp-sync/out.txt 2> /dev/null
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
183 TEST=`cat tmp-sync/out.txt | wc -l 2> /dev/null`
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184 if [ $TEST -ne 3 ]; then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
185 echo "test 3: wrong line count"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
187 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
188
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
189
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
190 # ----------------------------------------------------------------------------
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
191 # test 4: modify file2, add new file, sync
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
192 # expected result: file2 versionized, new file just uploaded
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
193
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
194 echo "test4-new1" > tmp-sync/test5a/new1
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
195 echo "test4-mod1" >> tmp-sync/test5a/dir1/file2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
196
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
197 dav_sync_push test5a "test 4: push failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
198 check_tmpout "2 files pushed" "test 4: wrong push counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
199 check_tmpout "0 conflicts" "test 4: wrong conflict counter (push)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
200 check_tmpout "0 errors" "test 4: wrong error counter (push)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
201
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
202 dav_sync_pull test5b "test 4: pull failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
203 check_tmpout "2 files pulled" "test 4: wrong pull counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
204 check_tmpout "0 conflicts" "test 4: wrong conflict counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
205 check_tmpout "0 errors" "test 4: wrong error counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
206
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
207 dav list -R dav-test-repo/sync/test5/.dav-version-history/ > tmp-sync/out.txt 2> /dev/null
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
208 TEST=`cat tmp-sync/out.txt | wc -l 2> /dev/null`
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
209
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
210 # line count is 3 (prev) + 1 new sub-history-collection + 1 file version = 5
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
211 if [ $TEST -ne 5 ]; then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
212 echo "test 4: wrong line count"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
213 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
214 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
215
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
216
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
217 # ----------------------------------------------------------------------------
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
218 # test 5: restore previous file2 version
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
219 # expected result: file restored
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
220
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
221 VERSION=`$DAV_SYNC_BIN list-versions tmp-sync/test5a/dir1/file2 | grep "name: " 2> /dev/null`
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
222 if [ $? -ne 0 ]; then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
223 echo "test 5: list-versions failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
224 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
225 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
226
773
78e501f6370d fix non-standard shell script use in versioning test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 679
diff changeset
227
679
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
228 # extract version name
773
78e501f6370d fix non-standard shell script use in versioning test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 679
diff changeset
229 VERSION=${VERSION##name: }
679
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
230
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
231 $DAV_SYNC_BIN restore -V $VERSION tmp-sync/test5a/dir1/file2 > tmp-sync/out.txt 2> /dev/null
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
232 if [ $? -ne 0 ]; then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
233 echo "test 5: restore failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
234 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
235 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
236 check_tmpout "1 file pulled" "test 5: wrong pull counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
237
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
238 # compare restored file with base file
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
239 diff synctest/file2 tmp-sync/test5a/dir1/file2 > /dev/null 2>&1
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
240
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
241 if [ $? -ne 0 ]; then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
242 echo "test 5: wrong file2 content"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
243 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
244 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
245
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
246
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
247 # ----------------------------------------------------------------------------
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
248 # test 6: push test5a
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
249 # expected result: file2 pushed
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
250
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
251 dav_sync_push test5a "test 6: push failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
252 check_tmpout "1 file pushed" "test 6: wrong push counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
253 check_tmpout "file2" "test 6: file2 not pushed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
254 check_tmpout "0 conflicts" "test 6: wrong conflict counter (push)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
255 check_tmpout "0 errors" "test 6: wrong error counter (push)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
256
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
257 dav_sync_pull test5b "test 6: pull failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
258 check_tmpout "1 file pulled" "test 6: wrong pull counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
259 check_tmpout "0 conflicts" "test 6: wrong conflict counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
260 check_tmpout "0 errors" "test 6: wrong error counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
261
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
262
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
263 # ----------------------------------------------------------------------------
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
264 # test 7: modify file2 again and push (this is just a prep for test8)
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
265 # expected result: file2 pushed
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
266
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
267 sleep 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
268
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
269 echo "test7-mod1" >> tmp-sync/test5a/dir1/file2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
270
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
271 dav_sync_push test5a "test 7: push failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
272 check_tmpout "1 file pushed" "test 7: wrong push counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
273 check_tmpout "0 conflicts" "test 7: wrong conflict counter (push)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
274 check_tmpout "0 errors" "test 7: wrong error counter (push)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
275
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
276 dav_sync_pull test5b "test 7: pull failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
277 check_tmpout "1 file pulled" "test 7: wrong pull counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
278 check_tmpout "0 conflicts" "test 7: wrong conflict counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
279 check_tmpout "0 errors" "test 7: wrong error counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
280
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
281
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
282 # ----------------------------------------------------------------------------
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
283 # test 8: restore previous file2 version and pull
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
284 # expected result: file restored, no files pulled
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
285
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
286 $DAV_SYNC_BIN restore -V $VERSION tmp-sync/test5a/dir1/file2 > tmp-sync/out.txt 2> /dev/null
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
287 if [ $? -ne 0 ]; then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
288 echo "test 8: restore failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
289 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
290 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
291 check_tmpout "1 file pulled" "test 8: wrong pull counter (restore)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
292
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
293 # compare restored file with base file
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
294 diff synctest/file2 tmp-sync/test5a/dir1/file2 > /dev/null 2>&1
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
295
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
296 if [ $? -ne 0 ]; then
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
297 echo "test 8: wrong file2 content"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
298 exit 2
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
299 fi
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
300
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
301 dav_sync_pull test5a "test 8: pull failed"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
302 check_tmpout "0 files pulled" "test 8: wrong pull counter"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
303 check_tmpout "0 conflicts" "test 8: wrong conflict counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
304 check_tmpout "0 errors" "test 8: wrong error counter (pull)"
0d352b79363a fix some versioning related bugs and add tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
305

mercurial