[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: [PATCH] testsuite: handle /bin/false being busybox in the start-stop-daemon tests
From: ross.burton () arm ! com
Date: 2023-08-08 18:02:09
Message-ID: 20230808180209.2912321-1-ross.burton () arm ! com
[Download RAW message or body]
From: Ross Burton <ross.burton@arm.com>
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 <ross.burton@arm.com>
---
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
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic