diff -r 1f40ca07ae1b -r 22257f6d06a3 test/bin-test/test-dav-sync-metadata1.sh --- a/test/bin-test/test-dav-sync-metadata1.sh Sat Apr 20 13:01:58 2024 +0200 +++ b/test/bin-test/test-dav-sync-metadata1.sh Thu May 23 23:19:06 2024 +0200 @@ -38,12 +38,16 @@ exit 1 fi -TEST=`uname | grep BSD` -if [ $? -eq 0 ]; +# stat parameter for getting unix time +STAT_TIME_FMT="-c %Y" + +if uname -a | grep BSD > /dev/null; then - alias stat_="stat -f %m" -else - alias stat_="stat -c %Y" + STAT_TIME_FMT="-f %m" +fi +if uname -a | grep Darwin > /dev/null; +then + STAT_TIME_FMT="-f %m" fi XATTR=../../build/bin/xattrtool @@ -159,11 +163,11 @@ check_tmpout "0 conflicts" "test 2: wrong conflict counter (pull)" check_tmpout "0 errors" "test 2: wrong error counter (pull)" -MTIMEA1=`stat_ tmp-sync/test4a/file1` -MTIMEB1=`stat_ tmp-sync/test4b/file1` +MTIMEA1=`stat $STAT_TIME_FMT tmp-sync/test4a/file1` +MTIMEB1=`stat $STAT_TIME_FMT tmp-sync/test4b/file1` -MTIMEA2=`stat_ tmp-sync/test4a/dir1/file2` -MTIMEB2=`stat_ tmp-sync/test4b/dir1/file2` +MTIMEA2=`stat $STAT_TIME_FMT tmp-sync/test4a/dir1/file2` +MTIMEB2=`stat $STAT_TIME_FMT tmp-sync/test4b/dir1/file2` if [ $MTIMEA1 != $MTIMEB1 ]; then echo "file1: mtime not synced" @@ -190,8 +194,8 @@ check_tmpout "0 conflicts" "test 3: wrong conflict counter (pull)" check_tmpout "0 errors" "test 3: wrong error counter (pull)" -MTIMEA1=`stat_ tmp-sync/test4a/file1` -MTIMEB1=`stat_ tmp-sync/test4b/file1` +MTIMEA1=`stat $STAT_TIME_FMT tmp-sync/test4a/file1` +MTIMEB1=`stat $STAT_TIME_FMT tmp-sync/test4b/file1` if [ $MTIMEA1 != $MTIMEB1 ]; then echo "file1: mtime not synced"