From 8a2f1763cbadd47f6ce26467ac9f82bc9b436d2a Mon Sep 17 00:00:00 2001 From: Joshua McKenty Date: Thu, 24 Jun 2010 13:50:59 -0700 Subject: Create Volume should only take an integer between 0 and 1000 --- nova/volume/storage.py | 2 +- smoketests/smoketest.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nova/volume/storage.py b/nova/volume/storage.py index 1401aef1d..9c58358bd 100644 --- a/nova/volume/storage.py +++ b/nova/volume/storage.py @@ -90,7 +90,7 @@ class BlockStore(object): #TODO: aggregate the state of the system pass - @validate.rangetest(size=(0, 100)) + @validate.rangetest(size=(0, 1000)) def create_volume(self, size, user_id, project_id): """ Creates an exported volume (fake or real), diff --git a/smoketests/smoketest.py b/smoketests/smoketest.py index 26e167c8f..f7794a0ff 100644 --- a/smoketests/smoketest.py +++ b/smoketests/smoketest.py @@ -509,6 +509,10 @@ class VolumeTests(NovaTestCase): conn = self.connection_for(test_username) self.assertTrue(conn.delete_volume(data['volume_id'])) + def test_009_volume_size_must_be_int(self): + conn = self.connection_for(test_username) + self.assertRaises(Exception, conn.create_volume, 'foo', ZONE) + def test_999_tearDown(self): global data conn = self.connection_for(test_username) -- cgit