summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2014-07-21 22:35:01 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2014-07-21 22:35:01 (GMT)
commitdfab935c74745133234dded912ec1b0721888505 (patch)
tree540a0b5f299daec2c289fd5740dfd483c308f033
parent47ae763d2897bf8a2d11b6f7d49ef79df6ef92be (diff)
downloadcpython-dfab935c74745133234dded912ec1b0721888505.zip
cpython-dfab935c74745133234dded912ec1b0721888505.tar.gz
cpython-dfab935c74745133234dded912ec1b0721888505.tar.bz2
Issue #21976: Fix test_ssl to accept LibreSSL version strings.
Thanks to William Orr.
-rw-r--r--Lib/test/test_ssl.py16
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS3
3 files changed, 14 insertions, 6 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 2b3de1f..d1cf5b2 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -281,11 +281,11 @@ class BasicSocketTests(unittest.TestCase):
# Some sanity checks follow
# >= 0.9
self.assertGreaterEqual(n, 0x900000)
- # < 2.0
- self.assertLess(n, 0x20000000)
+ # < 3.0
+ self.assertLess(n, 0x30000000)
major, minor, fix, patch, status = t
self.assertGreaterEqual(major, 0)
- self.assertLess(major, 2)
+ self.assertLess(major, 3)
self.assertGreaterEqual(minor, 0)
self.assertLess(minor, 256)
self.assertGreaterEqual(fix, 0)
@@ -294,9 +294,13 @@ class BasicSocketTests(unittest.TestCase):
self.assertLessEqual(patch, 26)
self.assertGreaterEqual(status, 0)
self.assertLessEqual(status, 15)
- # Version string as returned by OpenSSL, the format might change
- self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major, minor, fix)),
- (s, t))
+ # Version string as returned by {Open,Libre}SSL, the format might change
+ if "LibreSSL" in s:
+ self.assertTrue(s.startswith("LibreSSL {:d}.{:d}".format(major, minor)),
+ (s, t))
+ else:
+ self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major, minor, fix)),
+ (s, t))
@support.cpython_only
def test_refcycle(self):
diff --git a/Misc/ACKS b/Misc/ACKS
index 0b55767..f7c6be3 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -981,6 +981,7 @@ Piet van Oostrum
Tomas Oppelstrup
Jason Orendorff
Douglas Orr
+William Orr
Michele OrrĂ¹
Oleg Oshmyan
Denis S. Otkidach
diff --git a/Misc/NEWS b/Misc/NEWS
index 08b3c6f..077b3a3 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -203,6 +203,9 @@ IDLE
Tests
-----
+- Issue #21976: Fix test_ssl to accept LibreSSL version strings. Thanks
+ to William Orr.
+
- Issue #21918: Converted test_tools from a module to a package containing
separate test files for each tested script.