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

Sun, 02 Jul 2023 13:23:51 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 02 Jul 2023 13:23:51 +0200
changeset 775
e5909dff0dbf
parent 772
ab26daccfb8d
child 812
5fe4453fc025
permissions
-rwxr-xr-x

update ucx

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
770
fcb243cb9950 fix xattrtool path in metadata test scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 677
diff changeset
41 XATTR=../../build/bin/xattrtool
672
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
42
772
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
43 # stat parameter for getting unix time
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
44 STAT_TIME_FMT="-c %Y"
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
45
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
46 TEST=`uname -a | grep BSD`
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
47 if [ $? -ne 0 ];
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
48 then
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
49 STAT_TIME_FMT="-f %m"
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
50 fi
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
51 TEST=`uname -a | grep Darwin`
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
52 if [ $? -ne 0 ];
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
53 then
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
54 STAT_TIME_FMT="-f %m"
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
55 fi
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
56
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
57
672
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58 # 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
59 # arg1: pattern
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60 # arg2: errormsg
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 check_tmpout()
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 {
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 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
64 if [ $? -ne 0 ];
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 then
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 echo "$2"
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67 exit 2
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68 fi
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69 }
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 # 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
72 # arg1: dir
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73 # arg2: errormsg
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74 dav_sync_push()
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
75 {
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76 $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
77 if [ $? -ne 0 ];
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
78 then
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
79 echo "$2"
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
80 exit 2
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
81 fi
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82 }
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83 # 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
84 # arg1: dir
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85 # arg2: errormsg
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86 dav_sync_pull()
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 $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
89 if [ $? -ne 0 ];
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90 then
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
91 echo "$2"
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92 exit 2
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93 fi
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
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96 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
97 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
98
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99 $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
100
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101 $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
102
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103 # tmp sync dir
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104 rm -Rf tmp-sync
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
105 mkdir tmp-sync
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
106 mkdir tmp-sync/test4a
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
107 mkdir tmp-sync/test4b
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
108
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109 # ----------------------------------------------------------------------------
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
110 # 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
111 # expected result: everything synced
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
112
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
113 mkdir tmp-sync/test4a/dir1
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
114
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115 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
116 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
117
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118 cp synctest/file2 tmp-sync/test4a/
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119 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
120 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
121
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122 # add tags
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
123 $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
124 $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
125
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
126 # add xattr
771
ffa493657381 replace direct xattrtool path with $XATTR in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 770
diff changeset
127 $XATTR set tmp-sync/test4a/file1 attr1 testvalue
672
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129 # set mtime
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130 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
131
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
132 # +x
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133 chmod +x tmp-sync/test4a/file1
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
135 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
136 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
137 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
138 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
139
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 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
141 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
142 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
143 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
144
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
145 # check metadata
772
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
146 MTIMEA1=`stat $STAT_TIME_FMT tmp-sync/test4a/file1`
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
147 MTIMEB1=`stat $STAT_TIME_FMT tmp-sync/test4b/file1`
672
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
149 if [ "$MTIMEA1" != "$MTIMEB1" ]; then
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150 echo "test 1: mtime not synced"
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151 exit 2
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
152 fi
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
153
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
154 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
155 if [ "$OUT" != "file1out" ]; then
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
156 echo "test 1: not executable"
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
157 exit 2
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
158 fi
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
159
771
ffa493657381 replace direct xattrtool path with $XATTR in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 770
diff changeset
160 OUT=`$XATTR get tmp-sync/test4b/file1 attr1 2> /dev/null`
672
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
161 if [ "$OUT" != "testvalue" ]; then
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
162 echo "test 1: xattr not synced"
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
163 exit 2
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
164 fi
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
165
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
166 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
167 if [ $? -ne 0 ]; then
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
168 echo "test 1: list-tags failed"
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
169 exit 2
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
170 fi
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
171 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
172 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
173
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
174
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
175 # ----------------------------------------------------------------------------
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
176 # 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
177 # 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
178
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
179 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
180
677
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
181 $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
182 $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
183
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184 chmod -x tmp-sync/test4a/copy1
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
185
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186 touch tmp-sync/test4a/copy1
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 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
189 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
190 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
191 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
192 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
193
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
194 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
195 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
196 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
197 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
198
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
199 # check metadata
772
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
200 MTIMEA1=`stat $STAT_TIME_FMT tmp-sync/test4a/copy1 2> /dev/null`
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
201 MTIMEB1=`stat $STAT_TIME_FMT tmp-sync/test4b/copy1 2> /dev/null`
672
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
202
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
203 if [ "$MTIMEA1" != "$MTIMEB1" ]; then
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
204 echo "test 2: mtime not synced"
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
205 exit 2
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
206 fi
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
207
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
208 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
209 if [ $? -eq 0 ]; then
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
210 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
211 exit 2
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
212 fi
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
213
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
214 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
215 if [ $? -ne 0 ]; then
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
216 echo "test 2: list-tags failed"
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
217 exit 2
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
218 fi
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
219 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
220 if [ $LN -ne 0 ]; then
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
221 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
222 exit 2
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
223 fi
4bfe452a2665 fix dav-sync copy with enabled metadata sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
224
675
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 # test 3: push again
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
228 # expected result: 0 files pushed/updated
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
229
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
230 dav_sync_push test4a "test 3: push failed"
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
231 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
232 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
233 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
234
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
235 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
236 if [ $LN -ne 1 ]; then
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
237 echo "test 3: wrong line count"
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
238 exit 2
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
239 fi
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
240
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
241
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
242 # ----------------------------------------------------------------------------
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
243 # test 4: pull test4b again
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
244 # expected result: 0 files pushed/updated
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
245
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
246 dav_sync_pull test4b "test 4: pull failed"
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
247 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
248 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
249 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
250
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
251 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
252 if [ $LN -ne 1 ]; then
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
253 echo "test 4: wrong line count"
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
254 exit 2
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
255 fi
a8117c4feaad fix sync_store_metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 672
diff changeset
256
677
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
257
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
258 # ----------------------------------------------------------------------------
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
259 # test 5: move file1
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
260 # 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
261
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
262 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
263
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
264 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
265 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
266 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
267 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
268 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
269
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
270 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
271 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
272 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
273 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
274 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
275
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
276 # check metadata
772
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
277 MTIMEA1=`stat $STAT_TIME_FMT tmp-sync/test4a/move1 2> /dev/null`
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
278 MTIMEB1=`stat $STAT_TIME_FMT tmp-sync/test4b/move1 2> /dev/null`
677
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
279
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
280 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
281 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
282 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
283 fi
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 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
286 if [ $? -ne 0 ]; then
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
287 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
288 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
289 fi
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
290 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
291 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
292
771
ffa493657381 replace direct xattrtool path with $XATTR in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 770
diff changeset
293 OUT=`$XATTR get tmp-sync/test4b/move1 attr1 2> /dev/null`
677
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
294 if [ "$OUT" != "testvalue" ]; then
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
295 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
296 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
297 fi
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
298
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
299
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
300 # ----------------------------------------------------------------------------
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
301 # 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
302 # 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
303
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
304 $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
305 $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
306
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
307 $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
308
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
309 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
310
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
311 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
312 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
313 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
314 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
315 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
316
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
317 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
318 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
319 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
320 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
321 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
322
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
323 # check metadata
772
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
324 MTIMEA1=`stat $STAT_TIME_FMT tmp-sync/test4a/move_noxattr 2> /dev/null`
ab26daccfb8d fix non-standard use of stat in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 771
diff changeset
325 MTIMEB1=`stat $STAT_TIME_FMT tmp-sync/test4b/move_noxattr 2> /dev/null`
677
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
326
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
327 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
328 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
329 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
330 fi
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
331
771
ffa493657381 replace direct xattrtool path with $XATTR in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 770
diff changeset
332 OUT=`$XATTR get tmp-sync/test4b/move1 attr1 2> /dev/null`
677
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
333 if [ "$OUT" = "testvalue" ]; then
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
334 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
335 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
336 fi
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
337
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
338 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
339 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
340 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
341 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
342 fi
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
343
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
344
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 # 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
347 # 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
348
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
349 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
350
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
351 $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
352 $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
353
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
354 $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
355
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
356 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
357 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
358 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
359 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
360
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
361 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
362 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
363 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
364
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
365 # check metadata
771
ffa493657381 replace direct xattrtool path with $XATTR in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 770
diff changeset
366 OUT=`$XATTR get tmp-sync/test4b/newdir1 dirattribute1 2> /dev/null`
677
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
367 if [ "$OUT" != "test7attribute" ]; then
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
368 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
369 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
370 fi
771
ffa493657381 replace direct xattrtool path with $XATTR in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 770
diff changeset
371 OUT=`$XATTR get tmp-sync/test4b/newdir1 dirattribute2 2> /dev/null`
677
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
372 if [ "$OUT" != "directory" ]; then
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
373 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
374 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
375 fi
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
376
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
377 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
378 if [ $? -ne 0 ]; then
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
379 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
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 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
383
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
384
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
385 # ----------------------------------------------------------------------------
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
386 # test 8: sync again
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
387 # 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
388
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
389 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
390 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
391 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
392 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
393 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
394 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
395 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
396 fi
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
397
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
398 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
399 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
400 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
401 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
402 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
403 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
404 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
405 fi
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
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
408 # ----------------------------------------------------------------------------
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
409 # 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
410 # expected result: update
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 $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
413 $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
414
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
415 $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
416
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
417 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
418 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
419 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
420 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
421
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
422 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
423 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
424 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
425 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
426
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
427 # check metadata
771
ffa493657381 replace direct xattrtool path with $XATTR in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 770
diff changeset
428 OUT=`$XATTR get tmp-sync/test4b/newdir1 dirattribute1 2> /dev/null`
677
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
429 if [ "$OUT" != "test9attribute" ]; then
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
430 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
431 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
432 fi
771
ffa493657381 replace direct xattrtool path with $XATTR in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 770
diff changeset
433 OUT=`$XATTR get tmp-sync/test4b/newdir1 dirattribute2 2> /dev/null`
677
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
434 if [ "$OUT" != "directory" ]; then
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
435 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
436 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
437 fi
771
ffa493657381 replace direct xattrtool path with $XATTR in metadata3 test script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 770
diff changeset
438 OUT=`$XATTR get tmp-sync/test4b/newdir1 new 2> /dev/null`
677
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
439 if [ "$OUT" != "hello" ]; then
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
440 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
441 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
442 fi
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
443
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
444 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
445 if [ $? -ne 0 ]; then
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
446 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
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 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
450
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
451
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
452 # ----------------------------------------------------------------------------
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
453 # test 10: sync again
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
454 # 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
455
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
456 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
457 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
458 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
459 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
460 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
461 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
462 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
463 fi
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
464
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
465 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
466 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
467 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
468 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
469 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
470 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
471 exit 2
5a4002f8d258 add more metatests: move with metadata and directory metadata
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 675
diff changeset
472 fi

mercurial