Skip to contentSkip to conversation

busybox: remove coreutils dependency in busybox-ptest

PATCH Superseded [email protected] 2 participants 3 messages Sep 5, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 busybox: remove coreutils dependency in busybox-ptest

From: Ross Burton <[email protected]>

A dependency on coreutils was added to busybox-ptest in oe-core 658c5ed to fix a test failure.

The failure is because one of the start-stop-daemon tests is known to fail if /bin/false is busybox. Instead of failing, we can check if /bin/false is a symlink to busybox and skip the test if so.

[ YOCTO #15068 ]

---
 meta/recipes-core/busybox/busybox.inc         |  2 +-
 .../busybox/busybox/start-stop-false.patch    | 31 +++++++++++++++++++
 meta/recipes-core/busybox/busybox_1.36.1.bb   |  1 +
 3 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/busybox/busybox/start-stop-false.patch
meta/recipes-core/busybox/busybox.inc +1 -1
index 582d87949e9..f5d7c3f9c8f 100644
@@ -56,7 +56,7 @@ 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 coreutils"
+RDEPENDS:${PN}-ptest = "zip"
 
 # internal helper
 def busybox_cfg(feature, tokens, cnf, rem):
meta/recipes-core/busybox/busybox/start-stop-false.patch new file +31 -0
new file mode 100644
index 00000000000..c2955b9c06b
@@ -0,0 +1,31 @@
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <[email protected]>
+
+diff --git a/testsuite/start-stop-daemon.tests b/testsuite/start-stop-daemon.tests
+index 0757b1288..aa6e9cc41 100755
+--- a/testsuite/start-stop-daemon.tests
++++ b/testsuite/start-stop-daemon.tests
+@@ -27,10 +27,18 @@ testing "start-stop-daemon without -x and -a" \
+ # but at least it checks that pathname to exec() is correct
+ #
+ # NB: this fails if /bin/false is a busybox symlink:
+-# busybox looks at argv[0] and says "qwerty: applet not found"
+-testing "start-stop-daemon with both -x and -a" \
+-	'start-stop-daemon -S -x /bin/false -a qwerty false 2>&1; echo $?' \
+-	"1\n" \
+-	"" ""
++# busybox looks at argv[0] and says "qwerty: applet not found", so
++# skip the test if false is busybox.
++case $(readlink /bin/false) in
++    *busybox*)
++        echo "SKIPPED: start-stop-daemon with both -x and -a (need non-busybox false)"
++        ;;
++    *)
++		testing "start-stop-daemon with both -x and -a" \
++			'start-stop-daemon -S -x /bin/false -a qwerty false 2>&1; echo $?' \
++			"1\n" \
++			"" ""
++        ;;
++esac
+ 
+ exit $FAILCOUNT
meta/recipes-core/busybox/busybox_1.36.1.bb +1 -0
index 968dce65e45..06eb9eb9996 100644
@@ -49,6 +49,7 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://0001-sysctl-ignore-EIO-of-stable_secret-below-proc-sys-ne.patch \
            file://0001-libbb-sockaddr2str-ensure-only-printable-characters-.patch \
            file://0002-nslookup-sanitize-all-printed-strings-with-printable.patch \
+           file://start-stop-false.patch \
            "
 SRC_URI:append:libc-musl = " file://musl.cfg "
 # TODO http://lists.busybox.net/pipermail/busybox/2023-January/090078.html
Signature · 1 line
2.34.1
#1 lore raw

meta/recipes-core/busybox/busybox/start-stop-false.patch line 2

Quoted 4 lines · Ross Burton

+++ b/meta/recipes-core/busybox/busybox/start-stop-false.patch

meta/recipes-core/busybox/busybox/start-stop-false.patch new file +2 -0
@@ -0,0 +1,31 @@
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <[email protected]>

Please submit upstream at the same time.

Alex

#2 lore raw
Quoted 8 lines · Alexander Kanavin

meta/recipes-core/busybox/busybox/start-stop-false.patch line 2

Quoted 4 lines · Ross Burton

+++ b/meta/recipes-core/busybox/busybox/start-stop-false.patch

meta/recipes-core/busybox/busybox/start-stop-false.patch new file +2 -0
@@ -0,0 +1,31 @@
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <[email protected]>

Please submit upstream at the same time.

Forgot to update the status: http://lists.busybox.net/pipermail/busybox/2023-August/090416.html.

Ross