summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xtestsuite/check.sh39
-rw-r--r--testsuite/test3_em1.tar.lzbin0 -> 392 bytes
-rw-r--r--testsuite/test3_em2.tar.lzbin0 -> 392 bytes
-rw-r--r--testsuite/test3_em3.tar.lzbin0 -> 392 bytes
-rw-r--r--testsuite/test3_em4.tar.lzbin0 -> 392 bytes
-rw-r--r--testsuite/test3_em5.tar.lzbin0 -> 392 bytes
-rw-r--r--testsuite/test3_em6.tar.lzbin0 -> 500 bytes
-rw-r--r--testsuite/ts_in_link.tar.lzbin0 -> 509 bytes
8 files changed, 38 insertions, 1 deletions
diff --git a/testsuite/check.sh b/testsuite/check.sh
index f8b65c3..aea9fbf 100755
--- a/testsuite/check.sh
+++ b/testsuite/check.sh
@@ -68,6 +68,7 @@ lzlib_1_11() { [ ${lwarn} = 0 ] &&
# t155.tar[.lz]: directory + links + file + eof, all with 155 char names
# tar_in_tlz1.tar.lz 2 members (test.txt.tar test3.tar) 3 lzip members
# tar_in_tlz2.tar.lz 2 members (test.txt.tar test3.tar) 5 lzip members
+# ts_in_link.tar.lz: 4 symbolic links (link[1-4]) to / /dir/ dir/ dir(107/)
# test_bad1.tar.lz: truncated at offset 6000 (of 7495)
# test_bad2.tar.lz: byte at offset 6000 changed from 0x56 to 0x46
# test3.tar: 3 members (foo bar baz) + 2 zeroed 512-byte blocks
@@ -89,6 +90,8 @@ lzlib_1_11() { [ ${lwarn} = 0 ] &&
# test3_eof1.tar.lz: test3.tar.lz without eof blocks
# test3_eof2.tar.lz: test3.tar.lz with only one eof block
# test3_eof3.tar.lz: test3.tar.lz with one zeroed block between foo and bar
+# test3_em?.tar.lz: test3.tar.lz with one empty lzip member at each position
+# test3_em6.tar.lz: test3.tar.lz preceded by four empty lzip members
# tlz_in_tar1.tar: 1 member (test3.tar.lz) first magic damaged
# tlz_in_tar2.tar: 2 members (foo test3.tar.lz) first magic damaged
# ug32chars.tar.lz: 1 member (foo) with 32-character owner and group names
@@ -263,7 +266,8 @@ 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
for i in "${tarint1_lz}" "${tarint2_lz}" ; do
for j in 0 2 6 ; do
"${TARLZ}" -tf "$i" --threads=$j > out$j ||
@@ -284,6 +288,31 @@ for i in "${tarint1_lz}" "${tarint2_lz}" ; do
rm -f test.txt.tar test3.tar || framework_failure
done
+# test --list and --extract with empty lzip members
+for i in 1 2 3 4 5 6 ; do
+ for j in 0 2 6 ; do
+ "${TARLZ}" -tf "${testdir}"/test3_em${i}.tar.lz --threads=$j \
+ > out$j || test_failed $LINENO "$i $j"
+ "${TARLZ}" -tvf "${testdir}"/test3_em${i}.tar.lz --threads=$j \
+ > outv$j || test_failed $LINENO "$i $j"
+ done
+ diff -u out0 out2 || test_failed $LINENO $i
+ diff -u out0 out6 || test_failed $LINENO $i
+ diff -u out2 out6 || test_failed $LINENO $i
+ diff -u outv0 outv2 || test_failed $LINENO $i
+ diff -u outv0 outv6 || test_failed $LINENO $i
+ diff -u outv2 outv6 || test_failed $LINENO $i
+ rm -f out0 out2 out6 outv0 outv2 outv6 || framework_failure
+ for j in 0 2 6 ; do
+ "${TARLZ}" -xf "${testdir}"/test3_em${i}.tar.lz --threads=$j ||
+ test_failed $LINENO "$i $j"
+ cmp cfoo foo || test_failed $LINENO "$i $j"
+ cmp cbar bar || test_failed $LINENO "$i $j"
+ cmp cbaz baz || test_failed $LINENO "$i $j"
+ rm -f foo bar baz || framework_failure
+ done
+done
+
# test --concatenate
cat "${in_tar_lz}" > out.tar.lz || framework_failure
"${TARLZ}" -Af out.tar.lz "${test3_lz}" || test_failed $LINENO
@@ -490,12 +519,16 @@ if ln dummy_file dummy_link 2> /dev/null &&
ln dir1/dir2/dir3/in dir1/dir2/dir3/"${name_100}" || framework_failure
ln dir1/dir2/dir3/in "${path_100}" || framework_failure
ln dir1/dir2/dir3/in "${path_106}" || framework_failure
+ ln -s dir2/ dir1/dir2_link || framework_failure
ln -s in dir1/dir2/dir3/link || framework_failure
ln -s "${name_100}" dir1/dir2/dir3/link_100 || framework_failure
"${TARLZ}" -0 -cf out.tar.lz dir1 || test_failed $LINENO
+ "${TARLZ}" -df out.tar.lz || test_failed $LINENO
rm -rf dir1 || framework_failure
"${TARLZ}" -xf out.tar.lz || test_failed $LINENO
+ "${TARLZ}" -df out.tar.lz || test_failed $LINENO
cmp "${in}" dir1/dir2/dir3/in || test_failed $LINENO
+ cmp "${in}" dir1/dir2_link/dir3/in || test_failed $LINENO
cmp "${in}" dir1/dir2/dir3/"${name_100}" || test_failed $LINENO
cmp "${in}" "${path_100}" || test_failed $LINENO
cmp "${in}" "${path_106}" || test_failed $LINENO
@@ -511,6 +544,10 @@ if ln dummy_file dummy_link 2> /dev/null &&
"${TARLZ}" -0 -q -c ../tmp/dir1 | "${TARLZ}" -x || test_failed $LINENO
diff -ru tmp/dir1 dir1 || test_failed $LINENO
rm -rf tmp/dir1 dir1 || framework_failure
+ "${TARLZ}" -xf "${testdir}"/ts_in_link.tar.lz || test_failed $LINENO
+ "${TARLZ}" -df "${testdir}"/ts_in_link.tar.lz --ignore-ids ||
+ test_failed $LINENO
+ rm -f link1 link2 link3 link4 || framework_failure
else
printf "\nwarning: skipping link test: 'ln' does not work on your system."
fi
diff --git a/testsuite/test3_em1.tar.lz b/testsuite/test3_em1.tar.lz
new file mode 100644
index 0000000..0aa8724
--- /dev/null
+++ b/testsuite/test3_em1.tar.lz
Binary files differ
diff --git a/testsuite/test3_em2.tar.lz b/testsuite/test3_em2.tar.lz
new file mode 100644
index 0000000..4fe4e5d
--- /dev/null
+++ b/testsuite/test3_em2.tar.lz
Binary files differ
diff --git a/testsuite/test3_em3.tar.lz b/testsuite/test3_em3.tar.lz
new file mode 100644
index 0000000..49e2eab
--- /dev/null
+++ b/testsuite/test3_em3.tar.lz
Binary files differ
diff --git a/testsuite/test3_em4.tar.lz b/testsuite/test3_em4.tar.lz
new file mode 100644
index 0000000..95df508
--- /dev/null
+++ b/testsuite/test3_em4.tar.lz
Binary files differ
diff --git a/testsuite/test3_em5.tar.lz b/testsuite/test3_em5.tar.lz
new file mode 100644
index 0000000..706beb5
--- /dev/null
+++ b/testsuite/test3_em5.tar.lz
Binary files differ
diff --git a/testsuite/test3_em6.tar.lz b/testsuite/test3_em6.tar.lz
new file mode 100644
index 0000000..806884d
--- /dev/null
+++ b/testsuite/test3_em6.tar.lz
Binary files differ
diff --git a/testsuite/ts_in_link.tar.lz b/testsuite/ts_in_link.tar.lz
new file mode 100644
index 0000000..dff816c
--- /dev/null
+++ b/testsuite/ts_in_link.tar.lz
Binary files differ