summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2010-07-02 10:31:44 -0500
committerVishvananda Ishaya <vishvananda@gmail.com>2010-07-02 10:31:44 -0500
commit5e8337aec03f5a697c90779eb66a457aae4e7ae0 (patch)
tree2bb9c7366430d6c6cb09f486c5e4738ead20b0ad /nova/tests
parent7897135ec1f365b70db3df7411058b779005a1fe (diff)
parent6d612730c5e57d495dc281326c0169e8116ecd86 (diff)
downloadnova-5e8337aec03f5a697c90779eb66a457aae4e7ae0.tar.gz
nova-5e8337aec03f5a697c90779eb66a457aae4e7ae0.tar.xz
nova-5e8337aec03f5a697c90779eb66a457aae4e7ae0.zip
Merge patch 30001
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/storage_unittest.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/nova/tests/storage_unittest.py b/nova/tests/storage_unittest.py
index 73215c5ca..36fcc6f19 100644
--- a/nova/tests/storage_unittest.py
+++ b/nova/tests/storage_unittest.py
@@ -38,10 +38,7 @@ class StorageTestCase(test.TrialTestCase):
self.mystorage = None
self.flags(fake_libvirt=True,
fake_storage=True)
- if FLAGS.fake_storage:
- self.mystorage = storage.FakeBlockStore()
- else:
- self.mystorage = storage.BlockStore()
+ self.mystorage = storage.BlockStore()
def test_run_create_volume(self):
vol_size = '0'
@@ -65,6 +62,18 @@ class StorageTestCase(test.TrialTestCase):
self.mystorage.create_volume,
vol_size, user_id, project_id)
+ def test_too_many_volumes(self):
+ vol_size = '1'
+ user_id = 'fake'
+ project_id = 'fake'
+ num_shelves = FLAGS.last_shelf_id - FLAGS.first_shelf_id + 1
+ total_slots = FLAGS.slots_per_shelf * num_shelves
+ for i in xrange(total_slots):
+ self.mystorage.create_volume(vol_size, user_id, project_id)
+ self.assertRaises(storage.NoMoreVolumes,
+ self.mystorage.create_volume,
+ vol_size, user_id, project_id)
+
def test_run_attach_detach_volume(self):
# Create one volume and one node to test with
instance_id = "storage-test"