From: Ross Burton <[email protected]>

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.

Signed-off-by: Ross Burton <[email protected]>
---
 testsuite/start-stop-daemon.tests | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/testsuite/start-stop-daemon.tests 
b/testsuite/start-stop-daemon.tests
index 0757b1288..a699c3ca1 100755
--- a/testsuite/start-stop-daemon.tests
+++ b/testsuite/start-stop-daemon.tests
@@ -26,11 +26,20 @@ testing "start-stop-daemon without -x and -a" \
 # Unfortunately, this does not actually check argv[0] correctness,
 # 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"
+# Note that if /bin/false is busybox the expected output needs to
+# be different, as busybox looks at argv[0] and says
+# "qwerty: applet not found".
+case $(readlink /bin/false) in
+       *busybox*)
+               EXPECTED="qwerty: applet not found\n127\n"
+               ;;
+       *)
+               EXPECTED="1\n"
+               ;;
+esac
+
 testing "start-stop-daemon with both -x and -a" \
        'start-stop-daemon -S -x /bin/false -a qwerty false 2>&1; echo $?' \
-       "1\n" \
-       "" ""
+       "$EXPECTED"     "" ""
 
 exit $FAILCOUNT
-- 
2.34.1

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to