summaryrefslogtreecommitdiff
path: root/tests/ext4/043
blob: de0ddf7fa818dda8fe5eb74826dc7d4042e25d9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2020 SUSE Linux Products GmbH.  All Rights Reserved.
#
# FS QA Test No. 043
#
# Test file timestamps are only precise to seconds with 128-byte inodes."
#
. ./common/preamble
_begin_fstest auto quick

# Import common functions.
. ./common/filter

# real QA test starts here
_supported_fs ext3 ext4

_require_scratch
_require_test_program "t_get_file_time"

echo "Silence is golden"

echo "Start test timestamps with 128 inode size one device $SCRATCH_DEV" >$seqres.full
_scratch_mkfs -I 128 >> $seqres.full 2>&1
_scratch_mount

touch "${SCRATCH_MNT}/tmp_file"

atime=`$here/src/t_get_file_time $SCRATCH_MNT/tmp_file atime nsec`
mtime=`$here/src/t_get_file_time $SCRATCH_MNT/tmp_file mtime nsec`
ctime=`$here/src/t_get_file_time $SCRATCH_MNT/tmp_file ctime nsec`

if [ $atime -ne 0 -o $mtime -ne 0 -o $ctime -ne 0 ]; then
       echo "nsec should be zero when extended timestamps are disabled"
       echo "atime: $atime, mtime: $mtime, ctime: $ctime"
fi

status=0
exit