mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
68 lines
1.3 KiB
Bash
68 lines
1.3 KiB
Bash
|
|
#! /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
|