From 176557a004d8c479b0eecf3af4cd0d1bf10afe1d Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 29 Feb 2004 00:09:31 +0000 Subject: [PATCH] New file --- tests/star/README | 48 ++++++++++++++++++++++++++++++++++++++ tests/star/gtarfail.sh | 17 ++++++++++++++ tests/star/gtarfail2.sh | 22 +++++++++++++++++ tests/star/pax-big-10g.sh | 18 ++++++++++++++ tests/star/qucktest.sh | 37 +++++++++++++++++++++++++++++ tests/star/ustar-big-2g.sh | 19 +++++++++++++++ tests/star/ustar-big-8g.sh | 14 +++++++++++ 7 files changed, 175 insertions(+) create mode 100644 tests/star/README create mode 100755 tests/star/gtarfail.sh create mode 100755 tests/star/gtarfail2.sh create mode 100755 tests/star/pax-big-10g.sh create mode 100755 tests/star/qucktest.sh create mode 100755 tests/star/ustar-big-2g.sh create mode 100755 tests/star/ustar-big-8g.sh diff --git a/tests/star/README b/tests/star/README new file mode 100644 index 0000000..fefae5f --- /dev/null +++ b/tests/star/README @@ -0,0 +1,48 @@ +This directory contains scripts for testing GNU tar using +star "test archives". The archives themselves may 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 + +The following is a short description of the tests: + +* gtarfail.sh and gtarfile2.tar + +Need gtarfile.tar and gtarfile2.tar, respectively. These are POSIX +compliant tar files that were not accepted by previous versions of +GNU tar. + +* ustar-big-2g.sh + +Needs 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.sh + +Needs 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.sh + +Needs pax-big-10g.tar.bz2. It tests handling pax (POSIX.1-2001) archves +containing very large files (in this case -- 1 GB). + +* qucktest.sh + +A test for compliance to POSIX.1-1990 tar specification. Needs +the files ustar-all-quicktest.tar and quicktest.filelist. Apart +from them, the `tartest' program from 'star' package is needed. +This test may be run only with root privileges, so it is a good +idea to test the contents of ustar-all-quicktest.tar before running +it. + + +Local variables: +mode: outline +paragraph-separate: "[ ]*$" +end: diff --git a/tests/star/gtarfail.sh b/tests/star/gtarfail.sh new file mode 100755 index 0000000..16f5854 --- /dev/null +++ b/tests/star/gtarfail.sh @@ -0,0 +1,17 @@ +#! /bin/sh +. ./preset +star_prereq gtarfail.tar +TAR_ARCHIVE_FORMATS=auto +. $srcdir/before + +tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail.tar + +out="\ +-rw-r--r-- jes/glone 518 2001-05-25 14:41:06 vedpowered.gif +-rw-r--r-- jes/glone 6825 1997-04-29 00:19:16 cd.gif +-rw-r--r-- jes/glone 33354 1999-06-22 12:17:38 DSCN0049c.JPG +-rw-r--r-- jes/glone 86159 2001-06-05 18:16:04 Window1.jpg +-rw-r--r-- jes/glone 1310 2001-05-25 13:05:41 vipower.gif +-rw-rw-rw- jes/glone 148753 1998-09-15 13:08:15 billyboy.jpg +" +. $srcdir/after diff --git a/tests/star/gtarfail2.sh b/tests/star/gtarfail2.sh new file mode 100755 index 0000000..5db0557 --- /dev/null +++ b/tests/star/gtarfail2.sh @@ -0,0 +1,22 @@ +#! /bin/sh +. ./preset +star_prereq gtarfail2.tar +TAR_ARCHIVE_FORMATS=auto +. $srcdir/before + +tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail2.tar + +out="\ +-rwxr-xr-x jes/glone 214 2001-09-21 14:08:36 .clean +lrwxrwxrwx jes/cats 0 1998-05-07 12:39:00 RULES -> makefiles/RULES +drwxr-sr-x jes/glone 0 2001-12-10 00:00:58 build/ +-rw-r--r-- jes/glone 312019 2001-12-10 00:00:20 build/smake-1.2.tar.gz +drwxr-sr-x jes/glone 0 2001-11-09 18:20:33 build/psmake/ +-rwxr-xr-x jes/glone 259 2000-01-09 16:36:34 build/psmake/MAKE +-rwxr-xr-x jes/glone 4820 2001-02-25 22:45:53 build/psmake/MAKE.sh +-rw-r--r-- jes/glone 647 2001-02-25 23:50:06 build/psmake/Makefile +lrwxrwxrwx jes/glone 0 2001-08-29 10:53:53 build/psmake/archconf.c -> ../archconf.c +lrwxrwxrwx jes/glone 0 2001-08-29 10:54:00 build/psmake/astoi.c -> ../../lib/astoi.c +" + +. $srcdir/after diff --git a/tests/star/pax-big-10g.sh b/tests/star/pax-big-10g.sh new file mode 100755 index 0000000..66da966 --- /dev/null +++ b/tests/star/pax-big-10g.sh @@ -0,0 +1,18 @@ +#! /bin/sh +. ./preset +star_prereq pax-big-10g.tar.bz2 +TAR_ARCHIVE_FORMATS=auto +. $srcdir/before + +tar --utc -tvjf $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 + +out="\ +-rw------- jes/glone 10737418240 2002-06-15 21:18:47 10g +-rw-r--r-- jes/glone 0 2002-06-15 14:53:32 file +" + +err="\ +tar: Read 3072 bytes from $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 +" + +. $srcdir/after diff --git a/tests/star/qucktest.sh b/tests/star/qucktest.sh new file mode 100755 index 0000000..b85b96c --- /dev/null +++ b/tests/star/qucktest.sh @@ -0,0 +1,37 @@ +#! /bin/sh +. ./preset +star_prereq ustar-all-quicktest.tar +star_prereq quicktest.filelist +# Only root may perform this test +test -w / || skiptest + +TAR_ARCHIVE_FORMATS=ustar +. $srcdir/before + +mkdir directory +cd directory + +save_TAR_OPTIONS=$TAR_OPTIONS +TAR_OPTIONS="" tar xf $STAR_TESTSCRIPTS/ustar-all-quicktest.tar +TAR_OPTIONS=$save_TAR_OPTIONS +echo separator +echo separator >&2 +tar cfT ../archive $STAR_TESTSCRIPTS/quicktest.filelist +cd .. + +${TARTEST:-tartest} -v < $STAR_TESTSCRIPTS/ustar-all-quicktest.tar > old.out +${TARTEST:-tartest} -v < archive > new.out + +cmp old.out new.out + +out="\ +separator +" + +err_ignore="tar: Extracting contiguous files as regular files" + +err="\ +separator +" + +. $srcdir/after diff --git a/tests/star/ustar-big-2g.sh b/tests/star/ustar-big-2g.sh new file mode 100755 index 0000000..44a4dd7 --- /dev/null +++ b/tests/star/ustar-big-2g.sh @@ -0,0 +1,19 @@ +#! /bin/sh +. ./preset +star_prereq ustar-big-2g.tar.bz2 +TAR_ARCHIVE_FORMATS=auto +. $srcdir/before + +tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2 + +out="\ +-rw------- jes/glone 2147483647 2002-06-15 14:53:23 big +-rw-r--r-- jes/glone 0 2002-06-15 14:53:32 file +" + +# Fixme: why? +err="\ +tar: Read 4096 bytes from $STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2 +" + +. $srcdir/after diff --git a/tests/star/ustar-big-8g.sh b/tests/star/ustar-big-8g.sh new file mode 100755 index 0000000..e548282 --- /dev/null +++ b/tests/star/ustar-big-8g.sh @@ -0,0 +1,14 @@ +#! /bin/sh +. ./preset +star_prereq ustar-big-8g.tar.bz2 +TAR_ARCHIVE_FORMATS=auto +. $srcdir/before + +tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2 + +out="\ +-rw------- jes/glone 8589934591 2002-06-15 15:08:33 8gb-1 +-rw-r--r-- jes/glone 0 2002-06-15 14:53:32 file +" + +. $srcdir/after -- 2.45.2