summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-09-13 00:07:52 +0000
committerGerrit Code Review <review@openstack.org>2012-09-13 00:07:52 +0000
commit40afdf46b9340d734c40c4c42d968d3017cc5cee (patch)
tree5813c2108f83c7f9ca7e997bffb62ba84676c15a /nova/tests
parent5bb5a10abc9d3731303e87f129256e331e6359b4 (diff)
parent0d2523f029b291817551e33fe15cd7ab33fe2102 (diff)
Merge "Stop fetch_ca from throwing IOError exceptions"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_crypto.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/nova/tests/test_crypto.py b/nova/tests/test_crypto.py
index c9ee6ca02..c725079d2 100644
--- a/nova/tests/test_crypto.py
+++ b/nova/tests/test_crypto.py
@@ -22,6 +22,7 @@ import mox
from nova import crypto
from nova import db
+from nova import exception
from nova import flags
from nova import test
from nova import utils
@@ -133,3 +134,21 @@ class RevokeCertsTest(test.TestCase):
self.mox.ReplayAll()
crypto.revoke_certs_by_project(project_id)
+
+
+class CertExceptionTests(test.TestCase):
+ def test_fetch_ca_file_not_found(self):
+ with utils.tempdir() as tmpdir:
+ self.flags(ca_path=tmpdir)
+ self.flags(use_project_ca=True)
+
+ self.assertRaises(exception.CryptoCAFileNotFound, crypto.fetch_ca,
+ project_id='fake')
+
+ def test_fetch_crl_file_not_found(self):
+ with utils.tempdir() as tmpdir:
+ self.flags(ca_path=tmpdir)
+ self.flags(use_project_ca=True)
+
+ self.assertRaises(exception.CryptoCRLFileNotFound,
+ crypto.fetch_crl, project_id='fake')