summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/check.sh230
1 files changed, 147 insertions, 83 deletions
diff --git a/testsuite/check.sh b/testsuite/check.sh
index 348e447..9027bd5 100755
--- a/testsuite/check.sh
+++ b/testsuite/check.sh
@@ -1,6 +1,6 @@
#! /bin/sh
# check script for Tarlz - Archiver with multimember lzip compression
-# Copyright (C) 2013-2022 Antonio Diaz Diaz.
+# Copyright (C) 2013-2024 Antonio Diaz Diaz.
#
# This script is free software: you have unlimited permission
# to copy, distribute, and modify it.
@@ -59,6 +59,8 @@ eoa_lz="${testdir}"/eoa_blocks.tar.lz
fail=0
lwarnc=0
test_failed() { fail=1 ; printf " $1" ; [ -z "$2" ] || printf "($2)" ; }
+is_compressed() { [ "`dd if="$1" bs=4 count=1 2> /dev/null`" = LZIP ] ; }
+is_uncompressed() { [ "`dd if="$1" bs=4 count=1 2> /dev/null`" != LZIP ] ; }
cyg_symlink() { [ ${lwarnc} = 0 ] &&
printf "\nwarning: your OS follows symbolic links to directories even when tarlz asks it not to\n$1"
lwarnc=1 ; }
@@ -116,6 +118,7 @@ cyg_symlink() { [ ${lwarnc} = 0 ] &&
"${TARLZ}" --check-lib # just print warning
[ $? != 2 ] || test_failed $LINENO # unless bad lzlib.h
+
printf "testing tarlz-%s..." "$2"
"${TARLZ}" -q -tf "${in}"
@@ -131,34 +134,37 @@ printf "testing tarlz-%s..." "$2"
"${TARLZ}" -q -cf out.tar.lz
[ $? = 1 ] || test_failed $LINENO
[ ! -e out.tar.lz ] || test_failed $LINENO
+"${TARLZ}" -q -cf out.tar
+[ $? = 1 ] || test_failed $LINENO
+[ ! -e out.tar ] || test_failed $LINENO
"${TARLZ}" -rf out.tar.lz || test_failed $LINENO
[ ! -e out.tar.lz ] || test_failed $LINENO
+"${TARLZ}" -rf out.tar || test_failed $LINENO
+[ ! -e out.tar ] || test_failed $LINENO
"${TARLZ}" -r || test_failed $LINENO
-"${TARLZ}" --uncompressed -q -rf out.tar "${in}"
+"${TARLZ}" -q -rf out.tar.lz "${in}"
+[ $? = 1 ] || test_failed $LINENO
+[ ! -e out.tar.lz ] || test_failed $LINENO
+"${TARLZ}" -q -rf out.tar "${in}"
[ $? = 1 ] || test_failed $LINENO
[ ! -e out.tar ] || test_failed $LINENO
-cat "${test3_lz}" > test.tar.lz || framework_failure
-"${TARLZ}" --uncompressed -q -rf test.tar.lz "${in}"
-[ $? = 2 ] || test_failed $LINENO
-cmp "${test3_lz}" test.tar.lz || test_failed $LINENO
-rm -f test.tar.lz || framework_failure
-cat "${test3}" > test.tar || framework_failure
-"${TARLZ}" -q -rf test.tar "${in}"
-[ $? = 2 ] || test_failed $LINENO
-cmp "${test3}" test.tar || test_failed $LINENO
-rm -f test.tar || framework_failure
"${TARLZ}" -q -c "${in}" nx_file > /dev/null
[ $? = 1 ] || test_failed $LINENO
"${TARLZ}" -q -c -C nx_dir "${in}"
[ $? = 1 ] || test_failed $LINENO
"${TARLZ}" -q -x -C nx_dir "${test3_lz}"
[ $? = 1 ] || test_failed $LINENO
-touch empty.tar.lz empty.tlz # list an empty lz file
+touch empty.tar.lz empty.tlz || framework_failure # list an empty lz file
"${TARLZ}" -q -tf empty.tar.lz
[ $? = 2 ] || test_failed $LINENO
"${TARLZ}" -q -tf empty.tlz
[ $? = 2 ] || test_failed $LINENO
rm -f empty.tar.lz empty.tlz || framework_failure
+touch empty.tar || framework_failure # compress an empty archive
+"${TARLZ}" -q -z empty.tar
+[ $? = 2 ] || test_failed $LINENO
+[ ! -e empty.tar.lz ] || test_failed $LINENO
+rm -f empty.tar empty.tar.lz || framework_failure
"${TARLZ}" -q -cd # test mixed operations
[ $? = 1 ] || test_failed $LINENO
"${TARLZ}" -q -cr
@@ -239,6 +245,10 @@ rm -f foo bar baz || framework_failure
cmp cfoo foo || test_failed $LINENO
cmp cbar bar || test_failed $LINENO
cmp cbaz baz || test_failed $LINENO
+# time and mode comparison always fails on OS/2
+if "${TARLZ}" -df "${test3}" --ignore-ids ; then d_works=yes
+else printf "warning: some '--diff' tests will be skipped.\n"
+fi
rm -f foo bar baz || framework_failure
for i in 0 2 6 ; do
"${TARLZ}" -n$i -xf "${test3_lz}" --missing-crc || test_failed $LINENO $i
@@ -247,7 +257,7 @@ for i in 0 2 6 ; do
cmp cbaz baz || test_failed $LINENO $i
rm -f foo bar baz || framework_failure
"${TARLZ}" -n$i -tvf "${test3_lz}" ./foo ./bar ./baz > out 2> /dev/null ||
- test_failed $LINENO $i
+ test_failed $LINENO $i
diff -u vlist3 out || test_failed $LINENO $i
rm -f out || framework_failure
"${TARLZ}" -q -n$i -xf "${test3_lz}" ./foo ./bar ./baz || test_failed $LINENO $i
@@ -273,6 +283,38 @@ for i in 0 2 6 ; do
rm -f foo bar baz || framework_failure
done
+# test -C in --diff and --extract
+for i in "${test3}" "${test3_lz}" ; do
+ mkdir dir1 dir2 dir3 || framework_failure
+ "${TARLZ}" -q -xf "$i" -C dir1 foo -C ../dir2 bar -C ../dir3 baz ||
+ test_failed $LINENO "$i"
+ cmp cfoo dir1/foo || test_failed $LINENO "$i"
+ cmp cbar dir2/bar || test_failed $LINENO "$i"
+ cmp cbaz dir3/baz || test_failed $LINENO "$i"
+ if [ "${d_works}" = yes ] ; then
+ "${TARLZ}" -df "$i" -C dir1 foo -C ../dir2 --ignore-ids bar \
+ -C ../dir3 baz || test_failed $LINENO "$i"
+ "${TARLZ}" -df "$i" -C dir3 baz -C ../dir2 bar -C ../dir1 foo \
+ --ignore-ids || test_failed $LINENO "$i"
+ fi
+ rm -rf dir1 dir2 dir3 || framework_failure
+done
+for i in "${test3dir}" "${test3dir_lz}" ; do
+ mkdir dir1 dir2 dir3 || framework_failure
+ "${TARLZ}" -q -xf "$i" -C dir2 dir/bar -C ../dir1 dir/foo \
+ -C ../dir3 dir/baz || test_failed $LINENO "$i"
+ cmp cfoo dir1/dir/foo || test_failed $LINENO "$i"
+ cmp cbar dir2/dir/bar || test_failed $LINENO "$i"
+ cmp cbaz dir3/dir/baz || test_failed $LINENO "$i"
+ if [ "${d_works}" = yes ] ; then
+ "${TARLZ}" -q -df "$i" --ignore-ids -C dir1 dir/foo -C ../dir2 dir/bar \
+ -C ../dir3 dir/baz || test_failed $LINENO "$i"
+ "${TARLZ}" -q -df "${test3}" -C dir1/dir foo -C ../../dir2/dir bar \
+ --ignore-ids -C ../../dir3/dir baz || test_failed $LINENO "$i"
+ fi
+ rm -rf dir1 dir2 dir3 || framework_failure
+done
+
for i in "${test3dir}" "${test3dir_lz}" ; do
"${TARLZ}" -q -tf "$i" --missing-crc || test_failed $LINENO "$i"
"${TARLZ}" -q -xf "$i" --missing-crc || test_failed $LINENO "$i"
@@ -409,9 +451,9 @@ for i in 0 2 6 ; do
rm -f foo bar baz || framework_failure
done
"${TARLZ}" -n0 -xf "${testdir}"/test3_eoa3.tar.lz || test_failed $LINENO
-cmp cfoo foo || test_failed $LINENO $i
-[ ! -e bar ] || test_failed $LINENO $i
-[ ! -e baz ] || test_failed $LINENO $i
+cmp cfoo foo || test_failed $LINENO
+[ ! -e bar ] || test_failed $LINENO
+[ ! -e baz ] || test_failed $LINENO
rm -f foo bar baz || framework_failure
# test --list and --extract tar in tar.lz
@@ -480,6 +522,10 @@ cat "${in}" > out.tar.lz || framework_failure # invalid tar.lz
"${TARLZ}" -Aqf out.tar.lz "${test3_lz}"
[ $? = 2 ] || test_failed $LINENO
cat "${in_tar_lz}" > out.tar.lz || framework_failure
+"${TARLZ}" -q --un -Af out.tar.lz "${test3_lz}" # contradictory ext
+[ $? = 1 ] || test_failed $LINENO
+cmp "${in_tar_lz}" out.tar.lz || test_failed $LINENO
+cat "${in_tar_lz}" > out.tar.lz || framework_failure
"${TARLZ}" -Af out.tar.lz "${test3_lz}" || test_failed $LINENO
"${TARLZ}" -xf out.tar.lz || test_failed $LINENO
cmp "${in}" test.txt || test_failed $LINENO
@@ -524,6 +570,10 @@ cat "${in}" > out.tar || framework_failure # invalid tar
"${TARLZ}" -Aqf out.tar "${test3}"
[ $? = 2 ] || test_failed $LINENO
cat "${in_tar}" > out.tar || framework_failure
+"${TARLZ}" -q -0 -Af out.tar "${test3}" # contradictory ext
+[ $? = 1 ] || test_failed $LINENO
+cmp "${in_tar}" out.tar || test_failed $LINENO
+cat "${in_tar}" > out.tar || framework_failure
"${TARLZ}" -Af out.tar "${test3}" || test_failed $LINENO
"${TARLZ}" -xf out.tar || test_failed $LINENO
cmp "${in}" test.txt || test_failed $LINENO
@@ -568,11 +618,13 @@ printf "\ntesting --create..."
# test --create
cat "${in}" > test.txt || framework_failure
"${TARLZ}" --warn-newer -0 -cf out.tar.lz test.txt || test_failed $LINENO
+is_compressed out.tar.lz || test_failed $LINENO
rm -f test.txt || framework_failure
"${TARLZ}" -xf out.tar.lz --missing-crc || test_failed $LINENO
cmp "${in}" test.txt || test_failed $LINENO
cat "${in}" > test.txt || framework_failure
-"${TARLZ}" --warn-newer --uncompressed -cf out.tar test.txt || test_failed $LINENO
+"${TARLZ}" --warn-newer --un -cf out.tar test.txt || test_failed $LINENO
+is_uncompressed out.tar || test_failed $LINENO
rm -f test.txt || framework_failure
"${TARLZ}" -xf out.tar --missing-crc || test_failed $LINENO
cmp "${in}" test.txt || test_failed $LINENO
@@ -639,7 +691,7 @@ cmp cfoo dir1/foo || test_failed $LINENO
cmp cbar dir1/bar || test_failed $LINENO
cmp cbaz dir1/baz || test_failed $LINENO
rm -f dir1/foo dir1/bar dir1/baz || framework_failure
-"${TARLZ}" -0 -c foo bar baz | "${TARLZ}" -x foo bar baz -C dir1 ||
+"${TARLZ}" -0 -c foo bar baz | "${TARLZ}" -x -C dir1 foo bar baz ||
test_failed $LINENO
cmp cfoo dir1/foo || test_failed $LINENO
cmp cbar dir1/bar || test_failed $LINENO
@@ -670,7 +722,8 @@ rm -f out.tar.lz foo bar baz || framework_failure
cat cfoo > foo || framework_failure
cat cbar > bar || framework_failure
cat cbaz > baz || framework_failure
-"${TARLZ}" --un -cf out.tar foo bar baz --exclude 'ba*' || test_failed $LINENO
+"${TARLZ}" -cf out.tar foo bar baz --exclude 'ba*' || test_failed $LINENO
+is_uncompressed out.tar || test_failed $LINENO
rm -f foo bar baz || framework_failure
"${TARLZ}" -xf out.tar || test_failed $LINENO
cmp cfoo foo || test_failed $LINENO
@@ -697,10 +750,13 @@ touch -d 2022-01-05T12:22:13 bar || framework_failure
for i in ${dates} @-8Ei '2017-10-01 09:00:00' '2017-10-1 9:0:0' \
'2017-10-01 09:00' '2017-10-01 09' 2017-10-01 ./bar ; do
touch foo || framework_failure
- "${TARLZ}" --un -cf out.tar --mtime="$i" foo || test_failed $LINENO "$i"
+ "${TARLZ}" -cf out.tar --mtime="$i" foo || test_failed $LINENO "$i"
+ is_uncompressed out.tar || test_failed $LINENO "$i"
"${TARLZ}" -q -df out.tar && test_failed $LINENO "$i"
"${TARLZ}" -xf out.tar || test_failed $LINENO "$i"
- "${TARLZ}" -df out.tar --ignore-overflow || test_failed $LINENO "$i"
+ if [ "${d_works}" = yes ] ; then
+ "${TARLZ}" -df out.tar --ignore-overflow || test_failed $LINENO "$i"
+ fi
done
rm -f out.tar foo bar || framework_failure
@@ -708,18 +764,20 @@ mkdir dir || framework_failure
for i in ${dates} ; do
# Skip a time stamp $i if it's out of range for this platform,
# of if it uses a notation that this platform does not recognize.
- touch -d $i dir/f$i >/dev/null 2>&1 || continue
+ touch -d "$i" "dir/f$i" >/dev/null 2>&1 || continue
done
-"${TARLZ}" --uncompressed -cf out.tar dir || test_failed $LINENO
+"${TARLZ}" -cf out.tar dir || test_failed $LINENO
+is_uncompressed out.tar || test_failed $LINENO
"${TARLZ}" -df out.tar || test_failed $LINENO
rm -rf out.tar dir || framework_failure
printf "\ntesting --diff..."
-# test --diff
"${TARLZ}" -xf "${test3_lz}" || test_failed $LINENO
-"${TARLZ}" --uncompressed -cf out.tar foo || test_failed $LINENO
-"${TARLZ}" --uncompressed -cf aout.tar foo --anonymous || test_failed $LINENO
+"${TARLZ}" -cf out.tar foo || test_failed $LINENO
+"${TARLZ}" -cf aout.tar foo --anonymous || test_failed $LINENO
+is_uncompressed out.tar || test_failed $LINENO
+is_uncompressed aout.tar || test_failed $LINENO
if cmp out.tar aout.tar > /dev/null ; then
printf "\nwarning: '--diff' test can't be run as root.\n"
else
@@ -731,7 +789,9 @@ else
"${TARLZ}" -n$i -df "${test3_lz}" --exclude '*' || test_failed $LINENO $i
"${TARLZ}" -n$i -df "${in_tar_lz}" --exclude '*' || test_failed $LINENO $i
rm -f bar || framework_failure
- "${TARLZ}" -n$i -df "${test3_lz}" foo baz --ignore-ids ||
+ "${TARLZ}" -n$i -df "${test3_lz}" --ignore-ids foo baz ||
+ test_failed $LINENO $i
+ "${TARLZ}" -n$i -df "${test3_lz}" --ignore-metadata foo baz ||
test_failed $LINENO $i
"${TARLZ}" -n$i -df "${test3_lz}" --exclude bar --ignore-ids ||
test_failed $LINENO $i
@@ -879,12 +939,14 @@ if [ "${ln_works}" = yes ] ; then
cat cbar > dir/bar || framework_failure
cat cbaz > dir/baz || framework_failure
ln -s dir dir_link || framework_failure
- "${TARLZ}" -0 -cf out1 dir_link || test_failed $LINENO
- "${TARLZ}" --un -cf out2 dir_link || test_failed $LINENO
- "${TARLZ}" -0 -n0 -cf out3 dir_link || test_failed $LINENO
- "${TARLZ}" -0 -h -cf hout1 dir_link || test_failed $LINENO
- "${TARLZ}" --un -h -cf hout2 dir_link || test_failed $LINENO
- "${TARLZ}" -0 -n0 -h -cf hout3 dir_link || test_failed $LINENO
+ "${TARLZ}" -0 -c dir_link > out1 || test_failed $LINENO
+ is_compressed out1 || test_failed $LINENO
+ "${TARLZ}" --un -c dir_link > out2 || test_failed $LINENO
+ is_uncompressed out2 || test_failed $LINENO
+ "${TARLZ}" -0 -n0 -c dir_link > out3 || test_failed $LINENO
+ "${TARLZ}" -0 -h -c dir_link > hout1 || test_failed $LINENO
+ "${TARLZ}" --un -h -c dir_link > hout2 || test_failed $LINENO
+ "${TARLZ}" -0 -n0 -h -c dir_link > hout3 || test_failed $LINENO
rm -rf dir dir_link || framework_failure
for i in 1 2 3 ; do
"${TARLZ}" -xf out$i --exclude='dir_link/*' dir_link ||
@@ -915,10 +977,6 @@ cat cbaz > baz || framework_failure
"${TARLZ}" -0 -rf aout.tar.lz bar baz --no-solid || test_failed $LINENO
cmp nout.tar.lz aout.tar.lz || test_failed $LINENO
rm -f nout.tar.lz aout.tar.lz || framework_failure
-touch aout.tar || framework_failure # wrong extension empty file
-"${TARLZ}" -0 -rf aout.tar foo bar baz || test_failed $LINENO
-cmp out.tar.lz aout.tar || test_failed $LINENO
-rm -f aout.tar || framework_failure
touch aout.tar.lz || framework_failure # append to empty file
"${TARLZ}" -0 -rf aout.tar.lz foo bar baz || test_failed $LINENO
cmp out.tar.lz aout.tar.lz || test_failed $LINENO
@@ -933,50 +991,45 @@ cmp out.tar.lz aout.tar.lz || test_failed $LINENO
cmp out.tar.lz aout.tar.lz || test_failed $LINENO
"${TARLZ}" -0 -r foo bar baz > aout.tar.lz || test_failed $LINENO # to stdout
cmp out.tar.lz aout.tar.lz || test_failed $LINENO
-"${TARLZ}" --un -q -rf aout.tar.lz foo bar baz # wrong extension archive
-[ $? = 2 ] || test_failed $LINENO
+"${TARLZ}" --un -q -rf aout.tar.lz foo bar baz # contradictory ext
+[ $? = 1 ] || test_failed $LINENO
cmp out.tar.lz aout.tar.lz || test_failed $LINENO
cat "${eoa_lz}" > aout.tar.lz || framework_failure # append to empty archive
"${TARLZ}" -0 -rf aout.tar.lz foo bar baz || test_failed $LINENO
cmp out.tar.lz aout.tar.lz || test_failed $LINENO
-"${TARLZ}" --un -q -rf aout.tar.lz foo bar baz # wrong extension empty archive
-[ $? = 2 ] || test_failed $LINENO
-cmp out.tar.lz aout.tar.lz || test_failed $LINENO
rm -f out.tar.lz aout.tar.lz || framework_failure
# test --append --uncompressed
-"${TARLZ}" --un -cf out.tar foo bar baz || test_failed $LINENO
-"${TARLZ}" --un -cf aout.tar foo || test_failed $LINENO
-"${TARLZ}" --un -rf aout.tar foo bar baz --exclude foo || test_failed $LINENO
+"${TARLZ}" -cf out.tar foo bar baz || test_failed $LINENO
+"${TARLZ}" -cf aout.tar foo || test_failed $LINENO
+"${TARLZ}" -rf aout.tar foo bar baz --exclude foo || test_failed $LINENO
+is_uncompressed out.tar || test_failed $LINENO
cmp out.tar aout.tar || test_failed $LINENO
rm -f aout.tar || framework_failure
-touch aout.tar.lz empty || framework_failure # wrong extension empty file
-"${TARLZ}" --un -q -rf aout.tar.lz foo bar baz
-[ $? = 2 ] || test_failed $LINENO
-cmp aout.tar.lz empty || test_failed $LINENO
-rm -f aout.tar.lz empty || framework_failure
+touch aout.tar empty || framework_failure # contradictory ext empty file
+"${TARLZ}" -0 -q -rf aout.tar foo bar baz
+[ $? = 1 ] || test_failed $LINENO
+cmp aout.tar empty || test_failed $LINENO
+rm -f aout.tar empty || framework_failure
touch aout.tar || framework_failure # append to empty file
-"${TARLZ}" --un -rf aout.tar foo bar baz || test_failed $LINENO
+"${TARLZ}" -rf aout.tar foo bar baz || test_failed $LINENO
cmp out.tar aout.tar || test_failed $LINENO
-"${TARLZ}" --un -rf aout.tar || test_failed $LINENO # append nothing
+"${TARLZ}" -rf aout.tar || test_failed $LINENO # append nothing
cmp out.tar aout.tar || test_failed $LINENO
-"${TARLZ}" --un -rf aout.tar -C nx_dir || test_failed $LINENO
+"${TARLZ}" -rf aout.tar -C nx_dir || test_failed $LINENO
cmp out.tar aout.tar || test_failed $LINENO
-"${TARLZ}" --un -q -rf aout.tar nx_file
+"${TARLZ}" -q -rf aout.tar nx_file
[ $? = 1 ] || test_failed $LINENO
cmp out.tar aout.tar || test_failed $LINENO
-"${TARLZ}" --un -q -rf aout.tar aout.tar || test_failed $LINENO
+"${TARLZ}" -q -rf aout.tar aout.tar || test_failed $LINENO
cmp out.tar aout.tar || test_failed $LINENO
"${TARLZ}" --un -r foo bar baz > aout.tar || test_failed $LINENO # to stdout
cmp out.tar aout.tar || test_failed $LINENO
-"${TARLZ}" -0 -q -rf aout.tar foo bar baz # wrong extension archive
-[ $? = 2 ] || test_failed $LINENO
+"${TARLZ}" -0 -q -rf aout.tar foo bar baz # contradictory ext
+[ $? = 1 ] || test_failed $LINENO
cmp out.tar aout.tar || test_failed $LINENO
cat "${eoa}" > aout.tar || framework_failure # append to empty archive
-"${TARLZ}" --un -rf aout.tar foo bar baz || test_failed $LINENO
-cmp out.tar aout.tar || test_failed $LINENO
-"${TARLZ}" -0 -q -rf aout.tar foo bar baz # wrong extension empty archive
-[ $? = 2 ] || test_failed $LINENO
+"${TARLZ}" -rf aout.tar foo bar baz || test_failed $LINENO
cmp out.tar aout.tar || test_failed $LINENO
rm -f out.tar aout.tar || framework_failure
@@ -1015,7 +1068,8 @@ rmdir dir1 || framework_failure
rmdir dir1
rm -f out.tar.lz || framework_failure
mkdir dir1 || framework_failure
-"${TARLZ}" --uncompressed -cf out.tar dir1 || test_failed $LINENO
+"${TARLZ}" -cf out.tar dir1 || test_failed $LINENO
+is_uncompressed out.tar || test_failed $LINENO
rmdir dir1 || framework_failure
"${TARLZ}" -xf out.tar || test_failed $LINENO
[ -d dir1 ] || test_failed $LINENO
@@ -1110,8 +1164,8 @@ cat cfoo > foo || framework_failure
cat cbar > bar || framework_failure
cat cbaz > baz || framework_failure
cat "${in}" > test.txt || framework_failure
-"${TARLZ}" --un -cf out.tar test.txt foo bar baz test.txt || test_failed $LINENO
-"${TARLZ}" --un -cf out3.tar foo bar baz || test_failed $LINENO
+"${TARLZ}" -cf out.tar test.txt foo bar baz test.txt || test_failed $LINENO
+"${TARLZ}" -cf out3.tar foo bar baz || test_failed $LINENO
cat out.tar > outz.tar || framework_failure
cat out3.tar > out3z.tar || framework_failure
#
@@ -1151,6 +1205,9 @@ cmp out.tar.lz out || test_failed $LINENO
"${TARLZ}" -0 -B8KiB -z --bsolid outz.tar || test_failed $LINENO
cmp out.tar.lz outz.tar.lz || test_failed $LINENO
rm -f out outz.tar.lz || framework_failure
+"${TARLZ}" -0 -B8KiB -z -o a/b/c/out --bsolid out.tar || test_failed $LINENO
+cmp out.tar.lz a/b/c/out || test_failed $LINENO
+rm -rf a || framework_failure
#
"${TARLZ}" -0 -n0 --asolid -cf out.tar.lz test.txt foo bar baz test.txt || test_failed $LINENO
"${TARLZ}" -0 -n0 --asolid -cf out3.tar.lz foo bar baz || test_failed $LINENO
@@ -1164,12 +1221,15 @@ for i in --asolid --bsolid --dsolid ; do
rm -f out outz.tar.lz out3z.tar.lz || framework_failure
done
# concatenate and compress
-"${TARLZ}" --un -cf foo.tar foo || test_failed $LINENO
-"${TARLZ}" --un -cf bar.tar bar || test_failed $LINENO
-"${TARLZ}" --un -cf baz.tar baz || test_failed $LINENO
+"${TARLZ}" -cf foo.tar foo || test_failed $LINENO
+"${TARLZ}" -cf bar.tar bar || test_failed $LINENO
+"${TARLZ}" -cf baz.tar baz || test_failed $LINENO
"${TARLZ}" -A foo.tar bar.tar baz.tar | "${TARLZ}" -0 -z -o foobarbaz.tar.lz ||
test_failed $LINENO
cmp out3.tar.lz foobarbaz.tar.lz || test_failed $LINENO
+"${TARLZ}" -A foo.tar bar.tar baz.tar | "${TARLZ}" -0 -z > foobarbaz.tar.lz ||
+ test_failed $LINENO
+cmp out3.tar.lz foobarbaz.tar.lz || test_failed $LINENO
# compress and concatenate
"${TARLZ}" -0 -z foo.tar bar.tar baz.tar || test_failed $LINENO
"${TARLZ}" -A foo.tar.lz bar.tar.lz baz.tar.lz > foobarbaz.tar.lz ||
@@ -1177,8 +1237,8 @@ cmp out3.tar.lz foobarbaz.tar.lz || test_failed $LINENO
"${TARLZ}" -0 -n0 --no-solid -c foo bar baz | cmp foobarbaz.tar.lz - ||
test_failed $LINENO
rm -f foo bar baz test.txt out.tar.lz out.tar outz.tar foobarbaz.tar.lz \
- out3.tar out3.tar.lz out3z.tar foo.tar bar.tar baz.tar \
- foo.tar.lz bar.tar.lz baz.tar.lz || framework_failure
+ out3.tar out3.tar.lz out3z.tar foo.tar bar.tar baz.tar \
+ foo.tar.lz bar.tar.lz baz.tar.lz || framework_failure
printf "\ntesting bad input..."
@@ -1260,19 +1320,23 @@ done
if [ "${ln_works}" = yes ] ; then rm -rf dir1 || framework_failure ; fi
for i in "${testdir}"/test3_nn.tar "${testdir}"/test3_nn.tar.lz ; do
- "${TARLZ}" -q -n0 -tf "$i" || test_failed $LINENO $i
- "${TARLZ}" -q -n4 -tf "$i" || test_failed $LINENO $i
- "${TARLZ}" -q -n0 -xf "$i" || test_failed $LINENO $i
- "${TARLZ}" -n0 -df "$i" --ignore-ids || test_failed $LINENO $i
- cmp cfoo foo || test_failed $LINENO $i
- [ ! -e bar ] || test_failed $LINENO $i
- cmp cbaz baz || test_failed $LINENO $i
+ "${TARLZ}" -q -n0 -tf "$i" || test_failed $LINENO "$i"
+ "${TARLZ}" -q -n4 -tf "$i" || test_failed $LINENO "$i"
+ "${TARLZ}" -q -n0 -xf "$i" || test_failed $LINENO "$i"
+ if [ "${d_works}" = yes ] ; then
+ "${TARLZ}" -n0 -df "$i" --ignore-ids || test_failed $LINENO "$i"
+ fi
+ cmp cfoo foo || test_failed $LINENO "$i"
+ [ ! -e bar ] || test_failed $LINENO "$i"
+ cmp cbaz baz || test_failed $LINENO "$i"
rm -f foo bar baz || framework_failure
- "${TARLZ}" -q -n4 -xf "$i" || test_failed $LINENO $i
- "${TARLZ}" -n4 -df "$i" --ignore-ids || test_failed $LINENO $i
- cmp cfoo foo || test_failed $LINENO $i
- [ ! -e bar ] || test_failed $LINENO $i
- cmp cbaz baz || test_failed $LINENO $i
+ "${TARLZ}" -q -n4 -xf "$i" || test_failed $LINENO "$i"
+ if [ "${d_works}" = yes ] ; then
+ "${TARLZ}" -n4 -df "$i" --ignore-ids || test_failed $LINENO "$i"
+ fi
+ cmp cfoo foo || test_failed $LINENO "$i"
+ [ ! -e bar ] || test_failed $LINENO "$i"
+ cmp cbaz baz || test_failed $LINENO "$i"
rm -f foo bar baz || framework_failure
done
@@ -1288,7 +1352,7 @@ for i in "${inbad1}" "${inbad2}" ; do
"${TARLZ}" -q -n0 -xf "${i}.tar.lz" --keep-damaged
[ $? = 2 ] || test_failed $LINENO "$i"
[ -e test.txt ] || test_failed $LINENO "$i"
- cmp "$i" test.txt 2> /dev/null || test_failed $LINENO $i
+ cmp "$i" test.txt 2> /dev/null || test_failed $LINENO "$i"
rm -f test.txt || framework_failure
done
#