Sun, 17 Dec 2023 15:33:50 +0100
fix faulty string to int conversion utilities
Probably it was expected that errno is set to EINVAL when illegal characters are encountered. But this is not standard and does not happen on every system, allowing illegal strings to be parsed as valid integers.
657
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | #!/bin/sh |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | # |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
4 | # |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | # Copyright 2019 Olaf Wintermann. All rights reserved. |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | # |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | # Redistribution and use in source and binary forms, with or without |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | # modification, are permitted provided that the following conditions are met: |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | # |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | # 1. Redistributions of source code must retain the above copyright |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | # notice, this list of conditions and the following disclaimer. |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | # |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | # 2. Redistributions in binary form must reproduce the above copyright |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | # notice, this list of conditions and the following disclaimer in the |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | # documentation and/or other materials provided with the distribution. |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | # |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
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 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | # POSSIBILITY OF SUCH DAMAGE. |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | # |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30 | if [ -z "$DAV_BIN" ]; |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31 | then |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32 | echo "DAV_BIN variable not set" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
33 | exit 1 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | fi |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | if [ -z "$DAV_SYNC_BIN" ]; |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | then |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | echo "DAV_BIN variable not set" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | exit 1 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | fi |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | # checks if tmp-sync/out.txt contains a specific text |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
42 | # arg1: pattern |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
43 | # arg2: errormsg |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
44 | check_tmpout() |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
45 | { |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
46 | TEST=`cat tmp-sync/out.txt | grep "$1"` |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
47 | if [ $? -ne 0 ]; |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
48 | then |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
49 | echo "$2" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
50 | exit 2 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51 | fi |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
52 | } |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
53 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
54 | # do dav-sync push and check return value |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
55 | # arg1: dir |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
56 | # arg2: errormsg |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
57 | dav_sync_push() |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
58 | { |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
59 | $DAV_SYNC_BIN push $1 > tmp-sync/out.txt |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
60 | if [ $? -ne 0 ]; |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
61 | then |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
62 | echo "$2" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
63 | exit 2 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
64 | fi |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
65 | } |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
66 | # do dav-sync pull and check return value |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
67 | # arg1: dir |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
68 | # arg2: errormsg |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
69 | dav_sync_pull() |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
70 | { |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
71 | $DAV_SYNC_BIN pull $1 > tmp-sync/out.txt |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
72 | if [ $? -ne 0 ]; |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
73 | then |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
74 | echo "$2" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
75 | exit 2 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
76 | fi |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
77 | } |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
78 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
79 | rm -f .dav/dav-sync-tests-test3a-db.xml |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
80 | rm -f .dav/dav-sync-tests-test3b-db.xml |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
81 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
82 | $DAV_BIN rm dav-test-repo/sync/test3 2> /dev/null |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
83 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
84 | $DAV_BIN mkcol dav-test-repo/sync/test3 2> /dev/null |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
85 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
86 | # tmp sync dir |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
87 | rm -Rf tmp-sync |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
88 | mkdir tmp-sync |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
89 | mkdir tmp-sync/test3a |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
90 | mkdir tmp-sync/test3b |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
91 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
92 | # ---------------------------------------------------------------------------- |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
93 | # 1. test: add 4 files, push, pull |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
94 | # expected result: 4 files pushed, 4 files pulled |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
95 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
96 | mkdir tmp-sync/test3a/dir1/ |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
97 | mkdir tmp-sync/test3a/dir1/subdir1/ |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
98 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
99 | cp synctest/file1 tmp-sync/test3a/ |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
100 | cp synctest/file2 tmp-sync/test3a/dir1/ |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
101 | cp synctest/file3 tmp-sync/test3a/dir1/subdir1 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
102 | cp synctest/file4 tmp-sync/test3a/dir1/subdir1 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
103 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
104 | dav_sync_push test3a "test 1: push failed" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
105 | check_tmpout "4 files pushed" "test 1: wrong push counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
106 | check_tmpout "0 conflicts" "test 1: wrong conflict counter (push)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
107 | check_tmpout "0 errors" "test 1: wrong error counter (push)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
108 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
109 | dav_sync_pull test3b "test 1: pull failed" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
110 | check_tmpout "4 files pulled" "test 1: wrong pull counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
111 | check_tmpout "0 conflicts" "test 1: wrong conflict counter (pull)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
112 | check_tmpout "0 errors" "test 1: wrong error counter (pull)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
113 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
114 | # ---------------------------------------------------------------------------- |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
115 | # 2. test: add 4 more files to test3b, push, pull |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
116 | # expected result: 4 files pushed, 4 files pulled |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
117 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
118 | echo "newfile1" > tmp-sync/test3b/new1 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
119 | echo "newfile2" > tmp-sync/test3b/new2 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
120 | echo "newfile3" > tmp-sync/test3b/dir1/new3 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
121 | echo "newfile4" > tmp-sync/test3b/dir1/new4 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
122 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
123 | dav_sync_push test3b "test 2: push failed" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
124 | check_tmpout "4 files pushed" "test 2: wrong push counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
125 | check_tmpout "0 conflicts" "test 2: wrong conflict counter (push)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
126 | check_tmpout "0 errors" "test 2: wrong error counter (push)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
127 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
128 | dav_sync_pull test3a "test 2: pull failed" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
129 | check_tmpout "4 files pulled" "test 2: wrong pull counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
130 | check_tmpout "0 conflicts" "test 2: wrong conflict counter (pull)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
131 | check_tmpout "0 errors" "test 2: wrong error counter (pull)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
132 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
133 | # ---------------------------------------------------------------------------- |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
134 | # 3. test: enable hashing (by using syncdirs with h suffix), touch file1 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
135 | # and modify file2, push, pull |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
136 | # expected result: 2 files pushed, 1 files pulled |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
137 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
138 | sleep 2 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
139 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
140 | touch tmp-sync/test3a/file1 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
141 | echo "test3-mod1" >> tmp-sync/test3a/dir1/file2 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
142 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
143 | # should push 2 files, because the db doesn't contain any hashes yet |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
144 | dav_sync_push test3ah "test 3: push failed" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
145 | check_tmpout "2 files pushed" "test 3: wrong push counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
146 | check_tmpout "0 conflicts" "test 3: wrong conflict counter (push)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
147 | check_tmpout "0 errors" "test 3: wrong error counter (push)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
148 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
149 | dav_sync_pull test3bh "test 3: pull failed" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
150 | check_tmpout "1 file pulled" "test 3: wrong pull counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
151 | check_tmpout "0 conflicts" "test 3: wrong conflict counter (pull)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
152 | check_tmpout "0 errors" "test 3: wrong error counter (pull)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
153 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
154 | # ---------------------------------------------------------------------------- |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
155 | # 4. test: same as test 3, but the db should contain hashes |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
156 | # expected result: 1 file pushed, because the db should contain hashes now |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
157 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
158 | sleep 2 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
159 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
160 | touch tmp-sync/test3a/file1 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
161 | echo "test4-mod1" >> tmp-sync/test3a/dir1/file2 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
162 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
163 | # should push 2 files, because the db doesn't contain any hashes yet |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
164 | dav_sync_push test3ah "test 4: push failed" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
165 | check_tmpout "1 file pushed" "test 4: wrong push counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
166 | check_tmpout "0 conflicts" "test 4: wrong conflict counter (push)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
167 | check_tmpout "0 errors" "test 4: wrong error counter (push)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
168 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
169 | dav_sync_pull test3bh "test 4: pull failed" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
170 | check_tmpout "1 file pulled" "test 4: wrong pull counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
171 | check_tmpout "0 conflicts" "test 4: wrong conflict counter (pull)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
172 | check_tmpout "0 errors" "test 4: wrong error counter (pull)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
173 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
174 | # ---------------------------------------------------------------------------- |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
175 | # 5. test: mod file3 on both sides, mod new1 differently on both sides, push |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
176 | # expected result: 1 conflict, 0 files pushed |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
177 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
178 | echo "test5-mod1" >> tmp-sync/test3a/dir1/subdir1/file3 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
179 | echo "test5-mod1" >> tmp-sync/test3b/dir1/subdir1/file3 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
180 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
181 | echo "test5-mod-a" >> tmp-sync/test3a/new1 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
182 | echo "test5-mod-b" >> tmp-sync/test3b/new1 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
183 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
184 | dav_sync_push test3ah "test 5: push test3ah failed" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
185 | check_tmpout "2 files pushed" "test 5: wrong push counter (test3ah)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
186 | check_tmpout "0 conflicts" "test 5: wrong conflict counter (test3ah)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
187 | check_tmpout "0 errors" "test 5: wrong error counter (test3ah)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
188 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
189 | dav_sync_push test3bh "test 5: push test3bh failed" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
190 | check_tmpout "0 files pushed" "test 5: wrong push counter (test3bh)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
191 | check_tmpout "1 conflict" "test 5: wrong conflict counter (testbh)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
192 | check_tmpout "0 errors" "test 5: wrong error counter (test3bh)" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
193 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
194 | # ---------------------------------------------------------------------------- |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
195 | # 6. test: cp new1 from test3a to test3b and push test3bh |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
196 | # expected result: 0 files pushed, 0 conflicts |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
197 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
198 | cp tmp-sync/test3a/new1 tmp-sync/test3b/new1 |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
199 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
200 | dav_sync_push test3bh "test 6: push failed" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
201 | check_tmpout "0 files pushed" "test 6: wrong push counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
202 | check_tmpout "0 conflicts" "test 6: wrong conflict counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
203 | check_tmpout "0 errors" "test 6: wrong error counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
204 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
205 | # ---------------------------------------------------------------------------- |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
206 | # 7. test: pull test3bh |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
207 | # expected result: 0 files pulled, 0 conflicts |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
208 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
209 | dav_sync_pull test3bh "test 6: pull failed" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
210 | check_tmpout "0 files pulled" "test 6: wrong pull counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
211 | check_tmpout "0 conflicts" "test 6: wrong conflict counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
212 | check_tmpout "0 errors" "test 6: wrong error counter" |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
213 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
214 | |
8f3410b9148f
add test for testing transition from config without hashing to config with enabled hashing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
215 |