4 # Test noatime mount option.
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
8 #-----------------------------------------------------------------------
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
21 # get standard environment, filters and checks
25 # real QA test starts here
27 _supported_os Linux IRIX
30 _scratch_mkfs_xfs >/dev/null 2>&1
32 _compare_access_times()
34 original_access_time="`cat $tmp.out | sed -n '5p'|awk '{ print substr($0,0,32)}'`"
35 accessed_time="`src/lstat64 $1 | sed -n '5p'| awk '{ print substr($0,0,32)}'`"
36 echo "*** compare access times ***"
37 if [ "$original_access_time" != "$accessed_time" ]
39 echo "*** file access time updated on $2 (unexpected) ***"
41 echo "---------------------------------------------------"
43 mount | grep $SCRATCH_MNT
48 if ! _scratch_mount "-o noatime" >$tmp.out 2>&1
51 echo "!!! mount failed"
56 echo "*** copying file ***"
57 cp src/lstat64 $SCRATCH_MNT
58 src/lstat64 $SCRATCH_MNT/lstat64 >$tmp.out
60 echo "*** executing file ***"
61 $SCRATCH_MNT/lstat64 $SCRATCH_MNT/lstat64 >/dev/null
62 _compare_access_times $SCRATCH_MNT/lstat64 "executing file"
65 echo "*** creating file ***"
66 touch $SCRATCH_MNT/testfile
67 src/lstat64 $SCRATCH_MNT/testfile >$tmp.out
69 echo "*** reading file ***"
70 cat $SCRATCH_MNT/testfile >/dev/null
71 _compare_access_times $SCRATCH_MNT/testfile "reading file"
74 echo "*** creating file ***"
75 touch $SCRATCH_MNT/testfile2
76 src/lstat64 $SCRATCH_MNT/testfile2 >$tmp.out
78 echo "*** writing to file ***"
79 echo "asdf" >> $SCRATCH_MNT/testfile2
80 _compare_access_times $SCRATCH_MNT/testfile2 "writing file"