diff options
author | Yury Selivanov <yury@magic.io> | 2016-09-15 19:45:07 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2016-09-15 19:45:07 (GMT) |
commit | 5587d7c071e5725d8aaf565b985441011cb1449f (patch) | |
tree | 4efe8a667f44053e0b94a3db91a33ef6d6ca48d4 /Lib/test | |
parent | a1b0e7db7315ff0d8d0f8edc056f387f198cf5a1 (diff) | |
download | cpython-5587d7c071e5725d8aaf565b985441011cb1449f.zip cpython-5587d7c071e5725d8aaf565b985441011cb1449f.tar.gz cpython-5587d7c071e5725d8aaf565b985441011cb1449f.tar.bz2 |
Issue #28174: Handle when SO_REUSEPORT isn't properly supported (asyncio)
Patch by Seth Michael Larson.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_asyncio/test_base_events.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index 0efdc20..43ebdc8 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -1371,6 +1371,17 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase): self.assertRaises(ValueError, self.loop.run_until_complete, f) @patch_socket + def test_create_server_soreuseport_only_defined(self, m_socket): + m_socket.getaddrinfo = socket.getaddrinfo + m_socket.socket.return_value = mock.Mock() + m_socket.SO_REUSEPORT = -1 + + f = self.loop.create_server( + MyProto, '0.0.0.0', 0, reuse_port=True) + + self.assertRaises(ValueError, self.loop.run_until_complete, f) + + @patch_socket def test_create_server_cant_bind(self, m_socket): class Err(OSError): |