From: Vladimir Saveliev Date: Mon, 13 Dec 2010 19:51:45 +0000 (+0300) Subject: b=23003 sanity test is added, checks how we work with timestamps before Jan 1 1970 X-Git-Tag: 2.0.59.0~18 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=7ee079a3ad29f0a055f5c6610fdc38ab33595818 b=23003 sanity test is added, checks how we work with timestamps before Jan 1 1970 i=grev --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 8b828d7..90b3d71 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2409,6 +2409,28 @@ test_39l() { } run_test 39l "directory atime update ===========================" +test_39m() { + touch $DIR1/$tfile + sleep 2 + local far_past_mtime=$(date -d "May 29 1953" +%s) + local far_past_atime=$(date -d "Dec 17 1903" +%s) + + touch -m -d @$far_past_mtime $DIR1/$tfile + touch -a -d @$far_past_atime $DIR1/$tfile + + for (( i=0; i < 2; i++ )) ; do + local timestamps=$(stat -c "%X %Y" $DIR1/$tfile) + [ "$timestamps" = "$far_past_atime $far_past_mtime" ] || \ + error "atime or mtime set incorrectly" + + cancel_lru_locks osc + if [ $i = 0 ] ; then echo "repeat after cancel_lru_locks"; fi + done + + +} +run_test 39m "test atime and mtime before 1970" + test_40() { dd if=/dev/zero of=$DIR/f40 bs=4096 count=1 $RUNAS $OPENFILE -f O_WRONLY:O_TRUNC $DIR/f40 && error