summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2012-12-07 11:21:11 -0600
committerBrian Waldon <bcwaldon@gmail.com>2012-12-11 14:46:33 -0800
commit4781da7007b69e63b18083ea58d46316201c6477 (patch)
tree428fa48249d07690e6fa8fdd080a9d23e7b5b046 /tests
parent2500e69b22c7291d1a01e86145ddfca87277ecd0 (diff)
downloadpython-glanceclient-4781da7007b69e63b18083ea58d46316201c6477.tar.gz
Support --os-cacert
* Rename --ca-file to --os-cacert (--ca-file deprecated for backward compatibility) * Add cacert to keystoneclient initialization to verify the keystone server certificate This aligns glanceclient with keystoneclient for option naming and the use of TLS for the keystone auth connection. It does not change the use of TLS/SSL for the glance connection. Change-Id: If8b05655aea5f3c62612d77bf947dd790f77eddf
Diffstat (limited to 'tests')
-rw-r--r--tests/test_ssl.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/test_ssl.py b/tests/test_ssl.py
index efe8851..14afcc6 100644
--- a/tests/test_ssl.py
+++ b/tests/test_ssl.py
@@ -33,12 +33,12 @@ class TestVerifiedHTTPSConnection(unittest.TestCase):
"""
key_file = os.path.join(TEST_VAR_DIR, 'privatekey.key')
cert_file = os.path.join(TEST_VAR_DIR, 'certificate.crt')
- ca_file = os.path.join(TEST_VAR_DIR, 'ca.crt')
+ cacert = os.path.join(TEST_VAR_DIR, 'ca.crt')
try:
conn = http.VerifiedHTTPSConnection('127.0.0.1', 0,
key_file=key_file,
cert_file=cert_file,
- ca_file=ca_file)
+ cacert=cacert)
except exc.SSLConfigurationError:
self.fail('Failed to init VerifiedHTTPSConnection.')
@@ -47,11 +47,11 @@ class TestVerifiedHTTPSConnection(unittest.TestCase):
Test VerifiedHTTPSConnection: absense of SSL key file.
"""
cert_file = os.path.join(TEST_VAR_DIR, 'certificate.crt')
- ca_file = os.path.join(TEST_VAR_DIR, 'ca.crt')
+ cacert = os.path.join(TEST_VAR_DIR, 'ca.crt')
try:
conn = http.VerifiedHTTPSConnection('127.0.0.1', 0,
cert_file=cert_file,
- ca_file=ca_file)
+ cacert=cacert)
self.fail('Failed to raise assertion.')
except exc.SSLConfigurationError:
pass
@@ -61,11 +61,11 @@ class TestVerifiedHTTPSConnection(unittest.TestCase):
Test VerifiedHTTPSConnection: absense of SSL cert file.
"""
key_file = os.path.join(TEST_VAR_DIR, 'privatekey.key')
- ca_file = os.path.join(TEST_VAR_DIR, 'ca.crt')
+ cacert = os.path.join(TEST_VAR_DIR, 'ca.crt')
try:
conn = http.VerifiedHTTPSConnection('127.0.0.1', 0,
key_file=key_file,
- ca_file=ca_file)
+ cacert=cacert)
except:
self.fail('Failed to init VerifiedHTTPSConnection.')
@@ -75,11 +75,11 @@ class TestVerifiedHTTPSConnection(unittest.TestCase):
"""
key_file = os.path.join(TEST_VAR_DIR, 'badkey.key')
cert_file = os.path.join(TEST_VAR_DIR, 'certificate.crt')
- ca_file = os.path.join(TEST_VAR_DIR, 'ca.crt')
+ cacert = os.path.join(TEST_VAR_DIR, 'ca.crt')
try:
conn = http.VerifiedHTTPSConnection('127.0.0.1', 0,
cert_file=cert_file,
- ca_file=ca_file)
+ cacert=cacert)
self.fail('Failed to raise assertion.')
except exc.SSLConfigurationError:
pass
@@ -90,11 +90,11 @@ class TestVerifiedHTTPSConnection(unittest.TestCase):
"""
key_file = os.path.join(TEST_VAR_DIR, 'privatekey.key')
cert_file = os.path.join(TEST_VAR_DIR, 'badcert.crt')
- ca_file = os.path.join(TEST_VAR_DIR, 'ca.crt')
+ cacert = os.path.join(TEST_VAR_DIR, 'ca.crt')
try:
conn = http.VerifiedHTTPSConnection('127.0.0.1', 0,
cert_file=cert_file,
- ca_file=ca_file)
+ cacert=cacert)
self.fail('Failed to raise assertion.')
except exc.SSLConfigurationError:
pass
@@ -105,11 +105,11 @@ class TestVerifiedHTTPSConnection(unittest.TestCase):
"""
key_file = os.path.join(TEST_VAR_DIR, 'privatekey.key')
cert_file = os.path.join(TEST_VAR_DIR, 'certificate.crt')
- ca_file = os.path.join(TEST_VAR_DIR, 'badca.crt')
+ cacert = os.path.join(TEST_VAR_DIR, 'badca.crt')
try:
conn = http.VerifiedHTTPSConnection('127.0.0.1', 0,
cert_file=cert_file,
- ca_file=ca_file)
+ cacert=cacert)
self.fail('Failed to raise assertion.')
except exc.SSLConfigurationError:
pass