diff options
author | Ron Yorston <rmy@pobox.com> | 2021-08-17 08:26:36 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-08-17 08:26:36 +0100 |
commit | f13defb1c8f892ecf3e8dd5dbe486cc2b53e6f03 (patch) | |
tree | 15c9c174532e433e5632637c541d09e591c01d60 /testsuite | |
parent | 41f31584037be6b9d74a89245dff9ad8f0db146f (diff) | |
parent | 540aa116615713ad53e5ac98850993162e27c32d (diff) | |
download | busybox-w32-f13defb1c8f892ecf3e8dd5dbe486cc2b53e6f03.tar.gz busybox-w32-f13defb1c8f892ecf3e8dd5dbe486cc2b53e6f03.tar.bz2 busybox-w32-f13defb1c8f892ecf3e8dd5dbe486cc2b53e6f03.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/awk.tests | 2 | ||||
-rwxr-xr-x | testsuite/cut.tests | 2 | ||||
-rw-r--r-- | testsuite/dd/dd-count-bytes | 2 | ||||
-rwxr-xr-x | testsuite/tar.tests | 17 |
4 files changed, 15 insertions, 8 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index f53b1efe2..dc2ae2e11 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -410,7 +410,7 @@ testing "awk printf('%c') can output NUL" \ | |||
410 | "awk '{printf(\"hello%c null\n\", 0)}'" "hello\0 null\n" "" "\n" | 410 | "awk '{printf(\"hello%c null\n\", 0)}'" "hello\0 null\n" "" "\n" |
411 | SKIP= | 411 | SKIP= |
412 | 412 | ||
413 | optional FEATURE_AWK_GNU_EXTENSIONS | 413 | optional FEATURE_AWK_GNU_EXTENSIONS DESKTOP |
414 | testing "awk printf('%-10c') can output NUL" \ | 414 | testing "awk printf('%-10c') can output NUL" \ |
415 | "awk 'BEGIN { printf \"[%-10c]\n\", 0 }' | od -tx1" "\ | 415 | "awk 'BEGIN { printf \"[%-10c]\n\", 0 }' | od -tx1" "\ |
416 | 0000000 5b 00 20 20 20 20 20 20 20 20 20 5d 0a | 416 | 0000000 5b 00 20 20 20 20 20 20 20 20 20 5d 0a |
diff --git a/testsuite/cut.tests b/testsuite/cut.tests index d705b91c3..2458c019c 100755 --- a/testsuite/cut.tests +++ b/testsuite/cut.tests | |||
@@ -66,6 +66,7 @@ testing "cut with -d -f(a) -s" "cut -da -f3 -s input" "n\nsium:Jim\n\ncion:Ed\n" | |||
66 | testing "cut with -d -f(a) -s -n" "cut -da -f3 -s -n input" "n\nsium:Jim\n\ncion:Ed\n" "$input" "" | 66 | testing "cut with -d -f(a) -s -n" "cut -da -f3 -s -n input" "n\nsium:Jim\n\ncion:Ed\n" "$input" "" |
67 | 67 | ||
68 | # substitute for awk | 68 | # substitute for awk |
69 | optional FEATURE_CUT_REGEX | ||
69 | testing "cut -DF" "cut -DF 2,7,5" \ | 70 | testing "cut -DF" "cut -DF 2,7,5" \ |
70 | "said and your\nare\nis demand. supply\nforecast :\nyou you better,\n\nEm: Took hate\n" "" \ | 71 | "said and your\nare\nis demand. supply\nforecast :\nyou you better,\n\nEm: Took hate\n" "" \ |
71 | "Bother, said Pooh. It's your husband, and he has a gun. | 72 | "Bother, said Pooh. It's your husband, and he has a gun. |
@@ -75,6 +76,7 @@ Weather forecast for tonight : dark. | |||
75 | Apple: you can buy better, but you can't pay more. | 76 | Apple: you can buy better, but you can't pay more. |
76 | Subcalifragilisticexpialidocious. | 77 | Subcalifragilisticexpialidocious. |
77 | Auntie Em: Hate you, hate Kansas. Took the dog. Dorothy." | 78 | Auntie Em: Hate you, hate Kansas. Took the dog. Dorothy." |
79 | SKIP= | ||
78 | 80 | ||
79 | testing "cut empty field" "cut -d ':' -f 1-3" "a::b\n" "" "a::b\n" | 81 | testing "cut empty field" "cut -d ':' -f 1-3" "a::b\n" "" "a::b\n" |
80 | testing "cut empty field 2" "cut -d ':' -f 3-5" "b::c\n" "" "a::b::c:d\n" | 82 | testing "cut empty field 2" "cut -d ':' -f 3-5" "b::c\n" "" "a::b::c:d\n" |
diff --git a/testsuite/dd/dd-count-bytes b/testsuite/dd/dd-count-bytes index 0730cba5e..ae1b6c50a 100644 --- a/testsuite/dd/dd-count-bytes +++ b/testsuite/dd/dd-count-bytes | |||
@@ -1 +1,3 @@ | |||
1 | # FEATURE: CONFIG_FEATURE_DD_IBS_OBS | ||
2 | |||
1 | test "$(echo I WANT | busybox dd count=3 iflag=count_bytes 2>/dev/null)" = "I W" | 3 | test "$(echo I WANT | busybox dd count=3 iflag=count_bytes 2>/dev/null)" = "I W" |
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 |