diff options
author | Simon McVittie <smcv@debian.org> | 2016-07-20 12:07:03 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2016-08-12 18:21:36 +0100 |
commit | 1679f58a140399ca9e2ebfdf0431d5e843d6f70e (patch) | |
tree | 07eb3a355c6d23599bc9fa9146242f3617611187 /test | |
parent | a7caca9f47b6a0203eea5a2a2f825b283b66488e (diff) | |
download | dbus-1679f58a140399ca9e2ebfdf0431d5e843d6f70e.tar.gz |
test: expand dbus-launch-eval test to cover stdin being closed
Signed-off-by: Simon McVittie <smcv@debian.org>
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-dbus-launch-eval.sh | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/test/test-dbus-launch-eval.sh b/test/test-dbus-launch-eval.sh index 7b464bf6..289c548b 100755 --- a/test/test-dbus-launch-eval.sh +++ b/test/test-dbus-launch-eval.sh @@ -42,7 +42,7 @@ else config="--sh-syntax" fi -echo "1..1" +echo "1..3" unset DBUS_SESSION_BUS_ADDRESS unset DBUS_SESSION_BUS_PID @@ -62,3 +62,42 @@ ${DBUS_TEST_DBUS_SEND} --session --dest=org.freedesktop.DBus \ kill "$DBUS_SESSION_BUS_PID" echo "ok 1 - normal dbus-launch" + +unset DBUS_SESSION_BUS_ADDRESS +unset DBUS_SESSION_BUS_PID + +eval "$(${DBUS_TEST_DBUS_LAUNCH} --sh-syntax "$config" <&-)" + +test -n "$DBUS_SESSION_BUS_ADDRESS" +env | grep '^DBUS_SESSION_BUS_ADDRESS=' + +test -n "$DBUS_SESSION_BUS_PID" +test "x$(env | grep '^DBUS_SESSION_BUS_PID=')" = "x" +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-launch with stdin closed" + +unset DBUS_SESSION_BUS_ADDRESS +unset DBUS_SESSION_BUS_PID + +# we can't close stdout because that breaks --sh-syntax +eval "$(${DBUS_TEST_DBUS_LAUNCH} --sh-syntax "$config" <&- 2>&-)" + +test -n "$DBUS_SESSION_BUS_ADDRESS" +env | grep '^DBUS_SESSION_BUS_ADDRESS=' + +test -n "$DBUS_SESSION_BUS_PID" +test "x$(env | grep '^DBUS_SESSION_BUS_PID=')" = "x" +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-launch with stdin and stderr closed" |