Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions Lib/test/test_asyncio/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ def test_sock_client_ops(self):
self._basetest_sock_recv_into(httpd, sock)

@support.skip_unless_bind_unix_socket
@unittest.skipIf(sys.platform == 'cygwin', 'cygwin has known bug')
def test_unix_sock_client_ops(self):
with test_utils.run_test_unix_server() as httpd:
sock = socket.socket(socket.AF_UNIX)
Expand Down Expand Up @@ -962,6 +963,7 @@ def _make_unix_server(self, factory, **kwargs):
return server, path

@support.skip_unless_bind_unix_socket
@unittest.skipIf(sys.platform == 'cygwin', 'cygwin has known bug')
def test_create_unix_server(self):
proto = MyProto(loop=self.loop)
server, path = self._make_unix_server(lambda: proto)
Expand Down Expand Up @@ -1055,6 +1057,7 @@ def test_create_server_ssl(self):

@support.skip_unless_bind_unix_socket
@unittest.skipIf(ssl is None, 'No ssl module')
@unittest.skipIf(sys.platform == 'cygwin', 'cygwin has known bug')
def test_create_unix_server_ssl(self):
proto = MyProto(loop=self.loop)
server, path = self._make_ssl_unix_server(
Expand Down Expand Up @@ -1115,6 +1118,7 @@ def test_create_server_ssl_verify_failed(self):

@support.skip_unless_bind_unix_socket
@unittest.skipIf(ssl is None, 'No ssl module')
@unittest.skipIf(sys.platform == 'cygwin', 'cygwin has known bug')
def test_create_unix_server_ssl_verify_failed(self):
proto = MyProto(loop=self.loop)
server, path = self._make_ssl_unix_server(
Expand Down Expand Up @@ -1173,6 +1177,7 @@ def test_create_server_ssl_match_failed(self):

@support.skip_unless_bind_unix_socket
@unittest.skipIf(ssl is None, 'No ssl module')
@unittest.skipIf(sys.platform == 'cygwin', 'cygwin has known bug')
def test_create_unix_server_ssl_verified(self):
proto = MyProto(loop=self.loop)
server, path = self._make_ssl_unix_server(
Expand Down
1 change: 1 addition & 0 deletions Lib/test/test_asyncio/test_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ def client(addr):
self.assertEqual(msg, b"hello world!\n")

@support.skip_unless_bind_unix_socket
@unittest.skipIf(sys.platform == 'cygwin', 'cygwin has known bug')
def test_start_unix_server(self):

class MyServer:
Expand Down
9 changes: 9 additions & 0 deletions Lib/test/test_asyncore.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ def bind_af_aware(sock, addr):
sock.bind(addr)


def setsock_no_peercred(sock):
if sys.platform == 'cygwin' and sock.family == socket.AF_UNIX:
sock.setsockopt(socket.SOL_SOCKET, socket.SO_PEERCRED, None, 0)



class HelperFunctionTests(unittest.TestCase):
def test_readwriteexc(self):
# Check exception handling behavior of read, write and _exception
Expand Down Expand Up @@ -469,6 +475,7 @@ class BaseServer(asyncore.dispatcher):
def __init__(self, family, addr, handler=BaseTestHandler):
asyncore.dispatcher.__init__(self)
self.create_socket(family)
setsock_no_peercred(self.socket)
self.set_reuse_addr()
bind_af_aware(self.socket, addr)
self.listen(5)
Expand All @@ -490,6 +497,7 @@ class BaseClient(BaseTestHandler):
def __init__(self, family, address):
BaseTestHandler.__init__(self)
self.create_socket(family)
setsock_no_peercred(self.socket)
self.connect(address)

def handle_connect(self):
Expand Down Expand Up @@ -550,6 +558,7 @@ class TestListener(BaseTestHandler):
def __init__(self, family, addr):
BaseTestHandler.__init__(self)
self.create_socket(family)
setsock_no_peercred(self.socket)
bind_af_aware(self.socket, addr)
self.listen(5)
self.address = self.socket.getsockname()
Expand Down