Change in vdsm[master]: storage: Add basic BlockVolumeArtifacts

alitke at redhat.com alitke at redhat.com
Wed Apr 13 16:20:22 UTC 2016


Adam Litke has posted comments on this change.

Change subject: storage: Add basic BlockVolumeArtifacts
......................................................................


Patch Set 2:

(6 comments)

https://gerrit.ovirt.org/#/c/55987/2/tests/storage_volume_artifacts_test.py
File tests/storage_volume_artifacts_test.py:

Line 103:                 self.img_id, str(uuid.uuid4()))
Line 104:             self.assertRaises(se.InvalidParameterException, second.create,
Line 105:                               *BASE_RAW_PARAMS)
Line 106: 
Line 107:     def test_create_same_volume_in_image(self):
look at using brokentest
Line 108:         with self.fake_env() as env:
Line 109:             artifacts = env.sd_manifest.get_volume_artifacts(
Line 110:                 self.img_id, self.vol_id)
Line 111:             artifacts.create(*BASE_RAW_PARAMS)


Line 138:             self.assertEqual(str(disk_type), vol.getDiskType())
Line 139: 
Line 140:     # Artifacts visibility
Line 141: 
Line 142:     def test_getallvolumes(self):
this test duplicates blocksdtests and filesdtests logic.
Line 143:         # Artifacts must not be recognized as volumes until commit is called.
Line 144:         with fake_file_env() as env:
Line 145:             self.assertEqual({}, env.sd_manifest.getAllVolumes())
Line 146:             artifacts = env.sd_manifest.get_volume_artifacts(


Line 140:     # Artifacts visibility
Line 141: 
Line 142:     def test_getallvolumes(self):
Line 143:         # Artifacts must not be recognized as volumes until commit is called.
Line 144:         with fake_file_env() as env:
use self.fake_env()
Line 145:             self.assertEqual({}, env.sd_manifest.getAllVolumes())
Line 146:             artifacts = env.sd_manifest.get_volume_artifacts(
Line 147:                     self.img_id, self.vol_id)
Line 148:             artifacts.create(*BASE_RAW_PARAMS)


Line 296:             artifacts.commit()
Line 297:             vol = env.sd_manifest.produceVolume(self.img_id, self.vol_id)
Line 298:             self.assertEqual(volume.PREALLOCATED_VOL, vol.getType())
Line 299: 
Line 300:     def validate_artifacts(self, artifacts, env):
put this at the end.
Line 301:         try:
Line 302:             lv = env.lvm.getLV(artifacts.sd_manifest.sdUUID, artifacts.vol_id)
Line 303:         except se.LogicalVolumeDoesNotExistError:
Line 304:             raise AssertionError("LV missing")


Line 305: 
Line 306:         if TEMP_VOL_LVTAG not in lv.tags:
Line 307:             raise AssertionError("Missing TEMP_VOL_LVTAG")
Line 308: 
Line 309:         # TODO: Validate lease and metadata allocation
Use VolumeArtifacts patches to validate the metadata block.

Use poison to validate lease area initialization.
Line 310: 
Line 311:     # Invalid use of artifacts
Line 312: 
Line 313:     def test_commit_without_create(self):


Line 322:             artifacts = env.sd_manifest.get_volume_artifacts(
Line 323:                     self.img_id, self.vol_id)
Line 324:             artifacts.create(*BASE_RAW_PARAMS)
Line 325:             artifacts.commit()
Line 326:             artifacts.commit()  # removing nonexistent tags is allowed
check the tag in commit and fail.
Line 327: 
Line 328: 
Line 329: class BlockVolumeArtifactVisibilityTests(VdsmTestCase):
Line 330: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I4120c557fc89d82cc6bc854a9fdc8935e53bc93d
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list