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

changeset 736
40be8db6fe45
parent 671
5256d7eb69e7
child 763
fc24d1d1d695
--- a/test/bin-test/test-dav-sync-metadata1.sh	Sun Aug 08 16:50:36 2021 +0200
+++ b/test/bin-test/test-dav-sync-metadata1.sh	Mon Aug 09 17:22:21 2021 +0200
@@ -38,6 +38,14 @@
 	exit 1
 fi
 
+TEST=`uname | grep BSD`
+if [ $? -eq 0 ];
+then
+	alias stat_="stat -f %m"
+else
+	alias stat_="stat -c %Y"
+fi
+
 XATTR=../../build/xattrtool
 
 # checks if tmp-sync/out.txt contains a specific text
@@ -151,11 +159,11 @@
 check_tmpout "0 conflicts" "test 2: wrong conflict counter (pull)"
 check_tmpout "0 errors" "test 2: wrong error counter (pull)"
 
-MTIMEA1=`stat -c %Y tmp-sync/test4a/file1`
-MTIMEB1=`stat -c %Y tmp-sync/test4b/file1`
+MTIMEA1=`stat_ tmp-sync/test4a/file1`
+MTIMEB1=`stat_ tmp-sync/test4b/file1`
 
-MTIMEA2=`stat -c %Y tmp-sync/test4a/dir1/file2`
-MTIMEB2=`stat -c %Y tmp-sync/test4b/dir1/file2`
+MTIMEA2=`stat_ tmp-sync/test4a/dir1/file2`
+MTIMEB2=`stat_ tmp-sync/test4b/dir1/file2`
 
 if [ $MTIMEA1 != $MTIMEB1 ]; then
 	echo "file1: mtime not synced"
@@ -183,8 +191,8 @@
 check_tmpout "0 conflicts" "test 3: wrong conflict counter (pull)"
 check_tmpout "0 errors" "test 3: wrong error counter (pull)"
 
-MTIMEA1=`stat -c %Y tmp-sync/test4a/file1`
-MTIMEB1=`stat -c %Y tmp-sync/test4b/file1`
+MTIMEA1=`stat_ tmp-sync/test4a/file1`
+MTIMEB1=`stat_ tmp-sync/test4b/file1`
 
 if [ $MTIMEA1 != $MTIMEB1 ]; then
 	echo "file1: mtime not synced"

mercurial