Change in vdsm[master]: tests: Add test_create_same_volume_in_image

alitke at redhat.com alitke at redhat.com
Tue Apr 26 13:39:41 UTC 2016


Adam Litke has uploaded a new change for review.

Change subject: tests: Add test_create_same_volume_in_image
......................................................................

tests: Add test_create_same_volume_in_image

Add a new test (which will be broken until support for creating child
volumes in an image is added) that verifies you are not allowed to
create another volume with the same ID in an image.

Change-Id: Iad8d28d0ce115e935001aac558469cf10cbd5bec
Signed-off-by: Adam Litke <alitke at redhat.com>
---
M tests/storage_volume_artifacts_test.py
1 file changed, 17 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/26/56626/1

diff --git a/tests/storage_volume_artifacts_test.py b/tests/storage_volume_artifacts_test.py
index 9f68057..35b8e41 100644
--- a/tests/storage_volume_artifacts_test.py
+++ b/tests/storage_volume_artifacts_test.py
@@ -22,6 +22,7 @@
 import uuid
 
 from testlib import VdsmTestCase
+from testValidation import brokentest
 from storagetestlib import fake_file_env
 
 from vdsm.storage import exception as se
@@ -102,6 +103,22 @@
             self.assertRaises(se.InvalidParameterException, second.create,
                               *BASE_RAW_PARAMS)
 
+    @brokentest("Broken until COW volume support is added")
+    def test_create_same_volume_in_image(self):
+        with self.fake_env() as env:
+            artifacts = env.sd_manifest.get_volume_artifacts(
+                self.img_id, self.vol_id)
+            artifacts.create(*BASE_RAW_PARAMS)
+            artifacts.commit()
+            artifacts = env.sd_manifest.get_volume_artifacts(
+                self.img_id, self.vol_id)
+            parent = storage.sdm.api.create_volume.ParentVolumeInfo(
+                dict(img_id=self.img_id, vol_id=self.vol_id))
+            params = BASE_COW_PARAMS + (parent,)
+
+            self.assertRaises(se.VolumeAlreadyExists,
+                              artifacts.create, *params)
+
     def test_new_image_create_and_commit(self):
         with self.fake_env() as env:
             artifacts = env.sd_manifest.get_volume_artifacts(


-- 
To view, visit https://gerrit.ovirt.org/56626
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad8d28d0ce115e935001aac558469cf10cbd5bec
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke at redhat.com>


More information about the vdsm-patches mailing list