summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/test-bus-kernel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-28 15:59:05 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-28 16:17:33 +0100
commit3acc1dafd14420872f7f13319260eeb5d62c2533 (patch)
tree376044a15fe091db6e6b712a462b7dfe2c91c582 /src/libsystemd/sd-bus/test-bus-kernel.c
parent52cfc0379a9d63f99cdb3d9f63c839bbc8889b4c (diff)
sd-bus: add new call sd_bus_get_scope() for querying whether one is connected to a system or a user bus
Diffstat (limited to 'src/libsystemd/sd-bus/test-bus-kernel.c')
-rw-r--r--src/libsystemd/sd-bus/test-bus-kernel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/test-bus-kernel.c b/src/libsystemd/sd-bus/test-bus-kernel.c
index 485c396bdb..3aec568229 100644
--- a/src/libsystemd/sd-bus/test-bus-kernel.c
+++ b/src/libsystemd/sd-bus/test-bus-kernel.c
@@ -33,7 +33,7 @@
int main(int argc, char *argv[]) {
_cleanup_close_ int bus_ref = -1;
- _cleanup_free_ char *name = NULL, *bus_name = NULL, *address = NULL;
+ _cleanup_free_ char *name = NULL, *bus_name = NULL, *address = NULL, *bname = NULL;
_cleanup_bus_message_unref_ sd_bus_message *m = NULL;
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
const char *ua = NULL, *ub = NULL, *the_string = NULL;
@@ -102,6 +102,9 @@ int main(int argc, char *argv[]) {
assert_se(r >= 0);
printf("name of b: %s\n", nn);
+ assert_se(bus_kernel_get_bus_name(b, &bname) >= 0);
+ assert_se(endswith(bname, name));
+
r = sd_bus_call_method(a, "this.doesnt.exist", "/foo", "meh.mah", "muh", &error, NULL, "s", "yayayay");
assert_se(sd_bus_error_has_name(&error, SD_BUS_ERROR_SERVICE_UNKNOWN));
assert_se(r == -EHOSTUNREACH);