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

Wed, 02 Nov 2022 11:34:49 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 02 Nov 2022 11:34:49 +0100
changeset 739
bba6a6e221b4
parent 677
5a4002f8d258
child 770
fcb243cb9950
permissions
-rwxr-xr-x

use sys_* io functions in dav put

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

mercurial