[telepathy-gabble-0.16] telepathy-gabble: Add a regression test for fd. o #65036

Simon McVittie smcv at kemper.freedesktop.org
Thu May 30 07:53:06 PDT 2013


Module: telepathy-gabble
Branch: telepathy-gabble-0.16
Commit: 1e99c77f8d8a686c4c1714a959c062bda6dc0c44
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=1e99c77f8d8a686c4c1714a959c062bda6dc0c44

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Wed May 29 12:05:09 2013 +0100

Add a regression test for fd.o #65036

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65036
Reviewed-by: Will Thompson <will.thompson at collabora.co.uk>

---

 tests/twisted/Makefile.am          |    1 +
 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 ba5dcad..ae24bd1 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 0000000..e2090bb
--- /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 at 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)



More information about the telepathy-commits mailing list