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 ]

Signed-off-by: Ross Burton <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
Signed-off-by: Richard Purdie <[email protected]>
(cherry picked from commit 37482e404cf4dcf9360c29986ced8db78baf249b)
Signed-off-by: Steve Sakoman <[email protected]>
---
 meta/recipes-core/busybox/busybox.inc         |  2 +-
 .../busybox/busybox/start-stop-false.patch    | 35 +++++++++++++++++++
 meta/recipes-core/busybox/busybox_1.36.1.bb   |  1 +
 3 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/busybox/busybox/start-stop-false.patch

diff --git a/meta/recipes-core/busybox/busybox.inc 
b/meta/recipes-core/busybox/busybox.inc
index 582d87949e..f5d7c3f9c8 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -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):
diff --git a/meta/recipes-core/busybox/busybox/start-stop-false.patch 
b/meta/recipes-core/busybox/busybox/start-stop-false.patch
new file mode 100644
index 0000000000..3aef68329c
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/start-stop-false.patch
@@ -0,0 +1,35 @@
+It's known that the final start-stop-daemon test fails if /bin/false is
+actually a busybox symlink.  Instead of failing, check if false is
+busybox and adapt the expected output to match.
+
+Upstream-Status: Submitted 
[http://lists.busybox.net/pipermail/busybox/2023-August/090416.html]
+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
diff --git a/meta/recipes-core/busybox/busybox_1.36.1.bb 
b/meta/recipes-core/busybox/busybox_1.36.1.bb
index 968dce65e4..06eb9eb999 100644
--- a/meta/recipes-core/busybox/busybox_1.36.1.bb
+++ b/meta/recipes-core/busybox/busybox_1.36.1.bb
@@ -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
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#188937): 
https://lists.openembedded.org/g/openembedded-core/message/188937
Mute This Topic: https://lists.openembedded.org/mt/101887354/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to