summaryrefslogtreecommitdiff
path: root/tests/twisted/crash-recovery/crash-recovery.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/twisted/crash-recovery/crash-recovery.py')
-rw-r--r--tests/twisted/crash-recovery/crash-recovery.py38
1 files changed, 22 insertions, 16 deletions
diff --git a/tests/twisted/crash-recovery/crash-recovery.py b/tests/twisted/crash-recovery/crash-recovery.py
index e189b850..0f831d4d 100644
--- a/tests/twisted/crash-recovery/crash-recovery.py
+++ b/tests/twisted/crash-recovery/crash-recovery.py
@@ -34,27 +34,33 @@ import constants as cs
def preseed():
accounts_dir = os.environ['MC_ACCOUNT_DIR']
- accounts_cfg = open(accounts_dir + '/accounts.cfg', 'w')
-
- accounts_cfg.write("""# Telepathy accounts
-[fakecm/fakeprotocol/jc_2edenton_40unatco_2eint]
-manager=fakecm
-protocol=fakeprotocol
-DisplayName=Work account
-NormalizedName=jc.denton@unatco.int
-param-account=jc.denton@unatco.int
-param-password=ionstorm
-Enabled=1
-""")
-
- accounts_cfg.close()
+ account_id = 'fakecm/fakeprotocol/jc_2edenton_40unatco_2eint'
+
+ escaped = account_id.replace('/', '_')
+ filename = accounts_dir + '/' + escaped
+ account = open(filename, 'w')
+
+ # As a regression test for part of fd.o #28557, the password starts and
+ # ends with a double backslash, which is represented in the file as a
+ # quadruple backslash.
+ account.write("""{
+'id': <'%s'>,
+'manager': <'fakecm'>,
+'protocol': <'fakeprotocol'>,
+'DisplayName': <'Work account'>,
+'NormalizedName': <'jc.denton@unatco.int'>,
+'param-account': <'jc.denton@unatco.int'>,
+'param-password': <'ionstorm'>,
+'Enabled': <true>
+}""" % account_id)
+ account.close()
account_connections_file = open(accounts_dir + '/.mc_connections', 'w')
account_connections_file.write("%s\t%s\t%s\n" %
(cs.tp_path_prefix + '/Connection/fakecm/fakeprotocol/jc',
- cs.tp_name_prefix + '.Connection.fakecm.fakeprotocol.jc',
- 'fakecm/fakeprotocol/jc_2edenton_40unatco_2eint'))
+ cs.tp_name_prefix + '.Connection.fakecm.fakeprotocol.jc',
+ account_id))
def test(q, bus, unused):
text_fixed_properties = dbus.Dictionary({