[telepathy-gabble/master] Test that we don't accept open iq for unaccepted bytestreams

Sjoerd Simons sjoerd.simons at collabora.co.uk
Fri Dec 18 11:22:49 PST 2009


---
 tests/twisted/Makefile.am                         |    1 +
 tests/twisted/file-transfer/test-ibb-too-early.py |   29 +++++++++++++++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)
 create mode 100644 tests/twisted/file-transfer/test-ibb-too-early.py

diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index e4f2d34..6e19936 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -125,6 +125,7 @@ TWISTED_TESTS = \
 	jingle/test-wait-for-caps.py \
 	jingle/test-wait-for-caps-incomplete.py \
 	file-transfer/test-caps-file-transfer.py \
+	file-transfer/test-ibb-too-early.py \
 	file-transfer/test-receive-file-and-close-socket-while-receiving.py \
 	file-transfer/test-receive-file-and-disconnect.py \
 	file-transfer/test-receive-file-and-sender-disconnect-while-pending.py \
diff --git a/tests/twisted/file-transfer/test-ibb-too-early.py b/tests/twisted/file-transfer/test-ibb-too-early.py
new file mode 100644
index 0000000..68b30a8
--- /dev/null
+++ b/tests/twisted/file-transfer/test-ibb-too-early.py
@@ -0,0 +1,29 @@
+from gabbletest import exec_test
+
+import bytestream
+from file_transfer_helper import ReceiveFileTest, File
+from servicetest import EventPattern
+
+import constants as cs
+
+class IbbTooEarlyTest (ReceiveFileTest):
+    def __init__ (self):
+        ReceiveFileTest.__init__ (self,
+            bytestream.BytestreamIBBMsg,
+            File (),
+            cs.SOCKET_ADDRESS_TYPE_UNIX,
+            cs.SOCKET_ACCESS_CONTROL_LOCALHOST,
+            "")
+
+    def accept_file (self):
+        # Instead of us accepting the other side starts sending the iq open
+        # skip the open step explicitely
+        self.bytestream.checked = True
+        event = self.bytestream.open_bytestream(
+            expected_after = [ EventPattern ('stream-iq', iq_type = 'error') ] )
+        return True
+
+
+
+if __name__ == '__main__':
+    exec_test (IbbTooEarlyTest().test)
-- 
1.5.6.5



More information about the telepathy-commits mailing list