4 # Test timestamps prior to epoch
5 # On 64-bit, ext2/3/4 was sign-extending when read from disk
6 # See also commit 4d7bf11d649c72621ca31b8ea12b9c94af380e63
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2011 Red Hat, Inc. All Rights Reserved.
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation.
15 # This program is distributed in the hope that it would be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write the Free Software Foundation,
22 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #-----------------------------------------------------------------------
27 owner=sandeen@redhat.com
30 echo "QA output created by $seq"
34 status=1 # failure is the default!
41 trap "_cleanup ; exit \$status" 0 1 2 3 15
43 # get standard environment, filters and checks
46 # real QA test starts here
50 TESTFILE=$TEST_DIR/timestamp-test.txt
52 # Create a file with a timestamp prior to the epoch
53 echo "Creating file with timestamp of Jan 1, 1960"
54 touch -t 196001010101 $TESTFILE
55 # Should yield -315593940 (prior to epoch)
56 echo -n "Stat of file yields: "
59 # unmount, remount, and check the timestamp
60 echo "Remounting to flush cache"
62 mount $TEST_DEV $TEST_DIR
64 # Should yield -315593940 (prior to epoch)
65 echo -n "Stat of file yields: "