diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-08-16 00:48:50 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-08-16 00:48:50 +0200 |
commit | 8d718686f7dc5ce765544dcb8c7d2d5bc40b9d01 (patch) | |
tree | b5476d234a2fd8325d608a34a81067a923ad2bb3 | |
parent | 1ce60699c15e5fc2ecff5db40ea1e1ae583b8b34 (diff) | |
download | busybox-w32-8d718686f7dc5ce765544dcb8c7d2d5bc40b9d01.tar.gz busybox-w32-8d718686f7dc5ce765544dcb8c7d2d5bc40b9d01.tar.bz2 busybox-w32-8d718686f7dc5ce765544dcb8c7d2d5bc40b9d01.zip |
tar: fix testsuite
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-x | testsuite/tar.tests | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/testsuite/tar.tests b/testsuite/tar.tests index d71a34910..0f2e89112 100755 --- a/testsuite/tar.tests +++ b/testsuite/tar.tests | |||
@@ -3,6 +3,7 @@ | |||
3 | # Licensed under GPLv2, see file LICENSE in this source tree. | 3 | # Licensed under GPLv2, see file LICENSE in this source tree. |
4 | 4 | ||
5 | . ./testing.sh | 5 | . ./testing.sh |
6 | test -f "$bindir/.config" && . "$bindir/.config" | ||
6 | 7 | ||
7 | unset LANG | 8 | unset LANG |
8 | unset LANGUAGE | 9 | unset LANGUAGE |
@@ -12,7 +13,7 @@ umask 022 | |||
12 | 13 | ||
13 | # testing "test name" "script" "expected result" "file input" "stdin" | 14 | # testing "test name" "script" "expected result" "file input" "stdin" |
14 | 15 | ||
15 | testing "Empty file is not a tarball" '\ | 16 | testing "tar Empty file is not a tarball" '\ |
16 | tar xvf - 2>&1; echo $? | 17 | tar xvf - 2>&1; echo $? |
17 | ' "\ | 18 | ' "\ |
18 | tar: short read | 19 | tar: short read |
@@ -25,7 +26,7 @@ optional FEATURE_SEAMLESS_GZ GUNZIP | |||
25 | # In NOMMU case, "invalid magic" message comes from gunzip child process. | 26 | # In NOMMU case, "invalid magic" message comes from gunzip child process. |
26 | # Otherwise, it comes from tar. | 27 | # Otherwise, it comes from tar. |
27 | # Need to fix output up to avoid false positive. | 28 | # Need to fix output up to avoid false positive. |
28 | testing "Empty file is not a tarball.tar.gz" '\ | 29 | testing "tar Empty file is not a tarball.tar.gz" '\ |
29 | { tar xvzf - 2>&1; echo $?; } | grep -Fv "invalid magic" | 30 | { tar xvzf - 2>&1; echo $?; } | grep -Fv "invalid magic" |
30 | ' "\ | 31 | ' "\ |
31 | tar: short read | 32 | tar: short read |
@@ -34,7 +35,7 @@ tar: short read | |||
34 | "" "" | 35 | "" "" |
35 | SKIP= | 36 | SKIP= |
36 | 37 | ||
37 | testing "Two zeroed blocks is a ('truncated') empty tarball" '\ | 38 | testing "tar Two zeroed blocks is a ('truncated') empty tarball" '\ |
38 | dd if=/dev/zero bs=512 count=2 2>/dev/null | tar xvf - 2>&1; echo $? | 39 | dd if=/dev/zero bs=512 count=2 2>/dev/null | tar xvf - 2>&1; echo $? |
39 | ' "\ | 40 | ' "\ |
40 | 0 | 41 | 0 |
@@ -42,7 +43,7 @@ dd if=/dev/zero bs=512 count=2 2>/dev/null | tar xvf - 2>&1; echo $? | |||
42 | "" "" | 43 | "" "" |
43 | SKIP= | 44 | SKIP= |
44 | 45 | ||
45 | testing "Twenty zeroed blocks is an empty tarball" '\ | 46 | testing "tar Twenty zeroed blocks is an empty tarball" '\ |
46 | dd if=/dev/zero bs=512 count=20 2>/dev/null | tar xvf - 2>&1; echo $? | 47 | dd if=/dev/zero bs=512 count=20 2>/dev/null | tar xvf - 2>&1; echo $? |
47 | ' "\ | 48 | ' "\ |
48 | 0 | 49 | 0 |
@@ -313,9 +314,10 @@ l4/V8LDoe90yiWJhOJvIypgEfxdyRThQkBVn/bI= | |||
313 | SKIP= | 314 | SKIP= |
314 | cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null | 315 | cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null |
315 | 316 | ||
317 | if test x"$CONFIG_UNICODE_USING_LOCALE" != x"y"; then | ||
316 | mkdir tar.tempdir && cd tar.tempdir || exit 1 | 318 | mkdir tar.tempdir && cd tar.tempdir || exit 1 |
317 | optional UNICODE_SUPPORT FEATURE_TAR_GNU_EXTENSIONS FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT | 319 | optional UNICODE_SUPPORT FEATURE_TAR_GNU_EXTENSIONS FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT |
318 | testing "Pax-encoded UTF8 names and symlinks" '\ | 320 | testing "tar Pax-encoded UTF8 names and symlinks" '\ |
319 | tar xvf ../tar.utf8.tar.bz2 2>&1; echo $? | 321 | tar xvf ../tar.utf8.tar.bz2 2>&1; echo $? |
320 | export LANG=en_US.UTF-8 | 322 | export LANG=en_US.UTF-8 |
321 | ls -l etc/ssl/certs/* | sed "s:.*etc/:etc/:" | sort | 323 | ls -l etc/ssl/certs/* | sed "s:.*etc/:etc/:" | sort |
@@ -334,10 +336,11 @@ etc/ssl/certs/f80cc7f6.0 -> EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.pem | |||
334 | "" "" | 336 | "" "" |
335 | SKIP= | 337 | SKIP= |
336 | cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null | 338 | cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null |
339 | fi | ||
337 | 340 | ||
338 | mkdir tar.tempdir && cd tar.tempdir || exit 1 | 341 | mkdir tar.tempdir && cd tar.tempdir || exit 1 |
339 | optional FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT LS | 342 | optional FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT LS |
340 | testing "Symlink attack: create symlink and then write through it" '\ | 343 | testing "tar Symlink attack: create symlink and then write through it" '\ |
341 | exec 2>&1 | 344 | exec 2>&1 |
342 | uudecode -o input && tar xvf input; echo $? | 345 | uudecode -o input && tar xvf input; echo $? |
343 | ls /tmp/bb_test_evilfile | 346 | ls /tmp/bb_test_evilfile |
@@ -367,7 +370,7 @@ cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null | |||
367 | 370 | ||
368 | mkdir tar.tempdir && cd tar.tempdir || exit 1 | 371 | mkdir tar.tempdir && cd tar.tempdir || exit 1 |
369 | optional FEATURE_TAR_CREATE | 372 | optional FEATURE_TAR_CREATE |
370 | testing "Symlinks and hardlinks coexist" '\ | 373 | testing "tar Symlinks and hardlinks coexist" '\ |
371 | mkdir dir | 374 | mkdir dir |
372 | >dir/a | 375 | >dir/a |
373 | ln -s ../dir/a dir/b | 376 | ln -s ../dir/a dir/b |