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.
This commit is contained in:
Paul Eggert
2010-10-15 21:52:40 -07:00
parent 241b72ffad
commit 502abd93bd
24 changed files with 37 additions and 35 deletions

View File

@@ -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
AT_CLEANUP

View File

@@ -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],

View File

@@ -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],

View File

@@ -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],

View File

@@ -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

View File

@@ -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

View File

@@ -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 ..
],

View File

@@ -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

View File

@@ -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
AT_CLEANUP

View File

@@ -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
],

View File

@@ -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])

View File

@@ -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/

View File

@@ -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],

View File

@@ -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
],

View File

@@ -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

View File

@@ -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

View File

@@ -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],

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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],

View File

@@ -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
],

View File

@@ -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

View File

@@ -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
],