| 1 |
#!/bin/sh |
| 2 |
set -eu |
| 3 |
|
| 4 |
# Check that dbus-bin provides its intended command-line interface. |
| 5 |
# |
| 6 |
# We can't really *use* any of these without dbus-daemon, but we can |
| 7 |
# at least check that they are shipped in the package and can be run. |
| 8 |
|
| 9 |
export LC_ALL=C.UTF-8 |
| 10 |
fail= |
| 11 |
|
| 12 |
# dbus-bin.deb provides dbus-cleanup-sockets in PATH |
| 13 |
dbus-cleanup-sockets --help |
| 14 |
|
| 15 |
# dbus-bin.deb provides dbus-monitor in PATH |
| 16 |
dbus-monitor --help |
| 17 |
|
| 18 |
# dbus-bin.deb provides dbus-send in PATH |
| 19 |
dbus-cleanup-sockets --help |
| 20 |
output="$(dbus-send --help 2>&1 || :)" |
| 21 |
echo "$output" |
| 22 |
|
| 23 |
case "$output" in |
| 24 |
(Usage:\ dbus-send*) |
| 25 |
;; |
| 26 |
(*) |
| 27 |
echo "Unexpected output from dbus-send" >&2 |
| 28 |
fail=yes |
| 29 |
;; |
| 30 |
esac |
| 31 |
|
| 32 |
# dbus-bin.deb provides dbus-update-activation-environment in PATH |
| 33 |
output="$(dbus-update-activation-environment --help 2>&1 || :)" |
| 34 |
echo "$output" |
| 35 |
|
| 36 |
case "$output" in |
| 37 |
(*Options:*) |
| 38 |
;; |
| 39 |
(*) |
| 40 |
echo "Unexpected output from dbus-update-activation-environment" >&2 |
| 41 |
fail=yes |
| 42 |
;; |
| 43 |
esac |
| 44 |
|
| 45 |
# dbus-bin.deb provides dbus-uuidgen in PATH |
| 46 |
rm -f "$AUTOPKGTEST_TMP/uuid" |
| 47 |
dbus-uuidgen --ensure="$AUTOPKGTEST_TMP/uuid" |
| 48 |
uuid="$(cat "$AUTOPKGTEST_TMP/uuid")" |
| 49 |
echo "uuid: $uuid" |
| 50 |
set -x |
| 51 |
test -n "$uuid" || fail=yes |
| 52 |
# The UUID consists of 32 lower-case hex digits (and the file |
| 53 |
# also has a newline) |
| 54 |
test "$uuid" = "$(perl -pe 'print "wrong: " unless /\A[a-z0-9]{32}\n\z/' "$AUTOPKGTEST_TMP/uuid")" || fail=yes |
| 55 |
test "$uuid" = "$(dbus-uuidgen --get="$AUTOPKGTEST_TMP/uuid")" || fail=yes |
| 56 |
test "" = "$(dbus-uuidgen --ensure="$AUTOPKGTEST_TMP/uuid")" || fail=yes |
| 57 |
test "$uuid" = "$(cat "$AUTOPKGTEST_TMP/uuid")" || fail=yes |
| 58 |
set +x |
| 59 |
|
| 60 |
test -z "$fail" |
| 61 |
|
| 62 |
# vim:set sw=4 sts=4 et: |