From 502abd93bd8bfba15677aceb221c4530d257bbab Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 15 Oct 2010 21:52:40 -0700 Subject: [PATCH] tests: port to NFS file servers with clock skew Several of the tests assumed that a newly created file cannot have a time stamp dated in the future. This assumption is not true when files are served by a remote host whose clock is slightly in advance of ours. Fix the problems that I observed when running "make check" a couple of times on such a server. * tests/backup01.at: Use --warning=no-timestamp to suppress clock-skew warnings. * tests/chtype.at, tests/comprec.at, tests/exclude06.at: * tests/extrac01.at, tests/extrac03.at, tests/extrac05.at: * tests/extrac06.at, tests/extrac08.at, tests/extrac13.at: * tests/extrac14.at, tests/incr01.at, tests/incr03.at, tests/link01.at: * tests/multiv01.at, tests/multiv02.at, tests/multiv03.at: * tests/pipe.at, tests/rename02.at, tests/rename03.at: * tests/rename05.at, tests/same-order01.at, tests/same-order02.at: * tests/sparse01.at: Likewise. --- tests/backup01.at | 4 ++-- tests/chtype.at | 4 ++-- tests/comprec.at | 2 +- tests/exclude06.at | 2 +- tests/extrac01.at | 2 +- tests/extrac03.at | 2 +- tests/extrac05.at | 2 +- tests/extrac06.at | 4 ++-- tests/extrac08.at | 4 ++-- tests/extrac13.at | 6 +++--- tests/extrac14.at | 2 +- tests/incr01.at | 4 ++-- tests/incr03.at | 4 ++-- tests/link01.at | 2 +- tests/multiv01.at | 2 +- tests/multiv02.at | 2 +- tests/multiv03.at | 2 +- tests/pipe.at | 2 +- tests/rename02.at | 4 ++-- tests/rename03.at | 4 ++-- tests/rename05.at | 4 ++-- tests/same-order01.at | 2 +- tests/same-order02.at | 4 +++- tests/sparse01.at | 2 +- 24 files changed, 37 insertions(+), 35 deletions(-) diff --git a/tests/backup01.at b/tests/backup01.at index 538dd3d..83d1bea 100644 --- a/tests/backup01.at +++ b/tests/backup01.at @@ -37,7 +37,7 @@ AT_TAR_CHECK([ mkdir dir1 dir2 echo bla > dir1/file1 tar cf test.tar dir1 dir2 -tar xfv test.tar --backup +tar xfv test.tar --backup --warning=no-timestamp ], [0], [dir1/ @@ -46,4 +46,4 @@ Renaming `dir1/file1' to `dir1/file1~' dir2/ ]) -AT_CLEANUP \ No newline at end of file +AT_CLEANUP diff --git a/tests/chtype.at b/tests/chtype.at index 9b806c0..1ba86b3 100644 --- a/tests/chtype.at +++ b/tests/chtype.at @@ -51,9 +51,9 @@ tar --create --file=archive.2 --listed-incremental=db.2 directory rm -r directory echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null +tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null +tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp find directory | sort ], [0], diff --git a/tests/comprec.at b/tests/comprec.at index cd56a20..f2d0141 100644 --- a/tests/comprec.at +++ b/tests/comprec.at @@ -29,7 +29,7 @@ echo "separator" tar cfz archive file1 echo "separator" mv file1 orig -tar xfv archive +tar xfv archive --warning=no-timestamp cmp orig file1 ], [0], diff --git a/tests/exclude06.at b/tests/exclude06.at index 3fef892..b1c0da7 100644 --- a/tests/exclude06.at +++ b/tests/exclude06.at @@ -33,7 +33,7 @@ genfile --length 20 -f test_base_dir[/1.c] tar cf archive.tar test_base_dir mkdir out -tar -C out -xf archive.tar --exclude='*.txt' +tar -C out -xf archive.tar --exclude='*.txt' --warning=no-timestamp find out -type f ], [0], diff --git a/tests/extrac01.at b/tests/extrac01.at index 5b1a2de..c84c63a 100644 --- a/tests/extrac01.at +++ b/tests/extrac01.at @@ -27,7 +27,7 @@ AT_TAR_CHECK([ mkdir directory touch directory/file tar cf archive directory || exit 1 -tar xf archive || exit 1 +tar xf archive --warning=no-timestamp || exit 1 ]) AT_CLEANUP diff --git a/tests/extrac03.at b/tests/extrac03.at index 9566b5e..ad01752 100644 --- a/tests/extrac03.at +++ b/tests/extrac03.at @@ -27,7 +27,7 @@ AT_TAR_CHECK([ mkdir directory tar -cPvf archive directory/../directory echo separator -tar -xPvf archive], +tar -xPvf archive --warning=no-timestamp], [0], [directory/../directory/ separator diff --git a/tests/extrac05.at b/tests/extrac05.at index 3e0e986..5401001 100644 --- a/tests/extrac05.at +++ b/tests/extrac05.at @@ -47,7 +47,7 @@ tar cf archive jeden dwa trzy cztery || exit 1 mkdir dir cd dir -tar xvfT ../archive ../../list || exit 1 +tar xvfT ../archive ../../list --warning=no-timestamp || exit 1 cd .. ], diff --git a/tests/extrac06.at b/tests/extrac06.at index d7e807d..35cb221 100644 --- a/tests/extrac06.at +++ b/tests/extrac06.at @@ -54,10 +54,10 @@ chmod 755 directory genfile --stat=mode:777 directory # ... and attempt to restore it twice -tar xf arc directory +tar xf arc directory --warning=no-timestamp genfile --stat=mode:777 directory -tar xf arc directory +tar xf arc directory --warning=no-timestamp genfile --stat=mode:777 directory # After both restores, the directory mode should be 755 diff --git a/tests/extrac08.at b/tests/extrac08.at index 6ca33bd..432aa0b 100644 --- a/tests/extrac08.at +++ b/tests/extrac08.at @@ -40,7 +40,7 @@ chmod 755 dir echo bla > dir/file tar cf test.tar dir chmod 700 dir -tar xfv test.tar +tar xfv test.tar --warning=no-timestamp genfile --stat=mode.777 dir ], [0], @@ -49,4 +49,4 @@ dir/file 755 ]) -AT_CLEANUP \ No newline at end of file +AT_CLEANUP diff --git a/tests/extrac13.at b/tests/extrac13.at index 2f950cb..2abed72 100644 --- a/tests/extrac13.at +++ b/tests/extrac13.at @@ -32,19 +32,19 @@ echo target1 >dst1/target1 echo target1 >target1 tar -cf archive.tar -C src . && -tar -xf archive.tar -C dst1 && +tar -xf archive.tar -C dst1 --warning=no-timestamp && diff -c src/file1 dst1/file1 && diff -c target1 dst1/target1 ln -s target1 dst2/file1 echo target1 >dst2/target1 -tar --overwrite -xf archive.tar -C dst2 && +tar --overwrite -xf archive.tar -C dst2 --warning=no-timestamp && diff -c src/file1 dst2/file1 && diff -c target1 dst2/target1 ln -s target1 dst3/file1 echo target1 >dst3/target1 -tar --overwrite -xhf archive.tar -C dst3 && +tar --overwrite -xhf archive.tar -C dst3 --warning=no-timestamp && diff -c src/file1 dst3/file1 && diff -c src/file1 dst3/target1 ], diff --git a/tests/extrac14.at b/tests/extrac14.at index 1cfaa5c..b98c395 100644 --- a/tests/extrac14.at +++ b/tests/extrac14.at @@ -28,7 +28,7 @@ mkdir dest ln -s dest symlink echo foo >foo tar -cf archive.tar foo && -tar -xf archive.tar -C symlink && +tar -xf archive.tar -C symlink --warning=no-timestamp && cmp foo dest/foo ], [0],[],[],[],[],[gnu]) diff --git a/tests/incr01.at b/tests/incr01.at index ce2d047..fad8d3e 100644 --- a/tests/incr01.at +++ b/tests/incr01.at @@ -37,9 +37,9 @@ tar -cf archive.1 -g db directory mv directory orig -tar xvfg archive.0 /dev/null +tar xvfg archive.0 /dev/null --warning=no-timestamp echo separator -tar xvfg archive.1 /dev/null +tar xvfg archive.1 /dev/null --warning=no-timestamp ], [0], [directory/ diff --git a/tests/incr03.at b/tests/incr03.at index 113793a..287e1ee 100644 --- a/tests/incr03.at +++ b/tests/incr03.at @@ -50,11 +50,11 @@ echo Listing of archive.2 tar -tf archive.2 | sort echo Directory after first restore -tar -xf archive.1 -g db +tar -xf archive.1 -g db --warning=no-timestamp find directory | sort echo Directory after second restore -tar -xf archive.2 -g db +tar -xf archive.2 -g db --warning=no-timestamp find directory | sort ], [0], diff --git a/tests/link01.at b/tests/link01.at index 5faf42e..e5f7d55 100644 --- a/tests/link01.at +++ b/tests/link01.at @@ -44,7 +44,7 @@ ln directory/test1/test.txt directory/test2/test.txt || AT_SKIP_TEST tar cf archive directory/test1/test.txt directory/test1/test.txt rm -r directory -tar xf archive +tar xf archive --warning=no-timestamp ls directory/test1 ], diff --git a/tests/multiv01.at b/tests/multiv01.at index de75da1..2b03b32 100644 --- a/tests/multiv01.at +++ b/tests/multiv01.at @@ -51,7 +51,7 @@ tar -c --multi-volume --tape-length=$TAPE_LENGTH \ mkdir extract-dir-pipe dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ - -C extract-dir-pipe -x --multi-volume \ + -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \ --tape-length=$TAPE_LENGTH --read-full-records || exit 1 cmp file1 extract-dir-pipe/file1 diff --git a/tests/multiv02.at b/tests/multiv02.at index 7dfee1a..0c321e2 100644 --- a/tests/multiv02.at +++ b/tests/multiv02.at @@ -38,7 +38,7 @@ exec <&- tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1 +tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 ], [0], [separator diff --git a/tests/multiv03.at b/tests/multiv03.at index aa4274f..e013c19 100644 --- a/tests/multiv03.at +++ b/tests/multiv03.at @@ -59,7 +59,7 @@ tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1 echo separator-2 mv $BFILE bfile -tar -M -x -f arch.1 -f arch.2 || exit 1 +tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 cmp $BFILE bfile ], [0], diff --git a/tests/pipe.at b/tests/pipe.at index 833e134..cab8535 100644 --- a/tests/pipe.at +++ b/tests/pipe.at @@ -39,7 +39,7 @@ genfile --length 10240 --pattern zeros --file directory/file1 genfile --length 13 --file directory/file2 tar cf archive directory mv directory orig -cat archive | tar xfv - | sort +cat archive | tar xfv - --warning=no-timestamp | sort echo "separator" cmp orig/file1 directory/file1 echo "separator" diff --git a/tests/rename02.at b/tests/rename02.at index 6cadee3..4c51f26 100644 --- a/tests/rename02.at +++ b/tests/rename02.at @@ -46,14 +46,14 @@ tar -g incr -cf arch.2 -v foo mv foo old -tar xfg arch.1 /dev/null 2>tmperr +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr sort tmperr >&2 echo "Begin directory listing 1" find foo | sort echo "End directory listing 1" -tar xfgv arch.2 /dev/null +tar xfgv arch.2 /dev/null --warning=no-timestamp echo Begin directory listing 2 find foo | sort echo End directory listing 2 diff --git a/tests/rename03.at b/tests/rename03.at index 6dec2e2..d6d9a27 100644 --- a/tests/rename03.at +++ b/tests/rename03.at @@ -58,13 +58,13 @@ echo "Second dump" >&2 tar -g incr -cf arch.2 -v foo 2>tmperr sort tmperr >&2 -tar xfg arch.1 /dev/null +tar xfg arch.1 /dev/null --warning=no-timestamp echo "Begin directory listing 1" find foo | sort echo "End directory listing 1" -tar xfgv arch.2 /dev/null +tar xfgv arch.2 /dev/null --warning=no-timestamp echo Begin directory listing 2 find foo | sort echo End directory listing 2 diff --git a/tests/rename05.at b/tests/rename05.at index 26d9202..54a9067 100644 --- a/tests/rename05.at +++ b/tests/rename05.at @@ -46,11 +46,11 @@ tar -cf archive.2 -g db.2 dir mv dir orig decho First restore -tar -xf archive.1 -g db.1 +tar -xf archive.1 -g db.1 --warning=no-timestamp find directory | sort decho Second restore -tar -xf archive.2 -g db.2 +tar -xf archive.2 -g db.2 --warning=no-timestamp find dir | sort ], [0], diff --git a/tests/same-order01.at b/tests/same-order01.at index a0fd4bf..2ed4670 100644 --- a/tests/same-order01.at +++ b/tests/same-order01.at @@ -34,7 +34,7 @@ genfile -l 1024 -f file2 tar cf archive file1 file2 mkdir directory -tar -xf archive --same-order -C directory || exit 1 +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 ls directory|sort ], diff --git a/tests/same-order02.at b/tests/same-order02.at index 9538295..7beecc3 100644 --- a/tests/same-order02.at +++ b/tests/same-order02.at @@ -34,7 +34,9 @@ mkdir en mkdir to HERE=`pwd` -tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1 +tar -xf archive --same-order --warning=no-timestamp \ + -C $HERE/en file1 \ + -C $HERE/to file2 || exit 1 ls en echo separator diff --git a/tests/sparse01.at b/tests/sparse01.at index f7a6994..039fbbf 100644 --- a/tests/sparse01.at +++ b/tests/sparse01.at @@ -31,7 +31,7 @@ echo separator tar tfv archive echo separator mkdir directory -tar Cxf directory archive +tar Cxf directory archive --warning=no-timestamp genfile --stat=name,size sparsefile cmp sparsefile directory/sparsefile ], -- 2.45.2