xref: /openbmc/openbmc/poky/meta/recipes-core/busybox/busybox/0003-start-stop-false.patch (revision 8460358c3d24c71d9d38fd126c745854a6301564)
1*8460358cSPatrick WilliamsIt's known that the final start-stop-daemon test fails if /bin/false is
2*8460358cSPatrick Williamsactually a busybox symlink.  Instead of failing, check if false is
3*8460358cSPatrick Williamsbusybox and adapt the expected output to match.
4*8460358cSPatrick Williams
5*8460358cSPatrick WilliamsUpstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2023-August/090416.html]
6*8460358cSPatrick WilliamsSigned-off-by: Ross Burton <ross.burton@arm.com>
7*8460358cSPatrick Williams
8*8460358cSPatrick Williamsdiff --git a/testsuite/start-stop-daemon.tests b/testsuite/start-stop-daemon.tests
9*8460358cSPatrick Williamsindex 0757b1288..aa6e9cc41 100755
10*8460358cSPatrick Williams--- a/testsuite/start-stop-daemon.tests
11*8460358cSPatrick Williams+++ b/testsuite/start-stop-daemon.tests
12*8460358cSPatrick Williams@@ -50,11 +50,18 @@ testing "start-stop-daemon without -x and -a" \
13*8460358cSPatrick Williams # but at least it checks that pathname to exec() is correct
14*8460358cSPatrick Williams #
15*8460358cSPatrick Williams # NB: this fails if /bin/false is a busybox symlink:
16*8460358cSPatrick Williams-# busybox looks at argv[0] and says "qwerty: applet not found"
17*8460358cSPatrick Williams-test ! -L /bin/false && \
18*8460358cSPatrick Williams-testing "start-stop-daemon with both -x and -a" \
19*8460358cSPatrick Williams-	'start-stop-daemon -S -x /bin/false -a qwerty false 2>&1; echo $?' \
20*8460358cSPatrick Williams-	"1\n" \
21*8460358cSPatrick Williams-	"" ""
22*8460358cSPatrick Williams+# busybox looks at argv[0] and says "qwerty: applet not found", so
23*8460358cSPatrick Williams+# skip the test if false is busybox.
24*8460358cSPatrick Williams+case $(readlink /bin/false) in
25*8460358cSPatrick Williams+	*busybox*)
26*8460358cSPatrick Williams+		echo "SKIPPED: start-stop-daemon with both -x and -a (need non-busybox false)"
27*8460358cSPatrick Williams+		;;
28*8460358cSPatrick Williams+	*)
29*8460358cSPatrick Williams+		testing "start-stop-daemon with both -x and -a" \
30*8460358cSPatrick Williams+			'start-stop-daemon -S -x /bin/false -a qwerty false 2>&1; echo $?' \
31*8460358cSPatrick Williams+			"1\n" \
32*8460358cSPatrick Williams+			"" ""
33*8460358cSPatrick Williams+		;;
34*8460358cSPatrick Williams+esac
35*8460358cSPatrick Williams
36*8460358cSPatrick Williams exit $FAILCOUNT
37