Nir Soffer has posted comments on this change.

Change subject: storage: Refactor workarounds.detect_format
......................................................................


Patch Set 1: Code-Review-1

(3 comments)

https://gerrit.ovirt.org/#/c/64230/1/tests/storage_workarounds_test.py
File tests/storage_workarounds_test.py:

Line 28
Line 29
Line 30
Line 31
Line 32
Lets add a constants in the module for this, repeating this line in all the 
tests is painful.

    VM_CONF_SIZE = workarounds.VM_CONF_SIZE_BLK * sc.BLOCK_SIZE


Line 31: 
Line 32: 
Line 33: class DetectFormatTest(VdsmTestCase):
Line 34: 
Line 35:     def make_volume(self, env, size, src_md_fmt, src_qemu_fmt):
There is no src anymore, so we can use now:

    make_volume(env, size, md_fmt, real_fmt)
Line 36:         img_id = str(uuid.uuid4())
Line 37:         vol_id = str(uuid.uuid4())
Line 38:         env.make_volume(size, img_id, vol_id, vol_format=src_md_fmt)
Line 39:         vol = env.sd_manifest.produceVolume(img_id, vol_id)


Line 48:         """
Line 49:         size = workarounds.VM_CONF_SIZE_BLK * sc.BLOCK_SIZE
Line 50:         with fake_file_env() as env:
Line 51:             vol = self.make_volume(env, size, sc.COW_FORMAT,
Line 52:                                    qemuimg.FORMAT.RAW)
To make it more clear:

   vol = make_volume(env, size, md_fmt="qcow2", real_fmt="raw")
Line 53:             self.assertTrue(workarounds.mismatched_vm_conf_disk(vol))
Line 54: 
Line 55:     def test_bad_format_other_size(self):
Line 56:         """


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id7b2be176c474f9049d067f0a0c169644ac39899
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to