2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2020 SUSE Linux Products GmbH. All Rights Reserved.
7 # Test file timestamps are only precise to seconds with 128-byte inodes."
10 _begin_fstest auto quick
12 # Import common functions.
15 # real QA test starts here
16 _supported_fs ext3 ext4
19 _require_test_program "t_get_file_time"
21 echo "Silence is golden"
23 echo "Start test timestamps with 128 inode size one device $SCRATCH_DEV" >$seqres.full
24 _scratch_mkfs -I 128 >> $seqres.full 2>&1
27 touch "${SCRATCH_MNT}/tmp_file"
29 atime=`$here/src/t_get_file_time $SCRATCH_MNT/tmp_file atime nsec`
30 mtime=`$here/src/t_get_file_time $SCRATCH_MNT/tmp_file mtime nsec`
31 ctime=`$here/src/t_get_file_time $SCRATCH_MNT/tmp_file ctime nsec`
33 if [ $atime -ne 0 -o $mtime -ne 0 -o $ctime -ne 0 ]; then
34 echo "nsec should be zero when extended timestamps are disabled"
35 echo "atime: $atime, mtime: $mtime, ctime: $ctime"