Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
39708de
Support helpers for running on non-IPv4 IPv6-only hosts.
gpshead May 17, 2021
aa9e7c5
Fixes eight testsuites to work on IPv6-only hosts.
gpshead May 17, 2021
ee00e8b
Make test_support pass on IPv6 only.
gpshead May 18, 2021
29efd49
Make test_os work on IPv6-only.
gpshead May 18, 2021
d51dc79
fix test_telnetlib IPv6-only, introduce get_family helper.
gpshead May 18, 2021
0c95594
Fix test_urllib2_localnet for IPv6-only.
gpshead May 18, 2021
7938fdc
tcp_socket() to replace socket.socket() in tests.
gpshead May 18, 2021
6436757
make test_ssl pass on IPv6-only.
gpshead May 18, 2021
d752f1a
cleanup a bit.
gpshead May 18, 2021
b726756
Make test_httplib pass IPv6-only.
gpshead May 18, 2021
66054f4
Make test_wsgiref pass on IPv6-only.
gpshead May 18, 2021
f20c40a
fix test_smtplib for IPv6-only.
gpshead May 18, 2021
8859b2a
Fix test_poplib for IPv6-only.
gpshead May 18, 2021
d485dc3
Make test_asyncore IPv6-only friendly.
gpshead May 18, 2021
77ed056
make test_asynchat IPv6-only friendly.
gpshead May 18, 2021
99e0665
Add udp_socket(), use SkipTest.
gpshead May 18, 2021
03aac81
Allow test_socket to work on IPv6-only hosts.
gpshead May 18, 2021
56d179e
cleanup test names to clarify IPv4 status.
gpshead May 18, 2021
7d55a83
Add AF_INET6 support to multiprocessing IPC.
gpshead May 19, 2021
1a72129
Fix test_httpservers for IPv6-only hosts.
gpshead May 19, 2021
bc6d51a
If starting a logging config server on AF_INET fails, try AF_INET6.
gpshead May 19, 2021
1317e7a
Fix test_logging for use on IPv6-only hosts.
gpshead May 19, 2021
6d50fa5
Make test_xmlrpc work on IPv6-only hosts rather than hang.
gpshead May 19, 2021
be88847
Prevent test_asyncio from hanging on an IPv6-only host.
gpshead May 19, 2021
5d0f8d7
Fix test_asyncio.test_streams to work on IPv6-only.
gpshead May 19, 2021
0b556da
Fix socket_helper sock vs tempsock paste error..
gpshead May 19, 2021
b7688e4
socket_helper typo (yes, find_unused_port is too ugly...)
gpshead May 19, 2021
2965d32
Undo find_unused_port complexity, use get_family()
gpshead May 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test_urllib2_localnet for IPv6-only.
  • Loading branch information
gpshead committed May 18, 2021
commit 0c95594cd3104dc559ced4ea8954fec1e31e0221
2 changes: 2 additions & 0 deletions Lib/test/ssl_servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

class HTTPSServer(_HTTPServer):

address_family = socket_helper.get_family()

def __init__(self, server_address, handler_class, context):
_HTTPServer.__init__(self, server_address, handler_class)
self.context = context
Expand Down
8 changes: 5 additions & 3 deletions Lib/test/test_urllib2_localnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import hashlib

from test.support import hashlib_helper
from test.support import socket_helper
from test.support import threading_helper
from test.support import warnings_helper

Expand All @@ -30,6 +31,7 @@ class LoopbackHttpServer(http.server.HTTPServer):
"""HTTP server w/ a few modifications that make it useful for
loopback testing purposes.
"""
address_family = socket_helper.get_family()

def __init__(self, server_address, RequestHandlerClass):
http.server.HTTPServer.__init__(self,
Expand Down Expand Up @@ -60,7 +62,7 @@ def __init__(self, request_handler):
self._stop_server = False
self.ready = threading.Event()
request_handler.protocol_version = "HTTP/1.0"
self.httpd = LoopbackHttpServer(("127.0.0.1", 0),
self.httpd = LoopbackHttpServer((socket_helper.HOST, 0),
request_handler)
self.port = self.httpd.server_port

Expand Down Expand Up @@ -290,7 +292,7 @@ def http_server_with_basic_auth_handler(*args, **kwargs):
return BasicAuthHandler(*args, **kwargs)
self.server = LoopbackHttpServerThread(http_server_with_basic_auth_handler)
self.addCleanup(self.stop_server)
self.server_url = 'http://127.0.0.1:%s' % self.server.port
self.server_url = f'http://{socket_helper.HOST}:{self.server.port}'
self.server.start()
self.server.ready.wait()

Expand Down Expand Up @@ -346,7 +348,7 @@ def create_fake_proxy_handler(*args, **kwargs):
self.addCleanup(self.stop_server)
self.server.start()
self.server.ready.wait()
proxy_url = "http://127.0.0.1:%d" % self.server.port
proxy_url = f"http://{socket_helper.HOST}:{self.server.port}"
handler = urllib.request.ProxyHandler({"http" : proxy_url})
self.proxy_digest_handler = urllib.request.ProxyDigestAuthHandler()
self.opener = urllib.request.build_opener(
Expand Down