]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
Test out that access time is updated correctly in memory and on disk.
authorTim Shimmin <tes@sgi.com>
Tue, 9 Dec 2008 14:15:47 +0000 (14:15 +0000)
committerTim Shimmin <tes@sgi.com>
Tue, 9 Dec 2008 14:15:47 +0000 (14:15 +0000)
Merge of master-melb:xfs-cmds:32647a by kenmcd.

  Test out that access time is updated correctly in memory and on disk.

192 [new file with mode: 0755]
192.out [new file with mode: 0644]
group

diff --git a/192 b/192
new file mode 100755 (executable)
index 0000000..5ab4e86
--- /dev/null
+++ b/192
@@ -0,0 +1,67 @@
+#! /bin/sh
+# FS QA Test No. 192
+#
+# Simple test of atime
+# - ensure it is persistent after unmount
+# - check updated time by correct amount
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2008 Silicon Graphics, Inc.  All Rights Reserved.
+#-----------------------------------------------------------------------
+#
+# creator
+owner=tes@emu.melbourne.sgi.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "exit \$status" 0 1 2 3 15
+
+_access_time()
+{
+       stat --format=%X $1
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+
+_supported_fs xfs udf nfs
+_supported_os Linux
+#delay=150
+#delay=75
+#delay=60
+#delay=45
+delay=40
+
+testfile=$TEST_DIR/testfile
+rm -f $testfile
+rm -f $seq.full
+
+echo test >$testfile
+time1=`_access_time $testfile | tee -a $seq.full` 
+
+echo "sleep for $delay"
+sleep $delay # sleep to allow time to move on for access
+cat $testfile
+time2=`_access_time $testfile | tee -a $seq.full` 
+
+cd /
+umount $TEST_DIR
+mount $TEST_DIR
+time3=`_access_time $testfile | tee -a $seq.full`
+
+delta1=`expr $time2 - $time1`
+delta2=`expr $time3 - $time1`
+
+echo "delta1 - access time after sleep in-core: $delta1"
+echo "delta2 - access time after sleep on-disk: $delta2"
+
+# success, all done
+status=0
+exit
diff --git a/192.out b/192.out
new file mode 100644 (file)
index 0000000..7e1f699
--- /dev/null
+++ b/192.out
@@ -0,0 +1,5 @@
+QA output created by 192
+sleep for 40
+test
+delta1 - access time after sleep in-core: 40
+delta2 - access time after sleep on-disk: 40
diff --git a/group b/group
index 22241097207197a463a09e837a1af7aa163c0019..269b82648914218433bd3c40b350d5f4adae59c1 100644 (file)
--- a/group
+++ b/group
@@ -98,6 +98,9 @@ mount         tes@sgi.com
 # test the NFS v4 ACL code if it exists
 nfs4acl                tes@sgi.com donaldd@sgi.com
 
+# test access time
+atime
+
 # test-group association ... one line per test
 #
 001 rw dir udf auto
@@ -291,3 +294,4 @@ nfs4acl             tes@sgi.com donaldd@sgi.com
 189 mount auto
 190 rw auto
 191 nfs4acl auto
+192 atime