4 # Test noatime mount option.
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
26 echo "QA output created by $seq"
30 status=1 # failure is the default!
31 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
33 # get standard environment, filters and checks
37 # real QA test starts here
39 _supported_os Linux IRIX
42 _scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed"
44 _compare_access_times()
46 original_access_time="`cat $tmp.out | sed -n '5p'|awk '{ print substr($0,0,32)}'`"
47 accessed_time="`src/lstat64 $1 | sed -n '5p'| awk '{ print substr($0,0,32)}'`"
48 echo "*** compare access times ***"
49 if [ "$original_access_time" != "$accessed_time" ]
51 echo "*** file access time updated on $2 (unexpected) ***"
53 echo "---------------------------------------------------"
55 mount | grep $SCRATCH_MNT
60 if ! _scratch_mount "-o noatime" >$tmp.out 2>&1
63 echo "!!! mount failed"
68 echo "*** copying file ***"
69 cp src/lstat64 $SCRATCH_MNT
70 src/lstat64 $SCRATCH_MNT/lstat64 >$tmp.out
72 echo "*** executing file ***"
73 $SCRATCH_MNT/lstat64 $SCRATCH_MNT/lstat64 >/dev/null
74 _compare_access_times $SCRATCH_MNT/lstat64 "executing file"
77 echo "*** creating file ***"
78 touch $SCRATCH_MNT/testfile
79 src/lstat64 $SCRATCH_MNT/testfile >$tmp.out
81 echo "*** reading file ***"
82 cat $SCRATCH_MNT/testfile >/dev/null
83 _compare_access_times $SCRATCH_MNT/testfile "reading file"
86 echo "*** creating file ***"
87 touch $SCRATCH_MNT/testfile2
88 src/lstat64 $SCRATCH_MNT/testfile2 >$tmp.out
90 echo "*** writing to file ***"
91 echo "asdf" >> $SCRATCH_MNT/testfile2
92 _compare_access_times $SCRATCH_MNT/testfile2 "writing file"