diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-05-29 12:05:09 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-05-29 17:22:57 +0100 |
commit | 1e99c77f8d8a686c4c1714a959c062bda6dc0c44 (patch) | |
tree | 515e28bd1d10f6503b8d16386a8ecdbd58ce9ae0 | |
parent | c1d101558de76e3ebacd05fb032764a126d28468 (diff) |
Add a regression test for fd.o #65036
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65036
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
-rw-r--r-- | tests/twisted/Makefile.am | 1 | ||||
-rw-r--r-- | tests/twisted/tls/legacy-jabber.py | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am index ba5dcad68..ae24bd110 100644 --- a/tests/twisted/Makefile.am +++ b/tests/twisted/Makefile.am @@ -120,6 +120,7 @@ TWISTED_TESTS = \ text/test-text-delayed.py \ text/test-text-no-body.py \ text/test-text.py \ + tls/legacy-jabber.py \ tls/server-tls-channel.py \ version.py \ $(NULL) diff --git a/tests/twisted/tls/legacy-jabber.py b/tests/twisted/tls/legacy-jabber.py new file mode 100644 index 000000000..e2090bb18 --- /dev/null +++ b/tests/twisted/tls/legacy-jabber.py @@ -0,0 +1,36 @@ +""" +fd.o #65036: connecting to legacy Jabber servers should respect + require-encryption +""" + +from servicetest import assertEquals +from gabbletest import exec_test, JabberXmlStream, JabberAuthenticator +import constants as cs + +JID = 'alice@example.com' +PASSWORD = 's3kr1t' + +def test_require_encryption(q, bus, conn, stream): + conn.Connect() + q.expect('dbus-signal', signal='StatusChanged', + args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED]) + + # FIXME: arrange to get a better error + new = q.expect('dbus-signal', signal='ConnectionError') + assertEquals(cs.NETWORK_ERROR, new.args[0]) + + q.expect('dbus-signal', signal='StatusChanged', + args=[cs.CONN_STATUS_DISCONNECTED, cs.CSR_NETWORK_ERROR]) + +if __name__ == '__main__': + exec_test(test_require_encryption, + { + 'password': PASSWORD, + 'account': JID, + 'require-encryption': True, + 'old-ssl': False, + 'resource': 'legacy-require-encryption', + }, + protocol=JabberXmlStream, + authenticator=JabberAuthenticator(JID.split('@')[0], PASSWORD), + do_connect=False) |