Commit 6ce19c86 authored by Simon McVittie's avatar Simon McVittie Committed by Simon McVittie

test-dbus-daemon-fork: exercise closed stdin, stdout, stderr

Signed-off-by: 's avatarSimon McVittie <smcv@debian.org>
parent 1679f58a
......@@ -45,7 +45,7 @@ if ! workdir="$(mktemp -d)"; then
exit 0
fi
echo "1..1"
echo "1..3"
unset DBUS_SESSION_BUS_ADDRESS
unset DBUS_SESSION_BUS_PID
......@@ -66,4 +66,42 @@ kill "$DBUS_SESSION_BUS_PID"
echo "ok 1 - normal dbus-daemon"
unset DBUS_SESSION_BUS_ADDRESS
unset DBUS_SESSION_BUS_PID
rm -f "$workdir"/address "$workdir"/pid
${DBUS_TEST_DAEMON} --fork --print-address=8 --print-pid=9 "$config" \
8>"$workdir/address" 9>"$workdir/pid" <&-
export DBUS_SESSION_BUS_ADDRESS="$(cat "$workdir"/address)"
test -n "$DBUS_SESSION_BUS_ADDRESS"
DBUS_SESSION_BUS_PID="$(cat "$workdir"/pid)"
kill -0 "$DBUS_SESSION_BUS_PID"
${DBUS_TEST_DBUS_SEND} --session --dest=org.freedesktop.DBus \
--type=method_call --print-reply / org.freedesktop.DBus.ListNames >&2
kill "$DBUS_SESSION_BUS_PID"
echo "ok 2 - dbus-daemon with stdin closed"
unset DBUS_SESSION_BUS_ADDRESS
unset DBUS_SESSION_BUS_PID
rm -f "$workdir"/address "$workdir"/pid
${DBUS_TEST_DAEMON} --fork --print-address=8 --print-pid=9 "$config" \
8>"$workdir/address" 9>"$workdir/pid" <&- >&- 2>&-
export DBUS_SESSION_BUS_ADDRESS="$(cat "$workdir"/address)"
test -n "$DBUS_SESSION_BUS_ADDRESS"
DBUS_SESSION_BUS_PID="$(cat "$workdir"/pid)"
kill -0 "$DBUS_SESSION_BUS_PID"
${DBUS_TEST_DBUS_SEND} --session --dest=org.freedesktop.DBus \
--type=method_call --print-reply / org.freedesktop.DBus.ListNames >&2
kill "$DBUS_SESSION_BUS_PID"
echo "ok 3 - dbus-daemon with stdin, stdout, stderr closed"
rm -r "$workdir"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment