mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-8241: Moved upload volume dict data to configurableData section of the test_data.py file so that data can be changed according to the setup, also made relevant changes in the test cases
Signed-off-by: Srikanteswararao <talluri@apache.org>
This commit is contained in:
parent
a9c384fd17
commit
af09388eda
|
|
@ -1784,13 +1784,13 @@ class TestVolumes(cloudstackTestCase):
|
|||
# Uploading a Volume
|
||||
volume_uploaded = Volume.upload(
|
||||
self.userapiclient,
|
||||
self.services["upload_volume"],
|
||||
self.services["configurableData"]["upload_volume"],
|
||||
self.zone.id
|
||||
)
|
||||
self.assertIsNotNone(volume_uploaded, "volume uploading failed")
|
||||
|
||||
self.assertEquals(
|
||||
self.services["upload_volume"]["diskname"],
|
||||
self.services["configurableData"]["upload_volume"]["diskname"],
|
||||
volume_uploaded.name,
|
||||
"Uploaded volume name is not matching with name provided\
|
||||
while uploading")
|
||||
|
|
|
|||
|
|
@ -520,15 +520,15 @@ class TestPathVolume(cloudstackTestCase):
|
|||
# checking format of downloaded volume and assigning to
|
||||
# testdata["volume_upload"]
|
||||
if "OVA" in self.extract_volume.url.upper():
|
||||
self.testdata["upload_volume"]["format"] = "OVA"
|
||||
self.testdata["configurableData"]["upload_volume"]["format"] = "OVA"
|
||||
if "QCOW2" in self.extract_volume.url.upper():
|
||||
self.testdata["upload_volume"]["format"] = "QCOW2"
|
||||
self.testdata["configurableData"]["upload_volume"]["format"] = "QCOW2"
|
||||
# 6. Upload volume by providing url of downloaded volume in step 5
|
||||
self.upload_response = Volume.upload(
|
||||
self.userapiclient,
|
||||
zoneid=self.zone.id,
|
||||
url=self.extract_volume.url,
|
||||
services=self.testdata["upload_volume"])
|
||||
services=self.testdata["configurableData"]["upload_volume"])
|
||||
self.upload_response.wait_for_upload(self.userapiclient
|
||||
)
|
||||
self.debug("uploaded volume id is %s" % self.upload_response.id)
|
||||
|
|
@ -788,9 +788,9 @@ class TestPathVolume(cloudstackTestCase):
|
|||
raise Exception("Volume deletion failed with error %s" % e)
|
||||
# 16.Upload volume of size smaller than
|
||||
# storage.max.volume.upload.size(leaving the negative case)
|
||||
self.testdata["upload_volume"]["format"] = "VHD"
|
||||
self.testdata["configurableData"]["upload_volume"]["format"] = "VHD"
|
||||
volume_upload = Volume.upload(self.userapiclient,
|
||||
self.testdata["upload_volume"],
|
||||
self.testdata["configurableData"]["upload_volume"],
|
||||
zoneid=self.zone.id
|
||||
)
|
||||
volume_upload.wait_for_upload(self.userapiclient
|
||||
|
|
@ -984,24 +984,24 @@ class TestPathVolume(cloudstackTestCase):
|
|||
# 11.Upload the volume by providing the URL of the downloaded
|
||||
# volume, but specify a wrong format (not supported by the hypervisor)
|
||||
if "OVA" in self.extract_volume.url.upper():
|
||||
self.testdata["upload_volume"]["format"] = "VHD"
|
||||
self.testdata["configurableData"]["upload_volume"]["format"] = "VHD"
|
||||
else:
|
||||
self.testdata["upload_volume"]["format"] = "OVA"
|
||||
self.testdata["configurableData"]["upload_volume"]["format"] = "OVA"
|
||||
try:
|
||||
self.upload_response = Volume.upload(
|
||||
self.userapiclient,
|
||||
zoneid=self.zone.id,
|
||||
url=self.extract_volume.url,
|
||||
services=self.testdata["upload_volume"])
|
||||
services=self.testdata["configurableData"]["upload_volume"])
|
||||
self.fail("Volume got uploaded with invalid format")
|
||||
except Exception as e:
|
||||
self.debug("upload volume failed due %s" % e)
|
||||
# 12. Upload the same volume from T4 by providing a wrong URL
|
||||
self.testdata["upload_volume"]["format"] = "VHD"
|
||||
self.testdata["configurableData"]["upload_volume"]["format"] = "VHD"
|
||||
if "OVA" in self.extract_volume.url.upper():
|
||||
self.testdata["upload_volume"]["format"] = "OVA"
|
||||
self.testdata["configurableData"]["upload_volume"]["format"] = "OVA"
|
||||
if "QCOW2" in self.extract_volume.url.upper():
|
||||
self.testdata["upload_volume"]["format"] = "QCOW2"
|
||||
self.testdata["configurableData"]["upload_volume"]["format"] = "QCOW2"
|
||||
u1 = self.extract_volume.url.split('.')
|
||||
u1[-2] = "wrong"
|
||||
wrong_url = ".".join(u1)
|
||||
|
|
@ -1010,7 +1010,7 @@ class TestPathVolume(cloudstackTestCase):
|
|||
self.userapiclient,
|
||||
zoneid=self.zone.id,
|
||||
url=wrong_url,
|
||||
services=self.testdata["upload_volume"])
|
||||
services=self.testdata["configurableData"]["upload_volume"])
|
||||
self.upload_response.wait_for_upload(self.userapiclient
|
||||
)
|
||||
self.fail("volume got uploaded with wrong url")
|
||||
|
|
@ -1022,7 +1022,7 @@ class TestPathVolume(cloudstackTestCase):
|
|||
self.userapiclient,
|
||||
zoneid=self.zone.id,
|
||||
url=self.extract_volume.url,
|
||||
services=self.testdata["upload_volume"],
|
||||
services=self.testdata["configurableData"]["upload_volume"],
|
||||
checksome="123456")
|
||||
self.upload_response.wait_for_upload(self.userapiclient
|
||||
)
|
||||
|
|
@ -1061,7 +1061,7 @@ class TestPathVolume(cloudstackTestCase):
|
|||
self.userapiclient,
|
||||
zoneid=self.zone.id,
|
||||
url=self.extract_volume.url,
|
||||
services=self.testdata["upload_volume"])
|
||||
services=self.testdata["configurableData"]["upload_volume"])
|
||||
self.upload_response.wait_for_upload(self.userapiclient
|
||||
)
|
||||
self.fail("volume got uploaded after account reached max limit for\
|
||||
|
|
|
|||
|
|
@ -880,13 +880,6 @@ test_data = {
|
|||
"customdisksize": 1,
|
||||
"diskname": "Custom disk",
|
||||
},
|
||||
"upload_volume": {
|
||||
"diskname": "UploadVol",
|
||||
"format": "VHD",
|
||||
"url":
|
||||
"http://10.147.28.7/templates/393d3550-05ef-330f-9b8c-745b0e699759.vhd",
|
||||
"checksum": "",
|
||||
},
|
||||
"recurring_snapshot": {
|
||||
"maxsnaps": 2,
|
||||
"timezone": "US/Arizona",
|
||||
|
|
@ -1468,6 +1461,12 @@ test_data = {
|
|||
"ldapUsername": "",
|
||||
"ldapPassword": ""
|
||||
},
|
||||
"systemVmDelay": 120
|
||||
"systemVmDelay": 120,
|
||||
"upload_volume": {
|
||||
"diskname": "UploadVol",
|
||||
"format": "VHD",
|
||||
"url": "",
|
||||
"checksum": "",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue