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 seqres=$RESULT_DIR/$seq
27 seqres=$RESULT_DIR/$seq
28 seqres=$RESULT_DIR/$seq
29 echo "QA output created by $seq"
33 status=1 # failure is the default!
34 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
36 # get standard environment, filters and checks
40 # real QA test starts here
42 _supported_os Linux IRIX
45 _scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed"
47 _compare_access_times()
49 original_access_time="`cat $tmp.out | sed -n '5p'|awk '{ print substr($0,0,32)}'`"
50 accessed_time="`src/lstat64 $1 | sed -n '5p'| awk '{ print substr($0,0,32)}'`"
51 echo "*** compare access times ***"
52 if [ "$original_access_time" != "$accessed_time" ]
54 echo "*** file access time updated on $2 (unexpected) ***"
56 echo "---------------------------------------------------"
58 mount | grep $SCRATCH_MNT
63 if ! _scratch_mount "-o noatime" >$tmp.out 2>&1
66 echo "!!! mount failed"
71 echo "*** copying file ***"
72 cp src/lstat64 $SCRATCH_MNT
73 src/lstat64 $SCRATCH_MNT/lstat64 >$tmp.out
75 echo "*** executing file ***"
76 $SCRATCH_MNT/lstat64 $SCRATCH_MNT/lstat64 >/dev/null
77 _compare_access_times $SCRATCH_MNT/lstat64 "executing file"
80 echo "*** creating file ***"
81 touch $SCRATCH_MNT/testfile
82 src/lstat64 $SCRATCH_MNT/testfile >$tmp.out
84 echo "*** reading file ***"
85 cat $SCRATCH_MNT/testfile >/dev/null
86 _compare_access_times $SCRATCH_MNT/testfile "reading file"
89 echo "*** creating file ***"
90 touch $SCRATCH_MNT/testfile2
91 src/lstat64 $SCRATCH_MNT/testfile2 >$tmp.out
93 echo "*** writing to file ***"
94 echo "asdf" >> $SCRATCH_MNT/testfile2
95 _compare_access_times $SCRATCH_MNT/testfile2 "writing file"