Change in vdsm[master]: v2v: add test testSuccessfulImportOVA
shavivi at redhat.com
shavivi at redhat.com
Wed Dec 16 13:19:37 UTC 2015
Shahar Havivi has posted comments on this change.
Change subject: v2v: add test testSuccessfulImportOVA
......................................................................
Patch Set 1:
(3 comments)
https://gerrit.ovirt.org/#/c/50585/1/tests/v2vTests.py
File tests/v2vTests.py:
Line 359:
Line 360: self.assertEqual(ivm.status, v2v.STATUS.DONE)
Line 361:
Line 362: @contextmanager
Line 363: def temporary_ovf_dir(self):
> Better keep this in the module, as you don't need any of the state of this
Done
Line 364: with namedTemporaryDir() as base:
Line 365: ovfpath = os.path.join(base, 'testvm.ovf')
Line 366: ovapath = os.path.join(base, 'testvm.ova')
Line 367: ovf = read_ovf('test')
Line 370: ovffile.write(ovf)
Line 371: yield ovapath
Line 372:
Line 373: @MonkeyPatch(v2v, '_VIRT_V2V', FAKE_VIRT_V2V)
Line 374: @MonkeyPatch(v2v, '_V2V_DIR', tempfile.mkdtemp())
> You are creating a temporary directory but never delete it. Since you are n
Done
Line 375: def testSuccessfulImportOVA(self):
Line 376: with self.temporary_ovf_dir() as ovapath:
Line 377: command = v2v.OvaCommand(self.url,
Line 378: ovapath,
Line 376: with self.temporary_ovf_dir() as ovapath:
Line 377: command = v2v.OvaCommand(self.url,
Line 378: ovapath,
Line 379: self.vminfo, self.job_id, FakeIRS())
Line 380: ivm = v2v.ImportVm(self.job_id, command)
> You are duplicating v2v.convert_ova here, and because of this this code is
The reason that we didn't check the convert_external_vm and convert_ova is that we need to wait for the thread...
if we go with the api the method returns without checking anything.
Line 381: ivm.start()
Line 382: ivm.wait()
Line 383:
Line 384: self.assertEqual(ivm.status, v2v.STATUS.DONE)
--
To view, visit https://gerrit.ovirt.org/50585
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I465d68e5f42f6f5829d33bf62c2d40412a8aead4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list