Run Telepathy test cases under GTestDBus instead of with-session-bus.sh
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 19 Mar 2013 12:25:42 +0000 (12:25 +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/folks/Makefile.am
tests/lib/telepathy/contactlist/Makefile.am
tests/lib/telepathy/contactlist/session.conf.in [deleted file]
tests/lib/telepathy/test-case.vala
tests/telepathy/Makefile.am

index bb89574..d35e0f1 100644 (file)
@@ -657,7 +657,6 @@ AC_CONFIG_FILES([
     tests/lib/telepathy/Makefile
     tests/lib/tracker/Makefile
     tests/lib/telepathy/contactlist/Makefile
-    tests/lib/telepathy/contactlist/session.conf
     tests/tools/Makefile
     tools/Makefile
     tools/inspect/Makefile
index c680437..ef1ab84 100644 (file)
@@ -23,8 +23,6 @@ LDADD = \
        $(TP_GLIB_LIBS) \
        $(NULL)
 
-RUN_WITH_PRIVATE_BUS = $(top_srcdir)/tests/tools/with-session-bus.sh
-
 # --disable-warnings is necessary so that we can test deprecated API such as
 # the IndividualAggregator.individuals_changed signal.
 AM_VALAFLAGS += \
@@ -65,14 +63,12 @@ noinst_PROGRAMS = \
        init \
        $(NULL)
 
-SESSION_CONF = $(top_builddir)/tests/lib/telepathy/contactlist/session.conf
 avatar_file=@abs_top_srcdir@/tests/data/avatar-01.jpg
 TESTS_ENVIRONMENT = \
        FOLKS_BACKEND_PATH=$(BACKEND_UNINST_PATH) \
        AVATAR_FILE_PATH=$(avatar_file) \
-       $(RUN_WITH_PRIVATE_BUS) \
-       --config-file=$(SESSION_CONF) \
-       --
+       $(top_srcdir)/tests/tools/execute-test.sh \
+       $(NULL)
 
 TESTS = $(noinst_PROGRAMS)
 
index 2512900..4c81c07 100644 (file)
@@ -98,9 +98,7 @@ MAINTAINERCLEANFILES = \
        $(introspection_files) \
        $(NULL)
 
-DISTCLEANFILES = \
-       session.conf \
-       $(NULL)
+DISTCLEANFILES =
 
 if NOT_RELEASE
 DISTCLEANFILES += $(dist_noinst_DATA)
@@ -108,7 +106,6 @@ endif
 
 EXTRA_DIST = \
        manager-file.py \
-       session.conf.in \
        tp-test-contactlist.h \
        $(NULL)
 
diff --git a/tests/lib/telepathy/contactlist/session.conf.in b/tests/lib/telepathy/contactlist/session.conf.in
deleted file mode 100644 (file)
index fd7b966..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/telepathy/contactlist/_gen</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 f2b9f10..54343c7 100644 (file)
@@ -29,9 +29,6 @@
  *
  * Folks is configured to use the Telepathy backend, with no primary store,
  * unless //use_keyfile_too// is set.
- *
- * FIXME: for now, this relies on being run under with-session-bus.sh
- * with no activatable services.
  */
 public class TpfTest.TestCase : Folks.TestCase
 {
@@ -90,12 +87,6 @@ public class TpfTest.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 ("Telepathy tests must be run in a private D-Bus session");
 
       base (name);
 
@@ -116,10 +107,15 @@ public class TpfTest.TestCase : Folks.TestCase
       this.create_tp_backend ();
     }
 
-  public override void private_bus_up ()
+  /**
+   * This test does use libdbus, via telepathy-glib.
+   */
+  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 aa17a9b..1677984 100644 (file)
@@ -28,8 +28,6 @@ LDADD = \
        -L$(top_srcdir)/backends/telepathy/lib \
        $(NULL)
 
-RUN_WITH_PRIVATE_BUS = $(top_srcdir)/tests/tools/with-session-bus.sh
-
 AM_VALAFLAGS += \
        $(ERROR_VALAFLAGS) \
        --vapidir=$(abs_top_srcdir)/tests/lib/telepathy/contactlist/ \
@@ -60,13 +58,12 @@ AM_VALAFLAGS += \
        -g \
        $(NULL)
 
-SESSION_CONF = $(top_builddir)/tests/lib/telepathy/contactlist/session.conf
 TESTS_ENVIRONMENT = \
        FOLKS_BACKEND_PATH=$(BACKEND_UNINST_PATH) \
        FOLKS_BACKEND_KEY_FILE_PATH=$(srcdir)/data/relationships-empty.ini \
-       $(RUN_WITH_PRIVATE_BUS) \
-       --config-file=$(SESSION_CONF) \
-       --
+       $(top_srcdir)/tests/tools/execute-test.sh \
+       $(NULL)
+
 TESTS = \
        persona-store-capabilities \
        individual-retrieval \