summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2012-09-03 19:12:29 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-09-07 17:35:04 +0100
commit947aaa3c91f7f286d37f803286d77070f0cc6fb2 (patch)
tree0a4367a2a4a3e14e9e8f3d04e93bf3124e942211
parent0bb531d7856f4b79edd7d328cef59e58f7f08ac8 (diff)
downloadtelepathy-mission-control-947aaa3c91f7f286d37f803286d77070f0cc6fb2.tar.gz
Tests: distinguish between XDG cache/config/data home, and MC_ACCOUNT_DIR
We want to be sure that MC is using the right one in each situation. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35896 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r--tests/twisted/Makefile.am10
-rw-r--r--tests/twisted/account-manager/auto-connect.py5
-rw-r--r--tests/twisted/account-manager/avatar-persist.py5
-rw-r--r--tests/twisted/account-manager/avatar-refresh.py5
-rw-r--r--tests/twisted/account-manager/make-valid.py5
-rw-r--r--tests/twisted/account-storage/default-keyring-storage.py4
-rw-r--r--tests/twisted/account-storage/diverted-storage.py8
-rw-r--r--tests/twisted/crash-recovery/crash-recovery.py5
-rw-r--r--tests/twisted/dispatcher/create-at-startup.py5
9 files changed, 46 insertions, 6 deletions
diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index 8cb78774..ca3b28db 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -222,13 +222,13 @@ BASIC_TESTS_ENVIRONMENT = \
PYTHONPATH=@abs_top_srcdir@/tests/twisted:@abs_top_builddir@/tests/twisted \
MC_DEBUG=all \
MC_FILTER_PLUGIN_DIR=@abs_top_builddir@/tests/twisted/.libs \
- MC_ACCOUNT_DIR=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX) \
- XDG_CONFIG_HOME=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX) \
+ MC_ACCOUNT_DIR=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX)/mc-account-dir \
+ XDG_CONFIG_HOME=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX)/config \
XDG_CONFIG_DIRS=@abs_top_srcdir@/tests/twisted \
- XDG_DATA_HOME=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX) \
+ XDG_DATA_HOME=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX)/localshare \
XDG_DATA_DIRS=@abs_top_srcdir@/tests/twisted \
- XDG_CACHE_DIR=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX) \
- XDG_CACHE_HOME=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX) \
+ XDG_CACHE_DIR=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX)/cache \
+ XDG_CACHE_HOME=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX)/cache \
MC_CLIENTS_DIR=@abs_top_srcdir@/tests/twisted/telepathy/clients \
MC_MANAGER_DIR=@abs_top_srcdir@/tests/twisted/telepathy/managers \
G_DEBUG=fatal_criticals
diff --git a/tests/twisted/account-manager/auto-connect.py b/tests/twisted/account-manager/auto-connect.py
index 38227f5f..581a1b66 100644
--- a/tests/twisted/account-manager/auto-connect.py
+++ b/tests/twisted/account-manager/auto-connect.py
@@ -39,6 +39,11 @@ def preseed():
accounts_dir = os.environ['MC_ACCOUNT_DIR']
+ try:
+ os.mkdir(accounts_dir, 0700)
+ except OSError:
+ pass
+
accounts_cfg = open(accounts_dir + '/accounts.cfg', 'w')
# As a regression test for part of fd.o #28557, the password starts and
diff --git a/tests/twisted/account-manager/avatar-persist.py b/tests/twisted/account-manager/avatar-persist.py
index 06ad65d8..e9078732 100644
--- a/tests/twisted/account-manager/avatar-persist.py
+++ b/tests/twisted/account-manager/avatar-persist.py
@@ -40,6 +40,11 @@ def preseed():
accounts_dir = os.environ['MC_ACCOUNT_DIR']
+ try:
+ os.mkdir(accounts_dir, 0700)
+ except OSError:
+ pass
+
accounts_cfg = open(accounts_dir + '/accounts.cfg', 'w')
accounts_cfg.write("""# Telepathy accounts
[%s]
diff --git a/tests/twisted/account-manager/avatar-refresh.py b/tests/twisted/account-manager/avatar-refresh.py
index a93912eb..42dd5d3f 100644
--- a/tests/twisted/account-manager/avatar-refresh.py
+++ b/tests/twisted/account-manager/avatar-refresh.py
@@ -40,6 +40,11 @@ def preseed():
accounts_dir = os.environ['MC_ACCOUNT_DIR']
+ try:
+ os.mkdir(accounts_dir, 0700)
+ except OSError:
+ pass
+
accounts_cfg = open(accounts_dir + '/accounts.cfg', 'w')
accounts_cfg.write("""# Telepathy accounts
[%s]
diff --git a/tests/twisted/account-manager/make-valid.py b/tests/twisted/account-manager/make-valid.py
index ee3ee98f..457229db 100644
--- a/tests/twisted/account-manager/make-valid.py
+++ b/tests/twisted/account-manager/make-valid.py
@@ -40,6 +40,11 @@ def preseed():
accounts_dir = os.environ['MC_ACCOUNT_DIR']
+ try:
+ os.mkdir(accounts_dir, 0700)
+ except OSError:
+ pass
+
# The passwords are missing, so the accounts can't connect yet.
accounts_cfg = open(accounts_dir + '/accounts.cfg', 'w')
accounts_cfg.write("""# Telepathy accounts
diff --git a/tests/twisted/account-storage/default-keyring-storage.py b/tests/twisted/account-storage/default-keyring-storage.py
index bab0b726..c1230788 100644
--- a/tests/twisted/account-storage/default-keyring-storage.py
+++ b/tests/twisted/account-storage/default-keyring-storage.py
@@ -266,6 +266,10 @@ DisplayName=New and improved account
if __name__ == '__main__':
ctl_dir = os.environ['MC_ACCOUNT_DIR']
+ try:
+ os.mkdir(ctl_dir, 0700)
+ except OSError:
+ pass
start_gnome_keyring_daemon(ctl_dir)
exec_test(test, {}, timeout=10)
stop_gnome_keyring_daemon()
diff --git a/tests/twisted/account-storage/diverted-storage.py b/tests/twisted/account-storage/diverted-storage.py
index d645656e..608ad4eb 100644
--- a/tests/twisted/account-storage/diverted-storage.py
+++ b/tests/twisted/account-storage/diverted-storage.py
@@ -33,7 +33,13 @@ from mctest import (
import constants as cs
def test(q, bus, mc):
- empty_key_file_name = os.path.join(os.environ['MC_ACCOUNT_DIR'], 'accounts.cfg')
+ accounts_dir = os.environ['MC_ACCOUNT_DIR']
+ try:
+ os.mkdir(accounts_dir, 0700)
+ except OSError:
+ pass
+
+ empty_key_file_name = os.path.join(accounts_dir, 'accounts.cfg')
group = 'fakecm/fakeprotocol/someguy_40example_2ecom0'
diff --git a/tests/twisted/crash-recovery/crash-recovery.py b/tests/twisted/crash-recovery/crash-recovery.py
index e189b850..0446550c 100644
--- a/tests/twisted/crash-recovery/crash-recovery.py
+++ b/tests/twisted/crash-recovery/crash-recovery.py
@@ -34,6 +34,11 @@ import constants as cs
def preseed():
accounts_dir = os.environ['MC_ACCOUNT_DIR']
+ try:
+ os.mkdir(accounts_dir, 0700)
+ except OSError:
+ pass
+
accounts_cfg = open(accounts_dir + '/accounts.cfg', 'w')
accounts_cfg.write("""# Telepathy accounts
diff --git a/tests/twisted/dispatcher/create-at-startup.py b/tests/twisted/dispatcher/create-at-startup.py
index c4e24765..992145fb 100644
--- a/tests/twisted/dispatcher/create-at-startup.py
+++ b/tests/twisted/dispatcher/create-at-startup.py
@@ -35,6 +35,11 @@ import constants as cs
def preseed():
accounts_dir = os.environ['MC_ACCOUNT_DIR']
+ try:
+ os.mkdir(accounts_dir, 0700)
+ except OSError:
+ pass
+
accounts_cfg = open(accounts_dir + '/accounts.cfg', 'w')
accounts_cfg.write("""# Telepathy accounts
[fakecm/fakeprotocol/jc_2edenton_40unatco_2eint]