summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
818df50)
Rather than testing for an exact timestamp, which could vary
due to rounding, just check that it is not positive,
which is the failure case we're looking for.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
echo "Creating file with timestamp of Jan 1, 1960"
touch -t 196001010101 $TESTFILE
# Should yield -315593940 (prior to epoch)
echo "Creating file with timestamp of Jan 1, 1960"
touch -t 196001010101 $TESTFILE
# Should yield -315593940 (prior to epoch)
-echo -n "Stat of file yields: "
-stat -c %X $TESTFILE
+echo "Testing for negative seconds since epoch"
+ts=`stat -c %X $TESTFILE`
+if [ "$ts" -ge 0 ]; then
+ echo "Timestamp wrapped: $ts"
+ _fail "Timestamp wrapped"
+fi
# unmount, remount, and check the timestamp
echo "Remounting to flush cache"
# unmount, remount, and check the timestamp
echo "Remounting to flush cache"
mount $TEST_DEV $TEST_DIR
# Should yield -315593940 (prior to epoch)
mount $TEST_DEV $TEST_DIR
# Should yield -315593940 (prior to epoch)
-echo -n "Stat of file yields: "
-stat -c %X $TESTFILE
+echo "Testing for negative seconds since epoch"
+ts=`stat -c %X $TESTFILE`
+if [ "$ts" -ge 0 ]; then
+ echo "Timestamp wrapped: $ts"
+ _fail "Timestamp wrapped"
+fi
QA output created by 258
Creating file with timestamp of Jan 1, 1960
QA output created by 258
Creating file with timestamp of Jan 1, 1960
-Stat of file yields: -315593940
+Testing for negative seconds since epoch
Remounting to flush cache
Remounting to flush cache
-Stat of file yields: -315593940
+Testing for negative seconds since epoch