diff options
Diffstat (limited to 'testsuite/check.sh')
-rwxr-xr-x | testsuite/check.sh | 149 |
1 files changed, 105 insertions, 44 deletions
diff --git a/testsuite/check.sh b/testsuite/check.sh index 5ad9d5b..6d79f20 100755 --- a/testsuite/check.sh +++ b/testsuite/check.sh @@ -47,8 +47,8 @@ done cat "${testdir}"/test.txt > in || framework_failure cat "${testdir}"/test.txt.tar > in.tar || framework_failure -printf "01234567890" > pin.tar || framework_failure -cat in.tar in.tar in.tar in.tar >> pin.tar || framework_failure +printf "01234567890" > pin.tar4 || framework_failure +cat in.tar in.tar in.tar in.tar >> pin.tar4 || framework_failure cat in > -in- || framework_failure cat in.lz > -in-.lz || framework_failure cat in.lz > lz_only.lz || framework_failure @@ -92,6 +92,8 @@ cmp in copy || test_failed $LINENO cmp in copy || test_failed $LINENO "${ZCAT}" -N -O lz - - < in.lz > copy || test_failed $LINENO cmp in copy || test_failed $LINENO +"${ZCAT}" -N -O un in.lz | lzip -d > copy || test_failed $LINENO +cmp in copy || test_failed $LINENO "${ZCAT}" -N --lz='lzip -q' < in.lz > copy || test_failed $LINENO cmp in copy || test_failed $LINENO "${ZCAT}" -N in > copy || test_failed $LINENO @@ -151,28 +153,31 @@ for i in ${extensions}; do "${ZCMP}" -N empty empty.$i || test_failed $LINENO $i done -"${ZCMP}" -Nq in in6 +"${ZCMP}" -N -q in in6 [ $? = 1 ] || test_failed $LINENO "${ZCMP}" -N -n 0 in in6 || test_failed $LINENO "${ZCMP}" -N -n 100B in in6 || test_failed $LINENO "${ZCMP}" -N -n 1k in in6 || test_failed $LINENO "${ZCMP}" -N -n 10kB in in6 || test_failed $LINENO -"${ZCMP}" -Nq in.tar pin.tar +"${ZCMP}" -N -n 01750 in in6 || test_failed $LINENO +"${ZCMP}" -N -n 0x3E8 in in6 || test_failed $LINENO +"${ZCMP}" -N -s in.tar pin.tar4 [ $? = 1 ] || test_failed $LINENO -"${ZCMP}" -Nq -i 0B:11B in.tar pin.tar +"${ZCMP}" -N -q -i 0B:11B in.tar pin.tar4 [ $? = 1 ] || test_failed $LINENO -"${ZCMP}" -N -i 0:11 -n 0 in.tar pin.tar || test_failed $LINENO -"${ZCMP}" -N -i 0:11 -n 100 in.tar pin.tar || test_failed $LINENO -"${ZCMP}" -N -i 0:11 -n 1Ki in.tar pin.tar || test_failed $LINENO -"${ZCMP}" -N -i 0:11 -n 10KiB in.tar pin.tar || test_failed $LINENO +"${ZCMP}" -N -i 0:11 -n 0 in.tar pin.tar4 || test_failed $LINENO +"${ZCMP}" -N -i 0:11 -n 100 in.tar pin.tar4 || test_failed $LINENO +"${ZCMP}" -N -i 0:013 -n 1Ki in.tar pin.tar4 || test_failed $LINENO +"${ZCMP}" -N -i 0:0xB -n 10KiB in.tar pin.tar4 || test_failed $LINENO "${ZCMP}" -N - - || test_failed $LINENO -"${ZCMP}" -Nq - +"${ZCMP}" -N -q - [ $? = 2 ] || test_failed $LINENO "${ZCMP}" -N in in || test_failed $LINENO "${ZCMP}" -N in || test_failed $LINENO "${ZCMP}" -N --format=gz,bz2 in || test_failed $LINENO "${ZCMP}" -N --format=gz in || test_failed $LINENO "${ZCMP}" -N in.lz in.gz || test_failed $LINENO +cat in.lz | "${ZCMP}" -N -O un,un in.lz - || test_failed $LINENO "${ZCMP}" -N --lz='lzip -q' in.lz in.gz || test_failed $LINENO "${ZCMP}" -N in.gz -- -in-.lz || test_failed $LINENO "${ZCMP}" -N -- -in-.lz in.gz || test_failed $LINENO @@ -187,25 +192,25 @@ done "${ZCMP}" -N in - < in.lz || test_failed $LINENO "${ZCMP}" -N - in < in.lz || test_failed $LINENO "${ZCMP}" -N lz_only.lz - < in || test_failed $LINENO -"${ZCMP}" -Nq lz_only.lz +"${ZCMP}" -N -q lz_only.lz [ $? = 2 ] || test_failed $LINENO -"${ZCMP}" -Nq "" in +"${ZCMP}" -N -q "" in [ $? = 2 ] || test_failed $LINENO -"${ZCMP}" -Nq --force-format=lz in.lz +"${ZCMP}" -N -q --force-format=lz in.lz [ $? = 2 ] || test_failed $LINENO -"${ZCMP}" -Nq --force-format=lz in.gz in.lz +"${ZCMP}" -N -q --force-format=lz in.gz in.lz [ $? = 2 ] || test_failed $LINENO -"${ZCMP}" -Nq -i 100BB in in +"${ZCMP}" -N -q -i 100BB in in [ $? = 2 ] || test_failed $LINENO -"${ZCMP}" -Nq -i 100BB:100 in in +"${ZCMP}" -N -q -i 100BB:100 in in [ $? = 2 ] || test_failed $LINENO -"${ZCMP}" -Nq -i 100: in in +"${ZCMP}" -N -q -i 100: in in [ $? = 2 ] || test_failed $LINENO -"${ZCMP}" -Nq -n -1 in in +"${ZCMP}" -N -q -n -1 in in [ $? = 2 ] || test_failed $LINENO "${ZCMP}" -N -q -n 100BB in in [ $? = 2 ] || test_failed $LINENO -"${ZCMP}" -Nq --gz=bad-gzip in.gz in.lz +"${ZCMP}" -N -q --gz=bad-gzip in.gz in.lz [ $? = 2 ] || test_failed $LINENO "${ZCMP}" -N --bad-option in in 2> /dev/null [ $? = 2 ] || test_failed $LINENO @@ -227,7 +232,7 @@ done "${ZDIFF}" -N in in6 > /dev/null [ $? = 1 ] || test_failed $LINENO # GNU diff 3.0 returns 2 when binary files differ -"${ZDIFF}" -N in.tar pin.tar > /dev/null && test_failed $LINENO +"${ZDIFF}" -N in.tar pin.tar4 > /dev/null && test_failed $LINENO "${ZDIFF}" -N - - || test_failed $LINENO "${ZDIFF}" -N - 2> /dev/null [ $? = 2 ] || test_failed $LINENO @@ -236,6 +241,7 @@ done "${ZDIFF}" -N --format=gz,bz2 in || test_failed $LINENO "${ZDIFF}" -N --format=gz in || test_failed $LINENO "${ZDIFF}" -N in.lz in.gz > /dev/null || test_failed $LINENO +cat in.gz | "${ZDIFF}" -N -O un,un - in.gz || test_failed $LINENO "${ZDIFF}" -N --lz='lzip -q' in.lz in.gz > /dev/null || test_failed $LINENO "${ZDIFF}" -N in.gz -- -in-.lz > /dev/null || test_failed $LINENO "${ZDIFF}" -N -- -in-.lz in.gz > /dev/null || test_failed $LINENO @@ -303,8 +309,8 @@ for i in ${extensions}; do "${ZGREP}" -N "nx_pattern" empty.$i && test_failed $LINENO $i done -"${ZGREP}" -N pin.tar -e "GNU" > /dev/null || test_failed $LINENO -"${ZGREP}" -N "GNU" < pin.tar > /dev/null || test_failed $LINENO +"${ZGREP}" -N pin.tar4 -e "GNU" > /dev/null || test_failed $LINENO +"${ZGREP}" -N "GNU" < pin.tar4 > /dev/null || test_failed $LINENO "${ZGREP}" -N -r "GNU" . > /dev/null || test_failed $LINENO "${ZGREP}" -N -r "GNU" > /dev/null || test_failed $LINENO "${ZGREP}" -N -R "GNU" . > /dev/null || test_failed $LINENO @@ -313,6 +319,7 @@ done "${ZGREP}" -N -e "GNU" in > /dev/null || test_failed $LINENO "${ZGREP}" -N "GNU" < in > /dev/null || test_failed $LINENO "${ZGREP}" -N -O lz "nx_pattern" - - < in.lz > /dev/null && test_failed $LINENO +"${ZGREP}" -N -O un "LZIP" in.lz > /dev/null || test_failed $LINENO "${ZGREP}" -N -e "-free" --lz='lzip -q' < in.lz > /dev/null || test_failed $LINENO "${ZGREP}" -N -- "-free" -in- > /dev/null || test_failed $LINENO @@ -329,7 +336,7 @@ done "${ZGREP}" -N -L "nx_pattern" in in.gz in.bz2 in.lz -- -in- > /dev/null && test_failed $LINENO "${ZGREP}" -Nq -l "01234567890" in "${bad1_lz}" in.lz && test_failed $LINENO -"${ZGREP}" -Nq -l "01234567890" in "${bad1_lz}" in.lz pin.tar > /dev/null || +"${ZGREP}" -Nq -l "01234567890" in "${bad1_lz}" in.lz pin.tar4 > /dev/null || test_failed $LINENO "${ZGREP}" -N "GNU" . @@ -355,8 +362,11 @@ for i in ${extensions}; do [ $? = 2 ] || test_failed $LINENO $i "${ZTEST}" -N --force-format=$i in 2> /dev/null [ $? = 2 ] || test_failed $LINENO $i + "${ZTEST}" -N empty.$i 2> /dev/null + [ $? = 2 ] || test_failed $LINENO $i done +rm -f empty.bz2 empty.gz empty.lz || framework_failure "${ZTEST}" -N in in.gz in.bz2 in.lz -- -in- || test_failed $LINENO "${ZTEST}" -N < in.gz || test_failed $LINENO "${ZTEST}" -N < in.bz2 || test_failed $LINENO @@ -368,7 +378,23 @@ done "${ZTEST}" -N -r || test_failed $LINENO "${ZTEST}" -N -R . || test_failed $LINENO "${ZTEST}" -N -R || test_failed $LINENO -"${ZTEST}" -N empty empty.bz2 empty.gz empty.lz || test_failed $LINENO +"${ZTEST}" -N empty || test_failed $LINENO +rm -f empty || framework_failure + +# test wrong compressed extensions +cat in.bz2 > in_bz2.gz || framework_failure +cat in.gz > in_gz.lz || framework_failure +cat in.lz > in_lz.bz2 || framework_failure +cat in > in_un.lz || framework_failure +"${ZTEST}" -Nq in_bz2.gz +[ $? = 2 ] || test_failed $LINENO +"${ZTEST}" -Nq in_gz.lz +[ $? = 2 ] || test_failed $LINENO +"${ZTEST}" -Nq in_lz.bz2 +[ $? = 2 ] || test_failed $LINENO +"${ZTEST}" -Nq in_un.lz +[ $? = 2 ] || test_failed $LINENO +rm -f in_bz2.gz in_gz.lz in_lz.bz2 in_un.lz || framework_failure "${ZTEST}" -Nq in.gz "${bad0_lz}" in.bz2 "${bad1_lz}" in.lz [ $? = 2 ] || test_failed $LINENO @@ -378,12 +404,16 @@ lines=`"${ZTEST}" -Nv in.gz "${bad0_lz}" in.bz2 "${bad1_lz}" in.lz 2>&1 | wc -l` [ "${lines}" -eq 6 ] || test_failed $LINENO "${lines}" "${ZTEST}" -Nq < in [ $? = 2 ] || test_failed $LINENO +"${ZTEST}" -Nq --force-format=un < in.gz +[ $? = 1 ] || test_failed $LINENO "${ZTEST}" -Nq "" < in.lz [ $? = 1 ] || test_failed $LINENO dd if=in.lz bs=1000 count=1 2> /dev/null | "${ZTEST}" -N -q [ $? = 2 ] || test_failed $LINENO "${ZTEST}" -Nq --force-format=lz in.bz2 [ $? = 2 ] || test_failed $LINENO +"${ZTEST}" -Nq --force-format=un in.gz +[ $? = 1 ] || test_failed $LINENO "${ZTEST}" -N --lz='lzip --bad-option' in.lz 2> /dev/null [ $? = 1 ] || test_failed $LINENO "${ZTEST}" -N --bad-option 2> /dev/null @@ -410,20 +440,30 @@ cat in.gz > a.gz || framework_failure "${ZUPDATE}" -N --bad-option 2> /dev/null [ $? = 2 ] || test_failed $LINENO +if /bin/sh -c "tarlz -V" > /dev/null 2>&1; then + printf . + gzip < in.tar > in.tar.gz || framework_failure + "${ZUPDATE}" -N -k --lz='tarlz -0 -z --no-solid' in.tar.gz || + test_failed $LINENO + [ -e in.tar ] || test_failed $LINENO + "${ZCMP}" -N in.tar.gz in.tar.lz || test_failed $LINENO + rm -f in.tar.gz in.tar.lz || framework_failure +fi + cat in.lz in.lz > a.lz || framework_failure -"${ZUPDATE}" -Nq -f a.bz2 a.gz +"${ZUPDATE}" -N -q -f a.bz2 a.gz [ $? = 2 ] || test_failed $LINENO [ -e a.bz2 ] || test_failed $LINENO [ -e a.gz ] || test_failed $LINENO [ -e a.lz ] || test_failed $LINENO rm -f a.lz || framework_failure -"${ZUPDATE}" -N a.bz2 || test_failed $LINENO +"${ZUPDATE}" -N -0 a.bz2 || test_failed $LINENO [ ! -e a.bz2 ] || test_failed $LINENO [ -e a.gz ] || test_failed $LINENO [ -e a.lz ] || test_failed $LINENO rm -f a.lz || framework_failure -"${ZUPDATE}" -N a.gz || test_failed $LINENO +"${ZUPDATE}" -N -0 a.gz || test_failed $LINENO [ ! -e a.bz2 ] || test_failed $LINENO [ ! -e a.gz ] || test_failed $LINENO [ -e a.lz ] || test_failed $LINENO @@ -431,7 +471,7 @@ rm -f a.lz || framework_failure cat in.bz2 > a.bz2 || framework_failure cat in.gz > a.gz || framework_failure -"${ZUPDATE}" -Nq a.bz2 a.gz +"${ZUPDATE}" -N -q -0 a.bz2 a.gz [ $? = 1 ] || test_failed $LINENO [ ! -e a.bz2 ] || test_failed $LINENO [ -e a.gz ] || test_failed $LINENO @@ -440,7 +480,7 @@ rm -f a.lz || framework_failure cat in.bz2 > a.bz2 || framework_failure cat in.gz > a.gz || framework_failure -"${ZUPDATE}" -N -f -k a.bz2 a.gz || test_failed $LINENO +"${ZUPDATE}" -N -0 -f -k a.bz2 a.gz || test_failed $LINENO [ -e a.bz2 ] || test_failed $LINENO [ -e a.gz ] || test_failed $LINENO [ -e a.lz ] || test_failed $LINENO @@ -448,7 +488,7 @@ rm -f a.lz || framework_failure cat in.bz2 > a.bz2 || framework_failure cat in.gz > a.gz || framework_failure -"${ZUPDATE}" -N -f a.bz2 a.gz || test_failed $LINENO +"${ZUPDATE}" -N -0 -f a.bz2 a.gz || test_failed $LINENO [ ! -e a.bz2 ] || test_failed $LINENO [ ! -e a.gz ] || test_failed $LINENO [ ! -e a ] || test_failed $LINENO @@ -458,7 +498,7 @@ rm -f a.lz || framework_failure cat in.bz2 > a.tbz || framework_failure # keep combined extensions cat in.bz2 > b.tbz2 || framework_failure cat in.gz > c.tgz || framework_failure -"${ZUPDATE}" -N a.tbz b.tbz2 c.tgz || test_failed $LINENO +"${ZUPDATE}" -N -0 a.tbz b.tbz2 c.tgz || test_failed $LINENO [ ! -e a.tbz ] || test_failed $LINENO [ ! -e b.tbz2 ] || test_failed $LINENO [ ! -e c.tgz ] || test_failed $LINENO @@ -476,7 +516,7 @@ rm -f a.tlz b.tlz c.tlz || framework_failure cat in.bz2 > a.tbz || framework_failure # expand combined extensions cat in.bz2 > b.tbz2 || framework_failure cat in.gz > c.tgz || framework_failure -"${ZUPDATE}" -N -e a.tbz b.tbz2 c.tgz || test_failed $LINENO +"${ZUPDATE}" -N -0 -e a.tbz b.tbz2 c.tgz || test_failed $LINENO [ ! -e a.tbz ] || test_failed $LINENO [ ! -e b.tbz2 ] || test_failed $LINENO [ ! -e c.tgz ] || test_failed $LINENO @@ -495,7 +535,7 @@ rm -f a.tar.lz b.tar.lz c.tar.lz || framework_failure cat in.bz2 > a.bz2 || framework_failure cat "${bad0_gz}" > b.gz || framework_failure cat in.gz > c.gz || framework_failure -"${ZUPDATE}" -N -f a.bz2 b.gz c.gz 2> /dev/null +"${ZUPDATE}" -N -0 -f a.bz2 b.gz c.gz 2> /dev/null [ $? = 1 ] || test_failed $LINENO [ ! -e a.bz2 ] || test_failed $LINENO [ -e b.gz ] || test_failed $LINENO @@ -508,7 +548,7 @@ cat in.gz > c.gz || framework_failure cat in.bz2 > a.bz2 || framework_failure cat "${bad0_gz}" > b.gz || framework_failure cat in.gz > c.gz || framework_failure -"${ZUPDATE}" -N -f -i a.bz2 b.gz c.gz 2> /dev/null +"${ZUPDATE}" -N -0 -f -i a.bz2 b.gz c.gz 2> /dev/null [ $? = 1 ] || test_failed $LINENO [ ! -e a.bz2 ] || test_failed $LINENO [ -e b.gz ] || test_failed $LINENO @@ -517,13 +557,13 @@ cat in.gz > c.gz || framework_failure rm -f a.lz b.gz c.gz || framework_failure cat in.bz2 > a.bz2 || framework_failure -"${ZUPDATE}" -N -1 -q a.bz2 || test_failed $LINENO +"${ZUPDATE}" -N -0 -q a.bz2 || test_failed $LINENO [ ! -e a.bz2 ] || test_failed $LINENO [ -e a.lz ] || test_failed $LINENO rm -f a.lz || framework_failure cat in.gz > 'name with spaces.gz' || framework_failure -"${ZUPDATE}" -N -1 -q 'name with spaces.gz' || test_failed $LINENO +"${ZUPDATE}" -N -0 -q 'name with spaces.gz' || test_failed $LINENO [ ! -e 'name with spaces.gz' ] || test_failed $LINENO [ -e 'name with spaces.lz' ] || test_failed $LINENO "${ZCMP}" -N in 'name with spaces.lz' || test_failed $LINENO @@ -533,12 +573,34 @@ mkdir tmp2 mkdir tmp2/tmp3 cat in.bz2 > tmp2/tmp3/a.bz2 || framework_failure cat in.gz > tmp2/tmp3/a.gz || framework_failure -"${ZUPDATE}" -N -r --format=gz tmp2 || test_failed $LINENO +# test recursive to destdir +"${ZUPDATE}" -N -0 -k -r --format=gz --destdir=ddir1 tmp2 || test_failed $LINENO +[ -e tmp2/tmp3/a.bz2 ] || test_failed $LINENO +[ -e tmp2/tmp3/a.gz ] || test_failed $LINENO +[ -e ddir1/tmp3/a.lz ] || test_failed $LINENO +"${ZUPDATE}" -N -0 -k -r --format=bz2 --destdir="${objdir}"/tmp/ddir2 tmp2 || + test_failed $LINENO +[ -e tmp2/tmp3/a.bz2 ] || test_failed $LINENO +[ -e tmp2/tmp3/a.gz ] || test_failed $LINENO +[ -e ddir2/tmp3/a.lz ] || test_failed $LINENO +# test non-recursive to destdir +"${ZUPDATE}" -N -0 -k --destdir=ddir3 tmp2/tmp3/a.gz || test_failed $LINENO +[ -e tmp2/tmp3/a.bz2 ] || test_failed $LINENO +[ -e tmp2/tmp3/a.gz ] || test_failed $LINENO +[ -e ddir3/a.lz ] || test_failed $LINENO +"${ZUPDATE}" -N -0 -k --destdir=ddir4/tmp2/tmp3 tmp2/tmp3/a.gz || + test_failed $LINENO +[ -e tmp2/tmp3/a.bz2 ] || test_failed $LINENO +[ -e tmp2/tmp3/a.gz ] || test_failed $LINENO +[ -e ddir4/tmp2/tmp3/a.lz ] || test_failed $LINENO +rm -rf ddir1 ddir2 ddir3 ddir4 || framework_failure +# test recursive in place +"${ZUPDATE}" -N -0 -r --format=gz tmp2 || test_failed $LINENO [ -e tmp2/tmp3/a.bz2 ] || test_failed $LINENO [ ! -e tmp2/tmp3/a.gz ] || test_failed $LINENO [ -e tmp2/tmp3/a.lz ] || test_failed $LINENO rm -f tmp2/tmp3/a.lz || framework_failure -"${ZUPDATE}" -N -r --format=bz2 tmp2 || test_failed $LINENO +"${ZUPDATE}" -N -0 -r --format=bz2 tmp2 || test_failed $LINENO [ ! -e tmp2/tmp3/a.bz2 ] || test_failed $LINENO [ ! -e tmp2/tmp3/a.gz ] || test_failed $LINENO [ -e tmp2/tmp3/a.lz ] || test_failed $LINENO @@ -546,34 +608,33 @@ rm -f tmp2/tmp3/a.lz || framework_failure cat in.bz2 > tmp2/tmp3/a.bz2 || framework_failure cat in.gz > tmp2/tmp3/a.gz || framework_failure cd tmp2 || framework_failure -"${ZUPDATE}" -N -r -k -f . || test_failed $LINENO +"${ZUPDATE}" -N -0 -r -k -f . || test_failed $LINENO [ -e tmp3/a.bz2 ] || test_failed $LINENO [ -e tmp3/a.gz ] || test_failed $LINENO [ -e tmp3/a.lz ] || test_failed $LINENO rm -f tmp3/a.lz || framework_failure -"${ZUPDATE}" -N -r -k -f || test_failed $LINENO +"${ZUPDATE}" -N -0 -r -k -f || test_failed $LINENO [ -e tmp3/a.bz2 ] || test_failed $LINENO [ -e tmp3/a.gz ] || test_failed $LINENO [ -e tmp3/a.lz ] || test_failed $LINENO rm -f tmp3/a.lz || framework_failure -"${ZUPDATE}" -N -R -k -f . || test_failed $LINENO +"${ZUPDATE}" -N -0 -R -k -f . || test_failed $LINENO [ -e tmp3/a.bz2 ] || test_failed $LINENO [ -e tmp3/a.gz ] || test_failed $LINENO [ -e tmp3/a.lz ] || test_failed $LINENO rm -f tmp3/a.lz || framework_failure -"${ZUPDATE}" -N -R -k -f || test_failed $LINENO +"${ZUPDATE}" -N -0 -R -k -f || test_failed $LINENO [ -e tmp3/a.bz2 ] || test_failed $LINENO [ -e tmp3/a.gz ] || test_failed $LINENO [ -e tmp3/a.lz ] || test_failed $LINENO rm -f tmp3/a.lz || framework_failure -"${ZUPDATE}" -N -r -f . || test_failed $LINENO +"${ZUPDATE}" -N -0 -r -f . || test_failed $LINENO [ ! -e tmp3/a.bz2 ] || test_failed $LINENO [ ! -e tmp3/a.gz ] || test_failed $LINENO [ -e tmp3/a.lz ] || test_failed $LINENO cd .. || framework_failure rm -r tmp2 || framework_failure -rm -f empty empty.bz2 empty.gz empty.lz || framework_failure if ln -s '.' slink 2> /dev/null ; then "${ZCAT}" -N -r slink > /dev/null || test_failed $LINENO "${ZGREP}" -N -r "GNU" slink > /dev/null || test_failed $LINENO |