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

changeset 817
22257f6d06a3
parent 812
5fe4453fc025
equal deleted inserted replaced
815:1f40ca07ae1b 817:22257f6d06a3
36 then 36 then
37 echo "DAV_BIN variable not set" 37 echo "DAV_BIN variable not set"
38 exit 1 38 exit 1
39 fi 39 fi
40 40
41 TEST=`uname | grep BSD` 41 # stat parameter for getting unix time
42 if [ $? -eq 0 ]; 42 STAT_TIME_FMT="-c %Y"
43
44 if uname -a | grep BSD > /dev/null;
43 then 45 then
44 alias stat_="stat -f %m" 46 STAT_TIME_FMT="-f %m"
45 else 47 fi
46 alias stat_="stat -c %Y" 48 if uname -a | grep Darwin > /dev/null;
49 then
50 STAT_TIME_FMT="-f %m"
47 fi 51 fi
48 52
49 XATTR=../../build/bin/xattrtool 53 XATTR=../../build/bin/xattrtool
50 54
51 # checks if tmp-sync/out.txt contains a specific text 55 # checks if tmp-sync/out.txt contains a specific text
157 dav_sync_pull test4b "test 2: pull failed" 161 dav_sync_pull test4b "test 2: pull failed"
158 check_tmpout "2 files pulled" "test 2: wrong pull counter" 162 check_tmpout "2 files pulled" "test 2: wrong pull counter"
159 check_tmpout "0 conflicts" "test 2: wrong conflict counter (pull)" 163 check_tmpout "0 conflicts" "test 2: wrong conflict counter (pull)"
160 check_tmpout "0 errors" "test 2: wrong error counter (pull)" 164 check_tmpout "0 errors" "test 2: wrong error counter (pull)"
161 165
162 MTIMEA1=`stat_ tmp-sync/test4a/file1` 166 MTIMEA1=`stat $STAT_TIME_FMT tmp-sync/test4a/file1`
163 MTIMEB1=`stat_ tmp-sync/test4b/file1` 167 MTIMEB1=`stat $STAT_TIME_FMT tmp-sync/test4b/file1`
164 168
165 MTIMEA2=`stat_ tmp-sync/test4a/dir1/file2` 169 MTIMEA2=`stat $STAT_TIME_FMT tmp-sync/test4a/dir1/file2`
166 MTIMEB2=`stat_ tmp-sync/test4b/dir1/file2` 170 MTIMEB2=`stat $STAT_TIME_FMT tmp-sync/test4b/dir1/file2`
167 171
168 if [ $MTIMEA1 != $MTIMEB1 ]; then 172 if [ $MTIMEA1 != $MTIMEB1 ]; then
169 echo "file1: mtime not synced" 173 echo "file1: mtime not synced"
170 exit 2 174 exit 2
171 fi 175 fi
188 dav_sync_pull test4b "test 3: pull failed" 192 dav_sync_pull test4b "test 3: pull failed"
189 check_tmpout "1 file pulled" "test 3: wrong pull counter" 193 check_tmpout "1 file pulled" "test 3: wrong pull counter"
190 check_tmpout "0 conflicts" "test 3: wrong conflict counter (pull)" 194 check_tmpout "0 conflicts" "test 3: wrong conflict counter (pull)"
191 check_tmpout "0 errors" "test 3: wrong error counter (pull)" 195 check_tmpout "0 errors" "test 3: wrong error counter (pull)"
192 196
193 MTIMEA1=`stat_ tmp-sync/test4a/file1` 197 MTIMEA1=`stat $STAT_TIME_FMT tmp-sync/test4a/file1`
194 MTIMEB1=`stat_ tmp-sync/test4b/file1` 198 MTIMEB1=`stat $STAT_TIME_FMT tmp-sync/test4b/file1`
195 199
196 if [ $MTIMEA1 != $MTIMEB1 ]; then 200 if [ $MTIMEA1 != $MTIMEB1 ]; then
197 echo "file1: mtime not synced" 201 echo "file1: mtime not synced"
198 exit 2 202 exit 2
199 fi 203 fi

mercurial