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
This commit is contained in:
Emmanuele Bassi 2018-02-19 14:36:42 +00:00
parent d1a080baa5
commit d8a3492fce

View File

@ -1683,7 +1683,10 @@ codegen_test_peer (void)
g_assert_no_error (error); g_assert_no_error (error);
g_variant_get (value, "(&s)", &s); g_variant_get (value, "(&s)", &s);
g_test_message ("Machine ID: %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); g_variant_unref (value);
/* Poke server and make sure animal is updated */ /* Poke server and make sure animal is updated */