From: Sergey Poznyakoff Date: Sun, 4 Apr 2004 09:24:44 +0000 (+0000) Subject: Added new tests X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=ad2c53d6262ef55c3a457ba8901ee857b80a7fac;p=chaz%2Ftar Added new tests --- diff --git a/tests/Makefile.am b/tests/Makefile.am index cdf391a..18ca350 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -23,19 +23,36 @@ check_PROGRAMS = genfile mksparse BUILT_SOURCES = preset -TESTS = version.sh \ - append.sh delete01.sh delete02.sh delete03.sh delete04.sh \ - extrac01.sh extrac02.sh extrac03.sh extrac04.sh \ - gzip.sh incremen.sh ignfail.sh listed01.sh \ - longv7.sh multiv01.sh old.sh options.sh volume.sh \ - recurse.sh \ - star/gtarfail.sh \ - star/gtarfail2.sh \ - star/multi-fail.sh \ - star/ustar-big-2g.sh \ - star/ustar-big-8g.sh \ - star/pax-big-10g.sh \ - star/qucktest.sh +TESTS = \ + version.sh\ + append.sh\ + delete01.sh\ + delete02.sh\ + delete03.sh\ + delete04.sh\ + extrac01.sh\ + extrac02.sh\ + extrac03.sh\ + extrac04.sh\ + gzip.sh\ + incremen.sh\ + ignfail.sh\ + listed01.sh\ + longv7.sh\ + multiv01.sh\ + multiv02.sh\ + old.sh\ + options.sh\ + volume.sh\ + recurse.sh\ + sparse01.sh\ + star/gtarfail.sh\ + star/gtarfail2.sh\ + star/multi-fail.sh\ + star/ustar-big-2g.sh\ + star/ustar-big-8g.sh\ + star/pax-big-10g.sh\ + star/qucktest.sh genfile_SOURCES = genfile.c mksparse_SOURCES = mksparse.c diff --git a/tests/multiv02.sh b/tests/multiv02.sh new file mode 100755 index 0000000..324b066 --- /dev/null +++ b/tests/multiv02.sh @@ -0,0 +1,43 @@ +#! /bin/sh + +# Previous versions of tar were not able to skip a member straddling +# the multivolume archive boundary. Reported by Mads Martin Joergensen +# + +# This file is part of GNU tar testsuite. +# Copyright (C) 2004 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +. ./preset +TAR_ARCHIVE_FORMATS="gnu oldgnu" +. $srcdir/before + +genfile --length 10240 > en +genfile --length 20000 > to +genfile --length 20000 > tre +genfile --length 10240 > fire + +tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire +echo separator +tar -v -x -f A.tar -f B.tar -f C.tar -M en + +out="\ +separator +en +" + +. $srcdir/after \ No newline at end of file diff --git a/tests/sparse01.sh b/tests/sparse01.sh new file mode 100755 index 0000000..05f7cc6 --- /dev/null +++ b/tests/sparse01.sh @@ -0,0 +1,42 @@ +#! /bin/sh + +# Check sparse file handling. + +# This file is part of GNU tar testsuite. +# Copyright (C) 2004 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +. ./preset +TAR_ARCHIVE_FORMATS="gnu oldgnu posix" +. $srcdir/before + +genfile --length 1000 > begin +genfile --length 1000 > end +mksparse sparsefile 512 0 ABCD 1M EFGH 2000K IJKL +tar -c -f archive --sparse begin sparsefile end +echo separator + +tar tfv archive + +out_regex="\ +separator +-rw-r--r-- [^ ][^ ]* *1000 [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] begin +-rw-r--r-- [^ ][^ ]* *10344448[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] sparsefile +-rw-r--r-- [^ ][^ ]* *1000 [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] end +" + +. $srcdir/after