summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authoranimalize <animalize@users.noreply.github.com>2018-02-26 18:13:51 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2018-02-26 18:13:51 (GMT)
commit1278c21f5234477aab21531773d65ca7ebd1b81f (patch)
treef7a01b88c0d4a332ff95b8de42be55137695c336 /Lib
parentfbf7aac36bd1017bc87964b5d17dce0e101ff2d6 (diff)
downloadcpython-1278c21f5234477aab21531773d65ca7ebd1b81f.zip
cpython-1278c21f5234477aab21531773d65ca7ebd1b81f.tar.gz
cpython-1278c21f5234477aab21531773d65ca7ebd1b81f.tar.bz2
[3.6] bpo-32394: Remove some TCP options on older version Windows. (GH-5585)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_socket.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 0023762..faa4868 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -5583,6 +5583,24 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
with self.assertRaises(TypeError):
sock.sendmsg_afalg(op=socket.ALG_OP_ENCRYPT, assoclen=-1)
+@unittest.skipUnless(sys.platform.startswith("win"), "requires Windows")
+class TestMSWindowsTCPFlags(unittest.TestCase):
+ knownTCPFlags = {
+ # avaliable since long time ago
+ 'TCP_MAXSEG',
+ 'TCP_NODELAY',
+ # available starting with Windows 10 1607
+ 'TCP_FASTOPEN',
+ # available starting with Windows 10 1703
+ 'TCP_KEEPCNT',
+ }
+
+ def test_new_tcp_flags(self):
+ provided = [s for s in dir(socket) if s.startswith('TCP')]
+ unknown = [s for s in provided if s not in self.knownTCPFlags]
+
+ self.assertEqual([], unknown,
+ "New TCP flags were discovered. See bpo-32394 for more information")
def test_main():
tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest,
@@ -5639,6 +5657,7 @@ def test_main():
SendfileUsingSendTest,
SendfileUsingSendfileTest,
])
+ tests.append(TestMSWindowsTCPFlags)
thread_info = support.threading_setup()
support.run_unittest(*tests)