summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Silva <victsou@gmail.com>2014-09-23 23:27:48 -0300
committerRodrigo Duarte Sousa <rodrigods@lsd.ufcg.edu.br>2014-10-04 14:50:40 -0300
commit7d289eb79eef13e73f01a5a48df5ce1b576a8dc2 (patch)
tree9533fd4e43b4c6ad11111976b14542a4e837b5b3
parenteee5bd6f8148a59dc200b1cd4ad23dd5036e6b23 (diff)
downloadpython-keystoneclient-7d289eb79eef13e73f01a5a48df5ce1b576a8dc2.tar.gz
Explicit complaint about old OpenSSL when testing
Running the tests with an old version of OpenSSL results in many tests breaking without any hints of the real cause. This handles that explictly, stopping execution whenever the version is older than 1.0 and exiting with an informative message. Co-Authored-By: Rodrigo Duarte Sousa <rodrigods@lsd.ufcg.edu.br> Closes-Bug: 1225084 Change-Id: I55e151d3fb4ddbe5ee4bf64bfdc597b4da73f6bb
-rw-r--r--keystoneclient/tests/test_cms.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/keystoneclient/tests/test_cms.py b/keystoneclient/tests/test_cms.py
index 8cef987..9af3bd4 100644
--- a/keystoneclient/tests/test_cms.py
+++ b/keystoneclient/tests/test_cms.py
@@ -30,6 +30,18 @@ class CMSTest(utils.TestCase, testresources.ResourcedTestCase):
resources = [('examples', client_fixtures.EXAMPLES_RESOURCE)]
+ def __init__(self, *args, **kwargs):
+ super(CMSTest, self).__init__(*args, **kwargs)
+ process = subprocess.Popen(['openssl', 'version'],
+ stdout=subprocess.PIPE)
+ out, err = process.communicate()
+ # Example output: 'OpenSSL 0.9.8za 5 Jun 2014'
+ openssl_version = out.split()[1]
+
+ if err or openssl_version.startswith(b'0'):
+ raise Exception('Your version of OpenSSL is not supported. '
+ 'You will need to update it to 1.0 or later.')
+
def test_cms_verify(self):
self.assertRaises(exceptions.CertificateConfigError,
cms.cms_verify,