telepathy-mission-control: Make the gnome-keyring test work again, with modern gnome-keyring

Simon McVittie smcv at kemper.freedesktop.org
Fri Aug 31 07:26:57 PDT 2012


Module: telepathy-mission-control
Branch: master
Commit: c21e2b09bf4cdda6fb05d64f9198f6db7b776c76
URL:    http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=c21e2b09bf4cdda6fb05d64f9198f6db7b776c76

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Thu Aug 30 16:53:36 2012 +0100

Make the gnome-keyring test work again, with modern gnome-keyring

Signed-off-by: Simon McVittie <simon.mcvittie at collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088

---

 .../account-storage/default-keyring-storage.py     |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/account-storage/default-keyring-storage.py b/tests/twisted/account-storage/default-keyring-storage.py
index 284fb77..7242f58 100644
--- a/tests/twisted/account-storage/default-keyring-storage.py
+++ b/tests/twisted/account-storage/default-keyring-storage.py
@@ -32,6 +32,9 @@ from mctest import (
     )
 import constants as cs
 
+# FIXME: this test relies on tools in the builddir. It won't work when
+# the tests are installed and run without a builddir.
+
 use_keyring = False
 if ('MC_TEST_GNOME_KEYRING' in os.environ and
     os.environ['MC_TEST_GNOME_KEYRING'] == '1'):
@@ -79,7 +82,9 @@ def start_gnome_keyring_daemon(ctl_dir):
         return
 
     os.chmod(ctl_dir, 0700)
-    env = os.popen('gnome-keyring-daemon -d --control-directory=' + ctl_dir).read()
+    # Ugh. We have to put XDG_DATA_DIRS back the way we found them because
+    # otherwise it won't find its schemas and everything goes horribly wrong.
+    env = os.popen('/usr/bin/env XDG_DATA_DIRS=/usr/local/share:/usr/share gnome-keyring-daemon -d --control-directory=' + ctl_dir).read()
     env_file = open(ctl_dir + '/gnome-keyring-env', 'w')
 
     for line in env.split('\n'):
@@ -89,6 +94,10 @@ def start_gnome_keyring_daemon(ctl_dir):
             os.environ[k] = v
             env_file.write('%s=%s\n' % (k, v))
 
+    # Wait for gnome-keyring to start. We shouldn't have to do this, but,
+    # whatever. Happily, we have a tool which can do this for us.
+    os.system('../../util/mc-wait-for-name org.freedesktop.secrets')
+
     keyring_name = create_keyring()
     assert keyring_name
     print "Created new keyring name, putting to env", keyring_name



More information about the telepathy-commits mailing list