From 7f2065f1f432c1d42c6475f0ce74a28af7c86556 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 1 Jul 2011 00:26:15 +0100 Subject: [PATCH] Skip stream tube credentials-passing tests where unsupported Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36801 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=623587 --- tests/dbus/stream-tube.c | 35 +++++++++++++++++++++++++++++++++++ 1 files changed, 35 insertions(+), 0 deletions(-) diff --git a/tests/dbus/stream-tube.c b/tests/dbus/stream-tube.c index 57c2dcf..e3410f2 100644 --- a/tests/dbus/stream-tube.c +++ b/tests/dbus/stream-tube.c @@ -18,6 +18,10 @@ #include "tests/lib/simple-conn.h" #include "tests/lib/stream-tube-chan.h" +#ifdef HAVE_GIO_UNIX +# include +#endif + #define BUFFER_SIZE 128 typedef struct { @@ -44,6 +48,7 @@ TestContext contexts[] = { }; static gboolean have_ipv6 = FALSE; +static gboolean have_creds = FALSE; typedef struct { GMainLoop *mainloop; @@ -411,6 +416,14 @@ test_accept_success (Test *test, guint i = GPOINTER_TO_UINT (data); TpContact *contact; + if (contexts[i].address_type == TP_SOCKET_ADDRESS_TYPE_UNIX && + contexts[i].access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS && + !have_creds) + { + g_message ("skipped: credentials-passing not supported here"); + return; + } + if (contexts[i].address_type == TP_SOCKET_ADDRESS_TYPE_IPV6 && !have_ipv6) { @@ -518,6 +531,14 @@ test_offer_success (Test *test, TpHandle bob_handle; TpContact *contact; + if (contexts[i].address_type == TP_SOCKET_ADDRESS_TYPE_UNIX && + contexts[i].access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS && + !have_creds) + { + g_message ("skipped: credentials-passing not supported here"); + return; + } + if (contexts[i].address_type == TP_SOCKET_ADDRESS_TYPE_IPV6 && !have_ipv6) { @@ -714,6 +735,14 @@ test_offer_race (Test *test, GSocketConnection *conn; TpContact *contact; + if (contexts[i].address_type == TP_SOCKET_ADDRESS_TYPE_UNIX && + contexts[i].access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS && + !have_creds) + { + g_message ("skipped: credentials-passing not supported here"); + return; + } + if (contexts[i].address_type == TP_SOCKET_ADDRESS_TYPE_IPV6 && !have_ipv6) { @@ -1019,6 +1048,12 @@ main (int argc, have_ipv6 = check_ipv6_support (); +#ifdef HAVE_GIO_UNIX + have_creds = g_unix_credentials_message_is_supported (); +#else + have_creds = FALSE; +#endif + g_test_add ("/stream-tube/creation", Test, NULL, setup, test_creation, teardown); g_test_add ("/stream-tube/properties", Test, NULL, setup, test_properties, -- 1.7.5.4