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 <tall...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/af09388e Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/af09388e Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/af09388e Branch: refs/heads/hotfix/scp-exception Commit: af09388eda491a529e88ed62fb2c3d62fe554a4d Parents: a9c384f Author: Gaurav Aradhye <gaurav.arad...@clogeny.com> Authored: Tue Feb 10 21:21:05 2015 -0800 Committer: Srikanteswararao <tall...@apache.org> Committed: Wed Feb 11 16:53:08 2015 +0530 ---------------------------------------------------------------------- .../component/test_escalations_volumes.py | 4 +-- .../testpaths/testpath_volumelifecycle.py | 28 ++++++++++---------- tools/marvin/marvin/config/test_data.py | 15 +++++------ 3 files changed, 23 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/af09388e/test/integration/component/test_escalations_volumes.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_escalations_volumes.py b/test/integration/component/test_escalations_volumes.py index fe9d5e1..d650121 100644 --- a/test/integration/component/test_escalations_volumes.py +++ b/test/integration/component/test_escalations_volumes.py @@ -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") http://git-wip-us.apache.org/repos/asf/cloudstack/blob/af09388e/test/integration/testpaths/testpath_volumelifecycle.py ---------------------------------------------------------------------- diff --git a/test/integration/testpaths/testpath_volumelifecycle.py b/test/integration/testpaths/testpath_volumelifecycle.py index 6e56697..c55e366 100644 --- a/test/integration/testpaths/testpath_volumelifecycle.py +++ b/test/integration/testpaths/testpath_volumelifecycle.py @@ -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\ http://git-wip-us.apache.org/repos/asf/cloudstack/blob/af09388e/tools/marvin/marvin/config/test_data.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py index d5ed353..5596ddb 100644 --- a/tools/marvin/marvin/config/test_data.py +++ b/tools/marvin/marvin/config/test_data.py @@ -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": "", + }, } }