From d8a3492fce59e9dd6e2e29e6ad58d99acbe78cbc Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 19 Feb 2018 14:36:42 +0000 Subject: [PATCH] Allow running gdbus-peer inside a container The /etc/machine-id inside a Docker container is allowed to be empty, so we need to check for that case. https://bugzilla.gnome.org/show_bug.cgi?id=793635 --- gio/tests/gdbus-peer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gio/tests/gdbus-peer.c b/gio/tests/gdbus-peer.c index be2d057b2..101c2a8bb 100644 --- a/gio/tests/gdbus-peer.c +++ b/gio/tests/gdbus-peer.c @@ -1683,7 +1683,10 @@ codegen_test_peer (void) g_assert_no_error (error); g_variant_get (value, "(&s)", &s); g_test_message ("Machine ID: %s", s); - g_assert (g_dbus_is_guid (s)); + /* It's valid for machine-id inside containers to be empty, so we + * need to test for that possibility + */ + g_assert ((s == NULL || *s == '\0') || g_dbus_is_guid (s)); g_variant_unref (value); /* Poke server and make sure animal is updated */ -- 2.11.4.GIT