From 24dd6cee78ec779498b532d5dbb5015490642129 Mon Sep 17 00:00:00 2001 From: Alex Brett Date: Tue, 2 Sep 2014 18:05:48 +0100 Subject: [PATCH] CLOUDSTACK-7467 Fix TestVolumes.test_07_resize_fail Previously if you had a volume using a non customisable disk offering, and attempted to resize it passing in the same disk offering id, the command would be accepted, but it would actually be resized to its current size (i.e. the provided size parameter was ignored). This is what the test used to check. Commit de6a3112b6b80952d1598acaa112ac50a3ef9d32 modified the logic to check if the provided diskofferingid was the same as the current one, and if so treat it as if it hadn't been provided - this means the resize command now fails, which is probably the more sensible thing to do (rather than giving the impression it will be resized but actually not doing so). This change therefore modifies the test logic to match. Signed-off-by: Mike Tutkowski --- test/integration/smoke/test_volumes.py | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index e2e0d76f2db..579b0ae5f2f 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -588,29 +588,11 @@ class TestVolumes(cloudstackTestCase): elif hosts[0].hypervisor.lower() in ("vmware", "hyperv"): self.skipTest("Resize Volume is unsupported on VmWare and Hyper-V") - self.apiClient.resizeVolume(cmd) - count = 0 - success = True - while count < 10: - list_volume_response = Volume.list( - self.apiClient, - id=self.volume.id, - type='DATADISK' - ) - for vol in list_volume_response: - if vol.id == self.volume.id and vol.size != currentSize and vol.state != "Resizing": - success = False - if success: - break - else: - time.sleep(1) - count += 1 + # Attempting to resize it should throw an exception, as we're using a non + # customisable disk offering, therefore our size parameter should be ignored + with self.assertRaises(Exception): + self.apiClient.resizeVolume(cmd) - self.assertEqual( - success, - True, - "Verify the volume did not resize" - ) if hosts[0].hypervisor == "XenServer": self.virtual_machine.start(self.apiClient) time.sleep(30)