Run libsocialweb tests under GTestDBus instead of with-session-bus.sh
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 19 Mar 2013 12:23:34 +0000 (12:23 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 20 Mar 2013 11:48:25 +0000 (11:48 +0000)
Bug https://bugzilla.gnome.org/show_bug.cgi?id=690830
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip@tecnocode.co.uk>
configure.ac
tests/lib/libsocialweb/Makefile.am
tests/lib/libsocialweb/session.conf.in [deleted file]
tests/lib/libsocialweb/test-case.vala
tests/libsocialweb/Makefile.am

index 8f5166c..bb89574 100644 (file)
@@ -654,7 +654,6 @@ AC_CONFIG_FILES([
     tests/lib/eds/Makefile
     tests/lib/key-file/Makefile
     tests/lib/libsocialweb/Makefile
-    tests/lib/libsocialweb/session.conf
     tests/lib/telepathy/Makefile
     tests/lib/tracker/Makefile
     tests/lib/telepathy/contactlist/Makefile
index d3520ee..a338eb3 100644 (file)
@@ -47,14 +47,9 @@ MAINTAINERCLEANFILES = \
        libsocialweb-test.h \
        $(NULL)
 
-DISTCLEANFILES = \
-       session.conf \
-       $(NULL)
-
 EXTRA_DIST = \
        libsocialweb-test.vapi \
        libsocialweb-test.h \
-       session.conf.in \
        $(NULL)
 
 GITIGNOREFILES = \
diff --git a/tests/lib/libsocialweb/session.conf.in b/tests/lib/libsocialweb/session.conf.in
deleted file mode 100644 (file)
index 0086c6e..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE busconfig PUBLIC
- "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-  <!-- Our well-known bus type, don't change this -->
-  <type>session</type>
-
-  <!-- If we fork, keep the user's original umask to avoid affecting
-       the behavior of child processes. -->
-  <keep_umask/>
-
-  <listen>unix:tmpdir=/tmp</listen>
-
-  <!-- Search for .service files in our special services dir -->
-  <servicedir>@abs_top_srcdir@/tests/lib/libsocialweb</servicedir>
-
-  <policy context="default">
-    <!-- Allow everything to be sent -->
-    <allow send_destination="*" eavesdrop="true"/>
-    <!-- Allow everything to be received -->
-    <allow eavesdrop="true"/>
-    <!-- Allow anyone to own anything -->
-    <allow own="*"/>
-  </policy>
-
-  <!-- raise the service start timeout to 40 seconds as it can timeout
-       on the live cd on slow machines -->
-  <limit name="service_start_timeout">60000</limit>
-
-  <include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include>
-
-  <!-- For the session bus, override the default relatively-low limits
-       with essentially infinite limits, since the bus is just running
-       as the user anyway, using up bus resources is not something we need
-       to worry about. In some cases, we do set the limits lower than
-       "all available memory" if exceeding the limit is almost certainly a bug,
-       having the bus enforce a limit is nicer than a huge memory leak. But the
-       intent is that these limits should never be hit. -->
-
-  <!-- the memory limits are 1G instead of say 4G because they can't exceed 32-bit signed int max -->
-  <limit name="max_incoming_bytes">1000000000</limit>
-  <limit name="max_outgoing_bytes">1000000000</limit>
-  <limit name="max_message_size">1000000000</limit>
-  <limit name="service_start_timeout">120000</limit>
-  <limit name="auth_timeout">240000</limit>
-  <limit name="max_completed_connections">100000</limit>
-  <limit name="max_incomplete_connections">10000</limit>
-  <limit name="max_connections_per_user">100000</limit>
-  <limit name="max_pending_service_starts">10000</limit>
-  <limit name="max_names_per_connection">50000</limit>
-  <limit name="max_match_rules_per_connection">50000</limit>
-  <limit name="max_replies_per_connection">50000</limit>
-
-</busconfig>
index 2d83bb1..90b6ceb 100644 (file)
@@ -25,9 +25,6 @@
 /**
  * A test case for the libsocialweb backend. Folks is configured
  * to use that backend and no others, with no primary store.
- *
- * FIXME: for now, this relies on being run under with-session-bus.sh
- * with no activatable services.
  */
 public class LibsocialwebTest.TestCase : Folks.TestCase
 {
@@ -42,23 +39,21 @@ public class LibsocialwebTest.TestCase : Folks.TestCase
 
   public TestCase (string name)
     {
-      /* This variable is set in the same place as the various variables we
-       * care about for sandboxing purposes, like XDG_CONFIG_HOME and
-       * DBUS_SESSION_BUS_ADDRESS. */
-      if (Environment.get_variable ("FOLKS_TESTS_SANDBOXED_DBUS")
-          != "no-services")
-        error ("libsocialweb tests must be run in a private D-Bus session");
-
       base (name);
 
       Environment.set_variable ("FOLKS_BACKENDS_ALLOWED", "libsocialweb", true);
       Environment.set_variable ("FOLKS_PRIMARY_STORE", "", true);
     }
 
-  public override void private_bus_up ()
+  /**
+   * This test does use libdbus, via libsocialweb.
+   */
+  public override bool uses_dbus_1
     {
-      /* Don't do anything. We're currently relying on
-       * being wrapped in with-session-bus.sh. */
+      get
+        {
+          return true;
+        }
     }
 
   /**
index f61c9de..14b5e55 100644 (file)
@@ -24,8 +24,6 @@ LDADD = \
        -L$(top_srcdir)/backends/libsocialweb/lib \
        $(NULL)
 
-RUN_WITH_PRIVATE_BUS = $(top_srcdir)/tests/tools/with-session-bus.sh
-
 AM_VALAFLAGS += \
        $(ERROR_VALAFLAGS) \
        --vapidir=. \
@@ -50,12 +48,11 @@ noinst_PROGRAMS = \
        aggregation \
        $(NULL)
 
-SESSION_CONF = $(top_builddir)/tests/lib/libsocialweb/session.conf
 TESTS_ENVIRONMENT = \
        FOLKS_BACKEND_PATH=$(BACKEND_UNINST_PATH) \
-       $(RUN_WITH_PRIVATE_BUS) \
-       --config-file=$(SESSION_CONF) \
-       --
+       $(top_srcdir)/tests/tools/execute-test.sh \
+       $(NULL)
+
 TESTS = $(noinst_PROGRAMS)
 
 dummy_lsw_SOURCES = \