summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-11-22 16:21:35 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2012-11-26 09:57:09 +0000
commita12bb8705eb0810b67f83dae7185a182bb1225bd (patch)
tree37cfe8bd99a228d9c6fc6dffa5d6f414b5866c30
parent98add3fb1749366229fc0c211f0fa939d3dfc267 (diff)
jingle/stun-server: remove unneeded do_connect=False
This used to be needed to ensure that the query Gabble sends right after connecting wasn't swallowed by the expect() calls that gabbletest makes after Connect(). But now that Sjoerd's split the dbus and stream event queues, this is no longer a problem: the only stream event it awaits is stream-authenticated, which is certainly before the jingleinfo query.
-rw-r--r--tests/twisted/jingle/stun-server.py35
1 files changed, 12 insertions, 23 deletions
diff --git a/tests/twisted/jingle/stun-server.py b/tests/twisted/jingle/stun-server.py
index d4e7ca865..6fab4c8b2 100644
--- a/tests/twisted/jingle/stun-server.py
+++ b/tests/twisted/jingle/stun-server.py
@@ -40,21 +40,10 @@ def init_test(q, conn, stream, google=False):
# If we need to override remote caps, feats, codecs or caps,
# this is a good time to do it
- # Connecting
- conn.Connect()
-
- expected = [EventPattern('dbus-signal', signal='StatusChanged',
- args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])]
-
if google:
# See: http://code.google.com/apis/talk/jep_extensions/jingleinfo.html
- expected.append(EventPattern('stream-iq', query_ns=ns.GOOGLE_JINGLE_INFO,
- to='test@localhost'))
-
- events = q.expect_many(*expected)
-
- if google:
- event = events[-1]
+ event = q.expect('stream-iq', query_ns=ns.GOOGLE_JINGLE_INFO,
+ to='test@localhost')
jingleinfo = make_result_iq(stream, event.stanza)
stun = jingleinfo.firstChildElement().addElement('stun')
server = stun.addElement('server')
@@ -270,38 +259,38 @@ def test_call(q, bus, conn, stream,
if __name__ == '__main__':
# StreamedMedia tests
exec_test(partial(test_streamed_media,
- google=False), do_connect=False)
+ google=False))
exec_test(partial(test_streamed_media,
google=False, expected_stun_server='5.4.3.2', expected_stun_port=54321),
params={'fallback-stun-server': 'resolves-to-5.4.3.2',
- 'fallback-stun-port': dbus.UInt16(54321)}, do_connect=False)
+ 'fallback-stun-port': dbus.UInt16(54321)})
if GOOGLE_RELAY_ENABLED:
exec_test(partial(test_streamed_media,
google=True, expected_stun_server='1.2.3.4', expected_stun_port=12345),
- protocol=GoogleXmlStream, do_connect=False)
+ protocol=GoogleXmlStream)
exec_test(partial(test_streamed_media,
google=True, expected_stun_server='5.4.3.2', expected_stun_port=54321),
protocol=GoogleXmlStream,
params={'stun-server': 'resolves-to-5.4.3.2',
- 'stun-port': dbus.UInt16(54321)}, do_connect=False)
+ 'stun-port': dbus.UInt16(54321)})
exec_test(partial(test_streamed_media,
google=True, expected_stun_server='1.2.3.4', expected_stun_port=12345),
protocol=GoogleXmlStream,
params={'fallback-stun-server': 'resolves-to-5.4.3.2',
- 'fallback-stun-port': dbus.UInt16(54321)}, do_connect=False)
+ 'fallback-stun-port': dbus.UInt16(54321)})
else:
print "NOTE: built with --disable-google-relay; omitting StreamedMedia tests with Google relay"
# Call tests
if CHANNEL_TYPE_CALL_ENABLED:
exec_test(partial(test_call,
- google=False), do_connect=False)
+ google=False))
exec_test(partial(test_call,
google=False, expected_stun_server='5.4.3.2',
expected_stun_port=54321),
params={'fallback-stun-server': 'resolves-to-5.4.3.2',
- 'fallback-stun-port': dbus.UInt16(54321)}, do_connect=False)
+ 'fallback-stun-port': dbus.UInt16(54321)})
else:
print "NOTE: built with --disable-channel-type-call; omitting Call tests"
@@ -309,19 +298,19 @@ if __name__ == '__main__':
exec_test(partial(test_call,
google=True, expected_stun_server='1.2.3.4',
expected_stun_port=12345),
- protocol=GoogleXmlStream, do_connect=False)
+ protocol=GoogleXmlStream)
exec_test(partial(test_call,
google=True, expected_stun_server='5.4.3.2',
expected_stun_port=54321),
protocol=GoogleXmlStream,
params={'stun-server': 'resolves-to-5.4.3.2',
- 'stun-port': dbus.UInt16(54321)}, do_connect=False)
+ 'stun-port': dbus.UInt16(54321)})
exec_test(partial(test_call,
google=True, expected_stun_server='1.2.3.4',
expected_stun_port=12345),
protocol=GoogleXmlStream,
params={'fallback-stun-server': 'resolves-to-5.4.3.2',
- 'fallback-stun-port': dbus.UInt16(54321)}, do_connect=False)
+ 'fallback-stun-port': dbus.UInt16(54321)})
else:
print "NOTE: built with --disable-channel-type-call or with --disable-google-relay; omitting Call tests with Google relay"