diff options
author | Theodore Ts'o <tytso@mit.edu> | 2016-05-29 01:07:40 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-05-29 01:07:40 -0400 |
commit | 2dd680f3b9ff65c1aa0ae3af77aac55ad356f143 (patch) | |
tree | b0fdee1e87b765f4a328f44cbadc72c55e496e60 /tests | |
parent | c40c832b4cda298e30ce3c9a0ee2734cc13b9efa (diff) | |
download | e2fsprogs-2dd680f3b9ff65c1aa0ae3af77aac55ad356f143.tar.gz |
tests: fix f_pre_1970_date_encoding on systems with a 32-bit time_t
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.in | 1 | ||||
-rw-r--r-- | tests/f_pre_1970_date_encoding/script | 28 |
2 files changed, 21 insertions, 8 deletions
diff --git a/tests/Makefile.in b/tests/Makefile.in index 9a7d3ff83..c130f4abe 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -20,6 +20,7 @@ test_one: $(srcdir)/test_one.in Makefile mke2fs.conf @echo "QUOTA=y" >> test_one @echo "SRCDIR=@srcdir@" >> test_one @echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one + @echo "SIZEOF_TIME_T=@SIZEOF_TIME_T@" >> test_one @cat $(srcdir)/test_one.in >> test_one @chmod +x test_one diff --git a/tests/f_pre_1970_date_encoding/script b/tests/f_pre_1970_date_encoding/script index e6d7bbd63..06ff98aaa 100644 --- a/tests/f_pre_1970_date_encoding/script +++ b/tests/f_pre_1970_date_encoding/script @@ -68,17 +68,29 @@ get_file_xtime_and_extra year-1979 get_file_xtime_and_extra year-2039 get_file_xtime_and_extra year-2139 -# now we need to check that after the year 2242, e2fsck does not -# modify dates with extra_xtime=3 +if test $SIZEOF_TIME_T -gt 4 +then + # now we need to check that after the year 2242, e2fsck does not + # modify dates with extra_xtime=3 -# restore the unrepaired filesystem -mv $TMPFILE.sav $TMPFILE + # restore the unrepaired filesystem + mv $TMPFILE.sav $TMPFILE -#retry the repair -E2FSCK_TIME=9270393539 $FSCK $FSCK_OPT $TMPFILE >> $OUT 2>&1 + #retry the repair + E2FSCK_TIME=9270393539 $FSCK $FSCK_OPT $TMPFILE >> $OUT 2>&1 -# check that the 1909 file is unaltered (i.e. it has a post-2378 date) -get_file_xtime_and_extra year-1909 + # check that the 1909 file is unaltered (i.e. it has a post-2378 date) + get_file_xtime_and_extra year-1909 +else + rm -f TMPFILE.sav +cat << EOF >> $TIMESTAMPS +times for year-1909 = + ctime: 0x8e475440:00000003 + atime: 0x8e475440:00000003 + mtime: 0x8e475440:00000003 +crtime: 0x8e475440:00000003 +EOF +fi cmp -s $TIMESTAMPS $EXP status=$? |