88 mkdir tmp-sync |
88 mkdir tmp-sync |
89 mkdir tmp-sync/test2a |
89 mkdir tmp-sync/test2a |
90 mkdir tmp-sync/test2b |
90 mkdir tmp-sync/test2b |
91 |
91 |
92 # ---------------------------------------------------------------------------- |
92 # ---------------------------------------------------------------------------- |
93 # 1. test: add 4 files, push, pull |
93 # 1. test: add 4 files, push, pull (not really an hashing test) |
94 # expected result: 4 files pushed, 4 files pulled |
94 # expected result: 4 files pushed, 4 files pulled |
95 |
95 |
96 mkdir tmp-sync/test2a/dir1/ |
96 mkdir tmp-sync/test2a/dir1/ |
97 mkdir tmp-sync/test2a/dir1/subdir1/ |
97 mkdir tmp-sync/test2a/dir1/subdir1/ |
98 |
98 |
110 check_tmpout "4 files pulled" "test 1: wrong pull counter" |
110 check_tmpout "4 files pulled" "test 1: wrong pull counter" |
111 check_tmpout "0 conflicts" "test 1: wrong conflict counter (pull)" |
111 check_tmpout "0 conflicts" "test 1: wrong conflict counter (pull)" |
112 check_tmpout "0 errors" "test 1: wrong error counter (pull)" |
112 check_tmpout "0 errors" "test 1: wrong error counter (pull)" |
113 |
113 |
114 |
114 |
|
115 # ---------------------------------------------------------------------------- |
|
116 # 2. test: touch 2 files, push |
|
117 # expected result: 0 files pushed |
115 |
118 |
|
119 sleep 3 |
|
120 |
|
121 touch tmp-sync/test2a/file1 |
|
122 touch tmp-sync/test2a/dir1/file2 |
|
123 |
|
124 dav_sync_push test2a "test 2: push failed" |
|
125 check_tmpout "0 files pushed" "test 2: wrong push counter" |
|
126 check_tmpout "0 conflicts" "test 2: wrong conflict counter" |
|
127 check_tmpout "0 errors" "test 2: wrong error counter" |
|
128 |
|
129 |
|
130 # ---------------------------------------------------------------------------- |
|
131 # 3. test: copy fil1 to test2a again |
|
132 # expected result: 0 files pushed |
|
133 |
|
134 sleep 3 |
|
135 |
|
136 cp synctest/file1 tmp-sync/test2a/ |
|
137 |
|
138 dav_sync_push test2a "test 3: push failed" |
|
139 check_tmpout "0 files pushed" "test 3: wrong push counter" |
|
140 check_tmpout "0 conflicts" "test 3: wrong conflict counter" |
|
141 check_tmpout "0 errors" "test 3: wrong error counter" |
|
142 |
|
143 |
|
144 # ---------------------------------------------------------------------------- |
|
145 # 4. test: change content but don't change mtime |
|
146 # expected result: 1 file pushed |
|
147 |
|
148 # modify file and mtime to update mtime in the database |
|
149 echo "test4-change1-a" >> tmp-sync/test2a/file1 |
|
150 touch -t 01011200 tmp-sync/test2a/file1 |
|
151 |
|
152 dav_sync_push test2a "test 4: push failed (1)" |
|
153 check_tmpout "1 file pushed" "test 4: wrong push counter (1)" |
|
154 check_tmpout "0 conflicts" "test 4: wrong conflict counter (1)" |
|
155 check_tmpout "0 errors" "test 4: wrong error counter (1)" |
|
156 |
|
157 # modify file again and set mtime to same value |
|
158 echo "test4-change2-a" >> tmp-sync/test2a/file1 |
|
159 touch -t 01011200 tmp-sync/test2a/file1 |
|
160 |
|
161 dav_sync_push test2a "test 4: push failed (2)" |
|
162 check_tmpout "1 file pushed" "test 4: wrong push counter (2)" |
|
163 check_tmpout "0 conflicts" "test 4: wrong conflict counter (2)" |
|
164 check_tmpout "0 errors" "test 4: wrong error counter (2)" |