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 <mike.tutkowski@solidfire.com>
This commit is contained in:
Alex Brett 2014-09-02 18:05:48 +01:00 committed by Mike Tutkowski
parent ba41f230e1
commit 24dd6cee78

View File

@ -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)