]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Disallow ipv6 in curl-based tests.
authorBen Darnell <ben@bendarnell.com>
Mon, 30 Dec 2013 01:41:17 +0000 (20:41 -0500)
committerBen Darnell <ben@bendarnell.com>
Mon, 30 Dec 2013 01:41:17 +0000 (20:41 -0500)
The test servers only listen on ipv4, and it appears that libcurl 7.19.34
has regressed in its ability to handle the case when localhost resolves
to both v4 and v6 variants but only one works.

IPv6 was already disabled by default in simple_httpclient tests.

tornado/test/curl_httpclient_test.py
tornado/test/httpclient_test.py
tornado/test/runtests.py

index faf6cdc791a6c73b5073bf89f982669aa6c7eca5..fb6965648ecb958adfe945e722929bffb98dcc10 100644 (file)
@@ -22,7 +22,8 @@ if pycurl is not None:
 @unittest.skipIf(pycurl is None, "pycurl module not present")
 class CurlHTTPClientCommonTestCase(httpclient_test.HTTPClientCommonTestCase):
     def get_http_client(self):
-        client = CurlAsyncHTTPClient(io_loop=self.io_loop)
+        client = CurlAsyncHTTPClient(io_loop=self.io_loop,
+                                     defaults=dict(allow_ipv6=False))
         # make sure AsyncHTTPClient magic doesn't give us the wrong class
         self.assertTrue(isinstance(client, CurlAsyncHTTPClient))
         return client
@@ -71,7 +72,8 @@ class DigestAuthHandler(RequestHandler):
 class CurlHTTPClientTestCase(AsyncHTTPTestCase):
     def setUp(self):
         super(CurlHTTPClientTestCase, self).setUp()
-        self.http_client = CurlAsyncHTTPClient(self.io_loop)
+        self.http_client = CurlAsyncHTTPClient(self.io_loop,
+                                               defaults=dict(allow_ipv6=False))
 
     def get_app(self):
         return Application([
index 0ebdd8ddc3c966db0450131b28b585203f54a507..569ea872e1b0b83b9c1a4de406fa394210ea83e9 100644 (file)
@@ -310,7 +310,7 @@ Transfer-Encoding: chunked
         self.assertIs(exc_info[0][0], ZeroDivisionError)
 
     def test_configure_defaults(self):
-        defaults = dict(user_agent='TestDefaultUserAgent')
+        defaults = dict(user_agent='TestDefaultUserAgent', allow_ipv6=False)
         # Construct a new instance of the configured client class
         client = self.http_client.__class__(self.io_loop, force_instance=True,
                                             defaults=defaults)
index 786bbf9831f0540089f6bacf64add8ee78e4de49..37efc20505b0a98a72e027e8d62e1de5e9d1c41e 100644 (file)
@@ -91,7 +91,8 @@ if __name__ == '__main__':
     logging.getLogger("tornado.access").setLevel(logging.CRITICAL)
 
     define('httpclient', type=str, default=None,
-           callback=AsyncHTTPClient.configure)
+           callback=lambda s: AsyncHTTPClient.configure(
+               s, defaults=dict(allow_ipv6=False)))
     define('ioloop', type=str, default=None)
     define('ioloop_time_monotonic', default=False)
     define('resolver', type=str, default=None,