diff options
Diffstat (limited to 'tests/star')
-rw-r--r-- | tests/star/README | 68 | ||||
-rw-r--r-- | tests/star/gtarfail.at | 40 | ||||
-rw-r--r-- | tests/star/gtarfail2.at | 45 | ||||
-rw-r--r-- | tests/star/multi-fail.at | 89 | ||||
-rw-r--r-- | tests/star/pax-big-10g.at | 43 | ||||
-rwxr-xr-x | tests/star/quicktest.sh | 108 | ||||
-rw-r--r-- | tests/star/ustar-big-2g.at | 42 | ||||
-rw-r--r-- | tests/star/ustar-big-8g.at | 42 |
8 files changed, 477 insertions, 0 deletions
diff --git a/tests/star/README b/tests/star/README new file mode 100644 index 0000000..8e1b231 --- /dev/null +++ b/tests/star/README @@ -0,0 +1,68 @@ +This directory contains scripts for testing GNU tar using +star "test archives". The archives themselves can be obtained +from http://download.berlios.de/pub/star/testscripts. + +The tests are ignored unless environment variable STAR_TESTSCRIPTS +is set and points to the directory where the test archives reside. +Sample usage: + + make STAR_TESTSCRIPTS=testdir check +or + make TESTS_ENVIRONMENT='STAR_TESTSCRIPTS=testdir' check + +The file `quicktest.sh' is a separate test. It is never executed +within `make check' command, you will need to run it manually. +Please, carefully read section `quicktest.sh' below before running +it. + +Following is a short description of the tests: + +* gtarfail.at and gtarfail2.at + +These tests require gtarfile.tar and gtarfile2.tar, respectively. +These files are POSIX compliant tar archives that were not accepted +by previous versions of GNU tar. + +* multi-fail.at + +Requires gnu-multi-fail-volume1.gtar and gnu-multi-fail-volume2.gtar. +These are two parts of a multi-volume archive that previous versions +of tar refused to read (at least, without -B option). + +* ustar-big-2g.at + +Requires ustar-big-2g.tar.bz2. It is a tar archive containing a file with +the largest size that a historic tar implementation is able to understand. + +* ustar-big-8g.at + +Requires ustar-big-8g.tar.bz2. This is a test for reading an archive containing +files with the largest size that may be used with ustar (POSIX.1-1990) +format. + +* pax-big-10g.at + +Requires pax-big-10g.tar.bz2. It tests handling pax (POSIX.1-2001) archves +containing very large files (in this case -- 10 GB). + +* quicktest.sh + +This is a test for compliance to POSIX.1-1990 tar specification. It +requires two files: ustar-all-quicktest.tar and quicktest.filelist, +(they usually reside in star/tartest directory), and `tartest' program +(also part of star distribution). The test must be run only with root +privileges, so it is a good idea to test contents of +ustar-all-quicktest.tar before running it. + +If `tartest' is not in your PATH, use TARTEST variable to specify its +full file name. You may pass both STAR_TESTSCRIPTS and TARTEST +variables as command line arguments to quicktest.sh, as shown in +the example below: + + ./quicktest.sh STAR_TESTSCRIPTS=testdir TARTEST=/path/to/tartest + + +Local variables: +mode: outline +paragraph-separate: "[ ]*$" +end: diff --git a/tests/star/gtarfail.at b/tests/star/gtarfail.at new file mode 100644 index 0000000..fa7abda --- /dev/null +++ b/tests/star/gtarfail.at @@ -0,0 +1,40 @@ +# Process this file with autom4te to create testsuite. -*- Autotest -*- + +# Test suite for GNU tar. +# Copyright (C) 2004, 2006 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +AT_SETUP([gtarfail]) +AT_KEYWORDS([star gtarfail]) + +unset TAR_OPTIONS + +AT_CHECK([ +AT_STAR_PREREQ([gtarfail.tar],[bf7612e401aaa679edbb07ae1183811b]) + +tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail.tar +], +[0], +[-rw-r--r-- jes/glone 518 2001-05-25 14:41 vedpowered.gif +-rw-r--r-- jes/glone 6825 1997-04-29 00:19 cd.gif +-rw-r--r-- jes/glone 33354 1999-06-22 12:17 DSCN0049c.JPG +-rw-r--r-- jes/glone 86159 2001-06-05 18:16 Window1.jpg +-rw-r--r-- jes/glone 1310 2001-05-25 13:05 vipower.gif +-rw-rw-rw- jes/glone 148753 1998-09-15 13:08 billyboy.jpg +]) + +AT_CLEANUP diff --git a/tests/star/gtarfail2.at b/tests/star/gtarfail2.at new file mode 100644 index 0000000..61c4dc3 --- /dev/null +++ b/tests/star/gtarfail2.at @@ -0,0 +1,45 @@ +# Process this file with autom4te to create testsuite. -*- Autotest -*- + +# Test suite for GNU tar. +# Copyright (C) 2004, 2006 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +AT_SETUP([gtarfail2]) +AT_KEYWORDS([star gtarfail2]) + +unset TAR_OPTIONS + +AT_CHECK([ +AT_STAR_PREREQ([gtarfail2.tar],[6b607d1faec14b82f69525d9c5b66e53]) +tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail2.tar +], +[0], +[-rwxr-xr-x jes/glone 214 2001-09-21 14:08 .clean +lrwxrwxrwx jes/cats 0 1998-05-07 12:39 RULES -> makefiles/RULES +drwxr-sr-x jes/glone 0 2001-12-10 00:00 build/ +-rw-r--r-- jes/glone 312019 2001-12-10 00:00 build/smake-1.2.tar.gz +drwxr-sr-x jes/glone 0 2001-11-09 18:20 build/psmake/ +-rwxr-xr-x jes/glone 259 2000-01-09 16:36 build/psmake/MAKE +-rwxr-xr-x jes/glone 4820 2001-02-25 22:45 build/psmake/MAKE.sh +-rw-r--r-- jes/glone 647 2001-02-25 23:50 build/psmake/Makefile +lrwxrwxrwx jes/glone 0 2001-08-29 10:53 build/psmake/archconf.c -> ../archconf.c +lrwxrwxrwx jes/glone 0 2001-08-29 10:54 build/psmake/astoi.c -> ../../lib/astoi.c +]) + +AT_CLEANUP + + diff --git a/tests/star/multi-fail.at b/tests/star/multi-fail.at new file mode 100644 index 0000000..9627ced --- /dev/null +++ b/tests/star/multi-fail.at @@ -0,0 +1,89 @@ +# Process this file with autom4te to create testsuite. -*- Autotest -*- + +# Test suite for GNU tar. +# Copyright (C) 2004, 2006 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +AT_SETUP([multi-fail]) +AT_KEYWORDS([star multivolume multiv multi-fail]) + +unset TAR_OPTIONS + +AT_CHECK([ +AT_STAR_PREREQ([gnu-multi-fail-volume1.gtar],[7c28663dd98b0bd91ceb4be7af55254e]) +AT_STAR_PREREQ([gnu-multi-fail-volume2.gtar],[b5d41c4c3ec440687d4a44957b5079a8]) + +tar --utc -tvM -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume1.gtar \ + -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume2.gtar <&- +], +[0], +[drwxrwsr-x joerg/bs 0 2003-10-11 14:32 OBJ/i386-sunos5-gcc/ +-rw-r--r-- joerg/bs 1 2003-10-11 14:32 OBJ/i386-sunos5-gcc/Dnull +-rw-r--r-- joerg/bs 1743 2003-10-10 18:06 OBJ/i386-sunos5-gcc/star.d +-rw-r--r-- joerg/bs 1460 2003-10-11 11:53 OBJ/i386-sunos5-gcc/header.d +-rw-r--r-- joerg/bs 1540 2003-10-10 18:06 OBJ/i386-sunos5-gcc/cpiohdr.d +-rw-r--r-- joerg/bs 2245 2003-10-10 18:06 OBJ/i386-sunos5-gcc/xheader.d +-rw-r--r-- joerg/bs 1254 2003-10-10 18:06 OBJ/i386-sunos5-gcc/xattr.d +-rw-r--r-- joerg/bs 1330 2003-10-10 18:06 OBJ/i386-sunos5-gcc/list.d +-rw-r--r-- joerg/bs 1745 2003-10-10 18:06 OBJ/i386-sunos5-gcc/extract.d +-rw-r--r-- joerg/bs 1518 2003-10-10 18:06 OBJ/i386-sunos5-gcc/create.d +-rw-r--r-- joerg/bs 1235 2003-10-10 18:06 OBJ/i386-sunos5-gcc/append.d +-rw-r--r-- joerg/bs 1368 2003-10-10 18:06 OBJ/i386-sunos5-gcc/diff.d +-rw-r--r-- joerg/bs 1423 2003-10-10 18:06 OBJ/i386-sunos5-gcc/remove.d +-rw-r--r-- joerg/bs 1493 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star_unix.d +-rw-r--r-- joerg/bs 1572 2003-10-10 18:07 OBJ/i386-sunos5-gcc/acl_unix.d +-rw-r--r-- joerg/bs 1453 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fflags.d +-rw-r--r-- joerg/bs 2257 2003-10-11 14:32 OBJ/i386-sunos5-gcc/buffer.d +-rw-r--r-- joerg/bs 969 2003-10-07 17:53 OBJ/i386-sunos5-gcc/dirtime.d +-rw-r--r-- joerg/bs 1308 2003-10-10 18:07 OBJ/i386-sunos5-gcc/lhash.d +-rw-r--r-- joerg/bs 1287 2003-10-10 18:07 OBJ/i386-sunos5-gcc/hole.d +-rw-r--r-- joerg/bs 1105 2003-10-10 18:07 OBJ/i386-sunos5-gcc/longnames.d +-rw-r--r-- joerg/bs 1230 2003-10-10 18:07 OBJ/i386-sunos5-gcc/names.d +-rw-r--r-- joerg/bs 1091 2003-10-10 18:07 OBJ/i386-sunos5-gcc/movearch.d +-rw-r--r-- joerg/bs 961 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.d +-rw-r--r-- joerg/bs 1113 2003-10-10 18:07 OBJ/i386-sunos5-gcc/props.d +-rw-r--r-- joerg/bs 2146 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fetchdir.d +-rw-r--r-- joerg/bs 1093 2003-10-10 18:07 OBJ/i386-sunos5-gcc/unicode.d +-rw-r--r-- joerg/bs 1211 2003-10-10 18:07 OBJ/i386-sunos5-gcc/subst.d +-rw-r--r-- joerg/bs 2076 2003-10-11 11:53 OBJ/i386-sunos5-gcc/volhdr.d +-rw-r--r-- joerg/bs 1480 2003-10-10 18:07 OBJ/i386-sunos5-gcc/chdir.d +-rw-r--r-- joerg/bs 42460 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star.o +-rw-r--r-- joerg/bs 22564 2003-10-11 11:53 OBJ/i386-sunos5-gcc/header.o +-rw-r--r-- joerg/bs 7880 2003-10-10 18:07 OBJ/i386-sunos5-gcc/cpiohdr.o +-rw-r--r-- joerg/bs 14624 2003-10-10 18:07 OBJ/i386-sunos5-gcc/xheader.o +-rw-r--r-- joerg/bs 924 2003-10-10 18:07 OBJ/i386-sunos5-gcc/xattr.o +-rw-r--r-- joerg/bs 6120 2003-10-10 18:07 OBJ/i386-sunos5-gcc/list.o +-rw-r--r-- joerg/bs 12764 2003-10-10 18:07 OBJ/i386-sunos5-gcc/extract.o +-rw-r--r-- joerg/bs 14668 2003-10-10 18:07 OBJ/i386-sunos5-gcc/create.o +-rw-r--r-- joerg/bs 2576 2003-10-10 18:07 OBJ/i386-sunos5-gcc/append.o +-rw-r--r-- joerg/bs 7636 2003-10-10 18:07 OBJ/i386-sunos5-gcc/diff.o +-rw-r--r-- joerg/bs 3072 2003-10-10 18:07 OBJ/i386-sunos5-gcc/remove.o +-rw-r--r-- joerg/bs 5612 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star_unix.o +-rw-r--r-- joerg/bs 6220 2003-10-10 18:07 OBJ/i386-sunos5-gcc/acl_unix.o +-rw-r--r-- joerg/bs 1092 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fflags.o +-rw-r--r-- joerg/bs 20996 2003-10-11 14:32 OBJ/i386-sunos5-gcc/buffer.o +-rw-r--r-- joerg/bs 2060 2003-10-07 17:53 OBJ/i386-sunos5-gcc/dirtime.o +-rw-r--r-- joerg/bs 1664 2003-10-10 18:07 OBJ/i386-sunos5-gcc/lhash.o +-rw-r--r-- joerg/bs 10564 2003-10-10 18:07 OBJ/i386-sunos5-gcc/hole.o +-rw-r--r-- joerg/bs 3864 2003-10-10 18:07 OBJ/i386-sunos5-gcc/longnames.o +-rw-r--r-- joerg/bs 2576 2003-10-10 18:07 OBJ/i386-sunos5-gcc/names.o +-rw-r--r-- joerg/bs 952 2003-10-10 18:07 OBJ/i386-sunos5-gcc/movearch.o +-rw-r--r-- joerg/bs 2756 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.o +]) + +AT_CLEANUP + diff --git a/tests/star/pax-big-10g.at b/tests/star/pax-big-10g.at new file mode 100644 index 0000000..5e28db2 --- /dev/null +++ b/tests/star/pax-big-10g.at @@ -0,0 +1,43 @@ +# Process this file with autom4te to create testsuite. -*- Autotest -*- + +# Test suite for GNU tar. +# Copyright (C) 2004, 2006 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +AT_SETUP([pax-big-10g]) +AT_KEYWORDS([star pax-big-10g]) + +unset TAR_OPTIONS + +AT_CHECK([ +AT_GZIP_PREREQ([bzip2]) +AT_STAR_PREREQ([pax-big-10g.tar.bz2],[ca15c23acc8d8bb1f27e60113a5f8bff]) + +tar --utc -tvjf $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 +], +[0], +[-rw------- jes/glone 10737418240 2002-06-15 21:18 10g +-rw-r--r-- jes/glone 0 2002-06-15 14:53 file +], +[stderr]) + +RE_CHECK([stderr],[tar: Record size = .* +]) + +AT_CLEANUP + + diff --git a/tests/star/quicktest.sh b/tests/star/quicktest.sh new file mode 100755 index 0000000..8eb2fc8 --- /dev/null +++ b/tests/star/quicktest.sh @@ -0,0 +1,108 @@ +#! /bin/sh +# This file is part of GNU tar testsuite. +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +PWD=`pwd` +P=`expr $0 : '\(.*\)/.*'` +DIR=`cd $P; pwd`/../../src +if [ -d $DIR ]; then + PATH=`cd $DIR;pwd`:$PATH +fi + +# Usage: quicktest FILELIST ARCHIVE-NAME +quicktest() { + DIR=quicktest.$$ + mkdir $DIR + cd $DIR + + TAR_OPTIONS="" + export TAR_OPTIONS + + tar xf $2 + tar -cf ../archive -H ustar -T $1 + cd .. + + ${TARTEST:-tartest} -v < $2 > $DIR/old.out + ${TARTEST:-tartest} -v < archive > $DIR/new.out + + if cmp $DIR/old.out $DIR/new.out; then + echo "PASS" + rm -r $DIR + exit 0 + else + echo "FAIL. Examine $DIR for details" + exit 1 + fi +} + +test_access() { + if [ -r $1 ]; then + : + else + echo "$1 does not exist or is unreadable" + echo 77 + fi +} + +check_environ() { + if [ "$STAR_TESTSCRIPTS" = "" ]; then + echo "STAR_TESTSCRIPTS not set" + exit 77 + fi + + if [ -d $STAR_TESTSCRIPTS ]; then + : + else + echo "STAR_TESTSCRIPTS is not a directory" + exit 77 + fi + + ARCHIVE=$STAR_TESTSCRIPTS/ustar-all-quicktest.tar + test_access $ARCHIVE + FILELIST=$STAR_TESTSCRIPTS/quicktest.filelist + test_access $FILELIST + + ${TARTEST:-tartest} < /dev/null > /dev/null 2>&1 + if [ $? -eq 127 ]; then + echo "tartest not in your path" + exit 77 + fi + tar --version +} + +getargs() { + for option + do + case $option in + *=*) eval $option;; + *) echo "Unknown option: $option" >&2 + exit 77;; + esac + done +} + +if [ -w / ]; then + getargs $* + check_environ + quicktest $FILELIST $ARCHIVE +else + echo "You need to be root to run this test" + exit 77 +fi + +# End of quicktest.sh diff --git a/tests/star/ustar-big-2g.at b/tests/star/ustar-big-2g.at new file mode 100644 index 0000000..c132d06 --- /dev/null +++ b/tests/star/ustar-big-2g.at @@ -0,0 +1,42 @@ +# Process this file with autom4te to create testsuite. -*- Autotest -*- + +# Test suite for GNU tar. +# Copyright (C) 2004, 2006 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +AT_SETUP([ustar-big-2g]) +AT_KEYWORDS([star ustar-big-2g]) + +unset TAR_OPTIONS + +AT_CHECK([ +AT_GZIP_PREREQ([bzip2]) +AT_STAR_PREREQ([ustar-big-2g.tar.bz2],[b63979733629c8fcdf40b60065422767]) + +tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2 +], +[0], +[-rw------- jes/glone 2147483647 2002-06-15 14:53 big +-rw-r--r-- jes/glone 0 2002-06-15 14:53 file +], +[stderr]) + +RE_CHECK([stderr],[tar: Record size = .* +]) + +AT_CLEANUP + diff --git a/tests/star/ustar-big-8g.at b/tests/star/ustar-big-8g.at new file mode 100644 index 0000000..b642bf7 --- /dev/null +++ b/tests/star/ustar-big-8g.at @@ -0,0 +1,42 @@ +# Process this file with autom4te to create testsuite. -*- Autotest -*- + +# Test suite for GNU tar. +# Copyright (C) 2004, 2006 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +AT_SETUP([ustar-big-8g]) +AT_KEYWORDS([star ustar-big-8g]) + +unset TAR_OPTIONS + +AT_CHECK([ +AT_GZIP_PREREQ([bzip2]) +AT_STAR_PREREQ([ustar-big-8g.tar.bz2],[60ff503fa4b8288bef7ada89e9c91b0f]) + +tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2 +], +[0], +[-rw------- jes/glone 8589934591 2002-06-15 15:08 8gb-1 +-rw-r--r-- jes/glone 0 2002-06-15 14:53 file +], +[stderr]) + +RE_CHECK([stderr],[tar: Record size = .* +]) + +AT_CLEANUP + |