diff options
Diffstat (limited to 'testsuite/check.sh')
-rwxr-xr-x | testsuite/check.sh | 39 |
1 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 |