summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-12-19 12:27:40 +0000
committerGerrit Code Review <review@openstack.org>2012-12-19 12:27:40 +0000
commitb3540b094a3aff072dd497ec49fa4c8fae110d82 (patch)
tree31a25a6fec217e5569985dcd223c519ac72b4dec /nova/tests
parent1d864329c6c5320bde0cd30e3b39f2f93bbe9196 (diff)
parent921eec91abee56ea69e1b8b2bff59379b68bff87 (diff)
Merge "Fixed deleting instance booted from invalid vol"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_cinder.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/nova/tests/test_cinder.py b/nova/tests/test_cinder.py
index 3302aedb8..11d29a3ff 100644
--- a/nova/tests/test_cinder.py
+++ b/nova/tests/test_cinder.py
@@ -17,7 +17,9 @@
import httplib2
import urlparse
+from cinderclient import exceptions as cinder_exception
from nova import context
+from nova import exception
from nova.volume import cinder
from nova import test
@@ -77,6 +79,9 @@ class FakeHTTPClient(cinder.cinder_client.client.HTTPClient):
volume = {'volume': _stub_volume(id='1234')}
return (200, volume)
+ def get_volumes_nonexisting(self, **kw):
+ raise cinder_exception.NotFound(code=404, message='Resource not found')
+
class FakeCinderClient(cinder.cinder_client.Client):
@@ -146,3 +151,7 @@ class CinderTestCase(test.TestCase):
self.assertEquals(
self.fake_client_factory.client.client.management_url,
'http://other_host:8776/v1/project_id')
+
+ def test_get_non_existing_volume(self):
+ self.assertRaises(exception.VolumeNotFound, self.api.get, self.context,
+ 'nonexisting')