[telepathy-gabble/master] Add 'stun.collabora.co.uk' to the list of addresses test-resolver handles.

Mike Ruprecht mike.ruprecht at collabora.co.uk
Mon Dec 7 07:36:14 PST 2009


This allows for the fallback server to be tested in stun-server.py. This
also allows those tests to be run without a network connection.
---
 tests/twisted/jingle/stun-server.py |   12 ++++--------
 tests/twisted/main-debug.c          |    2 ++
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/tests/twisted/jingle/stun-server.py b/tests/twisted/jingle/stun-server.py
index c6831ea..d921d0b 100644
--- a/tests/twisted/jingle/stun-server.py
+++ b/tests/twisted/jingle/stun-server.py
@@ -102,14 +102,10 @@ def test(q, bus, conn, stream,
     if expected_stun_server == None:
         # If there is no stun server set then gabble should fallback on the
         # default fallback stunserver (stun.collabora.co.uk)
-        # This test assumes that if python can resolve the stun servers
-        # address then gabble should be able to resolv it as well
-        try:
-            expected_stun_server = \
-                socket.gethostbyname("stun.collabora.co.uk")
-            expected_stun_port = 3478
-        except:
-            expected_stun_server = None
+        # This test uses the test-resolver which is set to
+        # have 'stun.collabora.co.uk' resolve to '6.7.8.9'
+        expected_stun_server = '6.7.8.9'
+        expected_stun_port = 3478
 
     if expected_stun_server is None:
         assert sh_props['STUNServers'] == [], sh_props['STUNServers']
diff --git a/tests/twisted/main-debug.c b/tests/twisted/main-debug.c
index 8090834..f6f2ffe 100644
--- a/tests/twisted/main-debug.c
+++ b/tests/twisted/main-debug.c
@@ -94,6 +94,8 @@ main (int argc,
       "resolves-to-1.2.3.4", "1.2.3.4");
   test_resolver_add_A (TEST_RESOLVER (kludged),
       "localhost", "127.0.0.1");
+  test_resolver_add_A (TEST_RESOLVER (kludged),
+      "stun.collabora.co.uk", "6.7.8.9");
 
   gabble_jingle_factory_set_test_mode ();
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list