diff options
| author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-08-30 16:53:36 +0100 | 
|---|---|---|
| committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-09-17 09:12:38 +0100 | 
| commit | 5c89fe0b540eaeecd72379f1f2b9da07883425e9 (patch) | |
| tree | db4f0d54dd372f9a19c19028c0dddfc68b8326d7 | |
| parent | dd0eb39c5da72f5f0fae9bfc28072b001044b7bd (diff) | |
Make the gnome-keyring test work again, with modern gnome-keyring
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088
Cherry-picked-from: c21e2b09bf4cdda6fb05d64f9198f6db7b776c76
| -rw-r--r-- | tests/twisted/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 a28bc7d4..df478eca 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  | 
