Fixes for busybox ptest
cover Fixes for busybox ptest
The following changes since commit be1c84a91eb3ddddbef5cb7d4f74ffbb0ffe5778:
poky.conf: Update the distros we test against on the autobuilder (2018-11-14 11:18:18 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib ChenQi/busybox-ptest
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/busybox-ptest
Chen Qi (8):
busybox: enable bzip2 by default
busybox: skip known bugs in ptest
busybox: add zip to RDEPENDS of ptest package
busybox: check uudecode before using it in test case
busybox: use example.org instead of google.com in wget test case
busybox: remove three hostname test cases
busybox: fix du-l-works test case
busybox: add coreutils to RDEPENDS of busybox-ptest
meta/recipes-core/busybox/busybox.inc | 12 +++++ ...-du-l-works-fix-to-use-145-instead-of-144.patch | 32 +++++++++++ ...-testsuite-check-uudecode-before-using-it.patch | 45 ++++++++++++++++ ...e-use-www.example.org-for-wget-test-cases.patch | 62 ++++++++++++++++++++++ meta/recipes-core/busybox/busybox/defconfig | 2 +- meta/recipes-core/busybox/busybox_1.29.2.bb | 3 ++ meta/recipes-core/busybox/files/run-ptest | 1 + 7 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-core/busybox/busybox/0001-du-l-works-fix-to-use-145-instead-of-144.patch create mode 100644 meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch create mode 100644 meta/recipes-core/busybox/busybox/0001-testsuite-use-www.example.org-for-wget-test-cases.patch
Signature · 1 line
1.9.1
PATCH 1/8 busybox: enable bzip2 by default
bunzip2 is enabled by default, but bzip2 is not. This is kind of strange, and it also causes busybox's ptest failure regarding bunzip2, as bunzip2's test case needs bzip2 command.
--- meta/recipes-core/busybox/busybox/defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/busybox/busybox/defconfig +1 -1
@@ -150,7 +150,7 @@ CONFIG_LZCAT=y # CONFIG_UNXZ is not set CONFIG_XZCAT=y # CONFIG_XZ is not set -# CONFIG_BZIP2 is not set +CONFIG_BZIP2=y CONFIG_FEATURE_BZIP2_DECOMPRESS=y CONFIG_CPIO=y # CONFIG_FEATURE_CPIO_O is not set
Signature · 1 line
1.9.1
PATCH 3/8 busybox: add zip to RDEPENDS of ptest package
In reply to Chen Qibusybox's unzip test case requires zip command. However, busybox itself does not provide one. So add zip as a runtime dependency.
--- meta/recipes-core/busybox/busybox.inc | 3 +++ 1 file changed, 3 insertions(+)
meta/recipes-core/busybox/busybox.inc +3 -0
@@ -53,6 +53,9 @@ RDEPENDS_${PN} = "${@["", "busybox-inittab"][(d.getVar('VIRTUAL-RUNTIME_init_man inherit cml1 systemd update-rc.d ptest +# busybox's unzip test case needs zip command, which busybox itself does not provide +RDEPENDS_${PN}-ptest = "zip" + # internal helper def busybox_cfg(feature, tokens, cnf, rem): if type(tokens) == type(""):
Signature · 1 line
1.9.1
PATCH 4/8 busybox: check uudecode before using it in test case
In reply to Chen QiCheck uudecode before using it in test case to avoid unexpected failure.
--- ...-testsuite-check-uudecode-before-using-it.patch | 45 ++++++++++++++++++++++ meta/recipes-core/busybox/busybox_1.29.2.bb | 1 + 2 files changed, 46 insertions(+) create mode 100644 meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch
meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch new file +45 -0
@@ -0,0 +1,45 @@ +From 85f164ec427fecbae24140b3c93acbbe2ba1c817 Mon Sep 17 00:00:00 2001 +From: Chen Qi <[email protected]> +Date: Tue, 13 Nov 2018 11:27:01 +0800 +Subject: [PATCH] testsuite: check uudecode before using it + +The unzip and tar test cases use uudecode command, so also +check it via optional function. + +Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2018-November/086833.html] + +Signed-off-by: Chen Qi <[email protected]> +--- + testsuite/tar.tests | 2 +- + testsuite/unzip.tests | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/testsuite/tar.tests b/testsuite/tar.tests +index d71a349..8c88567 100755 +--- a/testsuite/tar.tests ++++ b/testsuite/tar.tests +@@ -336,7 +336,7 @@ SKIP= + cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null + + mkdir tar.tempdir && cd tar.tempdir || exit 1 +-optional FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT LS ++optional FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT LS UUDECODE + testing "Symlink attack: create symlink and then write through it" '\ + exec 2>&1 + uudecode -o input && tar xvf input; echo $? +diff --git a/testsuite/unzip.tests b/testsuite/unzip.tests +index af53de9..3b45ece 100755 +--- a/testsuite/unzip.tests ++++ b/testsuite/unzip.tests +@@ -31,7 +31,7 @@ rmdir foo + rm foo.zip + + # File containing some damaged encrypted stream +-optional FEATURE_UNZIP_CDF ++optional FEATURE_UNZIP_CDF UUDECODE + testing "unzip (bad archive)" "uudecode; unzip bad.zip 2>&1; echo \$?" \ + "Archive: bad.zip + inflating: ]3j½r«IK-%Ix +-- +2.7.4 +
meta/recipes-core/busybox/busybox_1.29.2.bb +1 -0
@@ -41,6 +41,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ file://rcS \ file://rcK \ file://makefile-libbb-race.patch \ + file://0001-testsuite-check-uudecode-before-using-it.patch \ " SRC_URI_append_libc-musl = " file://musl.cfg "
Signature · 1 line
1.9.1
PATCH 2/8 busybox: skip known bugs in ptest
In reply to Chen QiSet SKIP_KNOWN_BUGS in run-ptest script to skip ptest cases which are known to relate to some known bugs.
--- meta/recipes-core/busybox/files/run-ptest | 1 + 1 file changed, 1 insertion(+)
meta/recipes-core/busybox/files/run-ptest +1 -0
@@ -2,6 +2,7 @@ current_dir=$(readlink -f $0) export bindir=$(dirname $current_dir) +export SKIP_KNOWN_BUGS=1 cd testsuite || exit 1 ./runtest -v | sed -r 's/^(SKIPPED|UNTESTED):/SKIP:/'
Signature · 1 line
1.9.1
PATCH 6/8 busybox: remove three hostname test cases
In reply to Chen QiThese three test case are removed because of two reasons.
1) net-tools' hostname have different behaviour regarding some options So when net-tools is installed, test cases may fail. e.g.
test x$(hostname -i) = x$(busybox hostname -i)
2) hostname may set to some value, e.g. qemux86-64, which is not an entry in /etc/hosts This results in lookup failure when using `hostname -f' as there's no entry in /etc/hosts.
--- meta/recipes-core/busybox/busybox.inc | 6 ++++++ 1 file changed, 6 insertions(+)
meta/recipes-core/busybox/busybox.inc +6 -0
@@ -352,6 +352,12 @@ do_install_ptest () { cp -r ${B}/testsuite ${D}${PTEST_PATH}/ cp ${B}/.config ${D}${PTEST_PATH}/ ln -s /bin/busybox ${D}${PTEST_PATH}/busybox + # Remove some hostname test cases as they may fail because of two reasons + # 1) net-tools' hostname have different behaviour regarding some options + # 2) hostname may set to some value, e.g. qemux86-64, which is not an entry in /etc/hosts + rm ${D}${PTEST_PATH}/testsuite/hostname/hostname-i-works + rm ${D}${PTEST_PATH}/testsuite/hostname/hostname-d-works + rm ${D}${PTEST_PATH}/testsuite/hostname/hostname-s-works } inherit update-alternatives
Signature · 1 line
1.9.1
PATCH 7/8 busybox: fix du-l-works test case
In reply to Chen Qi64 + 64 + 16 = 144K
144 + sizeof_a_directory >= 145
So fix to use 145 instead of 144.
--- ...-du-l-works-fix-to-use-145-instead-of-144.patch | 32 ++++++++++++++++++++++ meta/recipes-core/busybox/busybox_1.29.2.bb | 1 + 2 files changed, 33 insertions(+) create mode 100644 meta/recipes-core/busybox/busybox/0001-du-l-works-fix-to-use-145-instead-of-144.patch
meta/recipes-core/busybox/busybox/0001-du-l-works-fix-to-use-145-instead-of-144.patch new file +32 -0
@@ -0,0 +1,32 @@ +From c69feb2fdb755d6db34d0eb0a9e9994386c15e3a Mon Sep 17 00:00:00 2001 +From: Chen Qi <[email protected]> +Date: Wed, 14 Nov 2018 15:19:57 +0800 +Subject: [PATCH] du-l-works: fix to use 145 instead of 144 + +64 + 64 + 16 = 144 +144 + size_of_directory >= 145 +So fix to use 145 instead of 144. + +Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2018-November/086836.html] + +Signed-off-by: Chen Qi <[email protected]> +--- + testsuite/du/du-l-works | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/testsuite/du/du-l-works b/testsuite/du/du-l-works +index af87345..575064a 100644 +--- a/testsuite/du/du-l-works ++++ b/testsuite/du/du-l-works +@@ -5,7 +5,7 @@ cd du.testdir + dd if=/dev/zero of=file1 bs=1k count=64 2>/dev/null + ln file1 file1.1 + dd if=/dev/zero of=file2 bs=1k count=16 2>/dev/null +-test x"`busybox du -l .`" = x"144 ." \ ++test x"`busybox du -l .`" = x"145 ." \ + -o x"`busybox du -l .`" = x"146 ." \ + -o x"`busybox du -l .`" = x"148 ." \ + -o x"`busybox du -l .`" = x"152 ." \ +-- +2.7.4 +
meta/recipes-core/busybox/busybox_1.29.2.bb +1 -0
@@ -43,6 +43,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ file://makefile-libbb-race.patch \ file://0001-testsuite-check-uudecode-before-using-it.patch \ file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \ + file://0001-du-l-works-fix-to-use-145-instead-of-144.patch \ " SRC_URI_append_libc-musl = " file://musl.cfg "
Signature · 1 line
1.9.1
PATCH 5/8 busybox: use example.org instead of google.com in wget test case
In reply to Chen QiUse example.org to ensure it's always reachible.
--- ...e-use-www.example.org-for-wget-test-cases.patch | 62 ++++++++++++++++++++++ meta/recipes-core/busybox/busybox_1.29.2.bb | 1 + 2 files changed, 63 insertions(+) create mode 100644 meta/recipes-core/busybox/busybox/0001-testsuite-use-www.example.org-for-wget-test-cases.patch
meta/recipes-core/busybox/busybox/0001-testsuite-use-www.example.org-for-wget-test-cases.patch new file +62 -0
@@ -0,0 +1,62 @@ +From 03acf460990dfcf6e52b298301b348b9504460a8 Mon Sep 17 00:00:00 2001 +From: Chen Qi <[email protected]> +Date: Tue, 13 Nov 2018 13:51:42 +0800 +Subject: [PATCH] testsuite: use www.example.org for wget test cases + +Use example.org instead of google.com to make sure it's +always reachible. + +Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2018-November/086835.html] + +Signed-off-by: Chen Qi <[email protected]> +--- + testsuite/wget/wget--O-overrides--P | 2 +- + testsuite/wget/wget-handles-empty-path | 2 +- + testsuite/wget/wget-retrieves-google-index | 2 +- + testsuite/wget/wget-supports--P | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/testsuite/wget/wget--O-overrides--P b/testsuite/wget/wget--O-overrides--P +index 40a3a96..490d743 100644 +--- a/testsuite/wget/wget--O-overrides--P ++++ b/testsuite/wget/wget--O-overrides--P +@@ -1,5 +1,5 @@ + test x"$SKIP_INTERNET_TESTS" != x"" && exit + + mkdir foo +-busybox wget -q -O index.html -P foo http://www.google.com/ ++busybox wget -q -O index.html -P foo http://www.example.org/ + test -s index.html +diff --git a/testsuite/wget/wget-handles-empty-path b/testsuite/wget/wget-handles-empty-path +index 01d60bd..1802db6 100644 +--- a/testsuite/wget/wget-handles-empty-path ++++ b/testsuite/wget/wget-handles-empty-path +@@ -1,3 +1,3 @@ + test x"$SKIP_INTERNET_TESTS" != x"" && exit + +-busybox wget http://www.google.com ++busybox wget http://www.example.org +diff --git a/testsuite/wget/wget-retrieves-google-index b/testsuite/wget/wget-retrieves-google-index +index f9dbb8b..fc801d4 100644 +--- a/testsuite/wget/wget-retrieves-google-index ++++ b/testsuite/wget/wget-retrieves-google-index +@@ -1,4 +1,4 @@ + test x"$SKIP_INTERNET_TESTS" != x"" && exit + +-busybox wget -q -O foo http://www.google.com/ ++busybox wget -q -O foo http://www.example.org/ + test -s foo +diff --git a/testsuite/wget/wget-supports--P b/testsuite/wget/wget-supports--P +index bfe4ac4..4ff2fe0 100644 +--- a/testsuite/wget/wget-supports--P ++++ b/testsuite/wget/wget-supports--P +@@ -1,5 +1,5 @@ + test x"$SKIP_INTERNET_TESTS" != x"" && exit + + mkdir foo +-busybox wget -q -P foo http://www.google.com/ ++busybox wget -q -P foo http://www.example.org/ + test -s foo/index.html +-- +2.7.4 +
meta/recipes-core/busybox/busybox_1.29.2.bb +1 -0
@@ -42,6 +42,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ file://rcK \ file://makefile-libbb-race.patch \ file://0001-testsuite-check-uudecode-before-using-it.patch \ + file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \ " SRC_URI_append_libc-musl = " file://musl.cfg "
Signature · 1 line
1.9.1
PATCH 8/8 busybox: add coreutils to RDEPENDS of busybox-ptest
In reply to Chen Qibusybox's echo test cases needs 'od' command to have '-t' option support. However, our busybox disable it by default by not setting CONFIG_DESKTOP. CONFIG_DESKTOP affects many busybox utilities. So add coreutils to RDEPENDS of busybox-ptest.
--- meta/recipes-core/busybox/busybox.inc | 3 +++ 1 file changed, 3 insertions(+)
meta/recipes-core/busybox/busybox.inc +3 -0
@@ -55,6 +55,9 @@ inherit cml1 systemd update-rc.d ptest # busybox's unzip test case needs zip command, which busybox itself does not provide RDEPENDS_${PN}-ptest = "zip" +# busybox's echo test cases need '-t' option support for the 'od' command, so add coreutils +# as we do not want to enable CONFIG_DESKTOP by default for busybox +RDEPENDS_${PN}-ptest += "coreutils" # internal helper def busybox_cfg(feature, tokens, cnf, rem):
Signature · 1 line
1.9.1
Re: [PATCH 8/8] busybox: add coreutils to RDEPENDS of busybox-ptest
Quoted 9 lines · Chen Qi
busybox's echo test cases needs 'od' command to have '-t' option support. However, our busybox disable it by default by not setting
CONFIG_DESKTOP.CONFIG_DESKTOPaffects many busybox utilities. So add coreutils to RDEPENDS of busybox-ptest.Signed-off-by Chen Qi <[email protected]>--- meta/recipes-core/busybox/busybox.inc | 3 +++ 1 file changed, 3 insertions(+)
This means any build of busybox will now also build coreutils which isn't really desirable.
If there any way to just enable the -t option to od without all the other changes? Has this been mentioned to upstream busybox?
Cheers,
Richard
Re: [PATCH 8/8] busybox: add coreutils to RDEPENDS of busybox-ptest
Quoted 13 lines · Richard Purdie
Quoted 9 lines · Chen Qi
busybox's echo test cases needs 'od' command to have '-t' option support. However, our busybox disable it by default by not setting
CONFIG_DESKTOP.CONFIG_DESKTOPaffects many busybox utilities. So add coreutils to RDEPENDS of busybox-ptest.Signed-off-by Chen Qi <[email protected]>--- meta/recipes-core/busybox/busybox.inc | 3 +++ 1 file changed, 3 insertions(+)This means any build of busybox will now also build coreutils which isn't really desirable.
Quoted 8 lines
If there any way to just enable the -t option to od without all the other changes? Has this been mentioned to upstream busybox?
Cheers,
Richard
The current busybox codes are:
[snip]
#include "libbb.h"
#if ENABLE_DESKTOP
/* This one provides -t (busybox's own build script needs it) */ #include "od_bloaty.c"
#else
[snip]
So there's currently no way to just enable '-t' for 'od' without affecting other utilities. I'll check with busybox upstream to see why they do so and if we could do some change.
Best Regards,
Chen Qi
Re: [PATCH 5/8] busybox: use example.org instead of google.com in wget test case
In reply to Chen QiQuoted 1 line · Chen Qi
Use example.org to ensure it's always reachible.
Is this because of China's firewall? You'd think that google.com would have excellent uptime.
Ross
Re: [PATCH 1/8] busybox: enable bzip2 by default
In reply to Chen QiQuoted 15 lines · Chen Qi
bunzip2 is enabled by default, but bzip2 is not. This is kind of strange, and it also causes busybox's ptest failure regarding bunzip2, as bunzip2's test case needs bzip2 command.
Signed-off-by Chen Qi <[email protected]>--- meta/recipes-core/busybox/busybox/defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/recipes-core/busybox/busybox/defconfig +0
-0
meta/recipes-core/busybox/busybox/defconfig CONFIG_LZCAT=y · line 156
Quoted 8 lines
meta/recipes-core/busybox/busybox/defconfig +1
-1@@ -150,7 +150,7 @@ CONFIG_LZCAT=y # CONFIG_UNXZ is not set CONFIG_XZCAT=y # CONFIG_XZ is not set -# CONFIG_BZIP2 is not set +CONFIG_BZIP2=y CONFIG_FEATURE_BZIP2_DECOMPRESS=y CONFIG_CPIO=y # CONFIG_FEATURE_CPIO_O is not set
Fails on the autobuilder:
https://autobuilder.yoctoproject.org/typhoon/#/builders/21/builds/219/steps/7/logs/step1b
Cheers,
Richard
Re: [PATCH 5/8] busybox: use example.org instead of google.com in wget test case
In reply to Burton, RossQuoted 7 lines · Ross
Quoted 1 line · Chen Qi
Use example.org to ensure it's always reachible.
Is this because of China's firewall? You'd think that google.com would have excellent uptime.
Ross
I guess so.
I agree that google.com has excellent uptime. However, I think example.org might be better for ptest.
Best Regards,
Chen Qi
Re: [PATCH 5/8] busybox: use example.org instead of google.com in wget test case
My point is, if there's a better host then lets send this upstream.
Ross
Quoted 16 lines · ChenQi
Quoted 7 lines · Ross
Quoted 1 line · Chen Qi
Use example.org to ensure it's always reachible.
Is this because of China's firewall? You'd think that google.com would have excellent uptime.
Ross
I guess so.
I agree that google.com has excellent uptime. However, I think example.org might be better for ptest.Best Regards,
Chen Qi
Re: [PATCH 5/8] busybox: use example.org instead of google.com in wget test case
Ignore me, you did :)
Quoted 21 lines · Ross
My point is, if there's a better host then lets send this upstream.
Ross
Quoted 16 lines · ChenQi
Quoted 7 lines · Ross
Quoted 1 line · Chen Qi
Use example.org to ensure it's always reachible.
Is this because of China's firewall? You'd think that google.com would have excellent uptime.
Ross
I guess so.
I agree that google.com has excellent uptime. However, I think example.org might be better for ptest.Best Regards,
Chen Qi