Shahar Havivi has uploaded a new change for review.
Change subject: v2v: add test for Xen block device ......................................................................
v2v: add test for Xen block device
Change-Id: I1afc7d21857e59ebf69856e99e15cc3796149e4e Signed-off-by: Shahar Havivi shaharh@redhat.com --- M tests/v2vTests.py 1 file changed, 28 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/63022/1
diff --git a/tests/v2vTests.py b/tests/v2vTests.py index 013a56a..7c1d5a9 100644 --- a/tests/v2vTests.py +++ b/tests/v2vTests.py @@ -84,6 +84,7 @@ self._id = id self._active = active self._has_snapshots = has_snapshots + self._disk_type = 'file'
def name(self): return self._name @@ -106,6 +107,9 @@ def isActive(self): return self._active
+ def setDiskType(self, disk_type): + self._disk_type = disk_type + def XMLDesc(self, flags=0): return """ <domain type='vmware' id='15'> @@ -122,7 +126,7 @@ <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <devices> - <disk type='file' device='disk'> + <disk type='{disk_type}' device='disk'> <source file='[datastore1] RHEL/RHEL_{name}.vmdk'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> @@ -140,6 +144,7 @@ </domain>""".format( name=self._name, uuid=self._uuid, + disk_type=self._disk_type, mac=self._mac_address)
def hasCurrentSnapshot(self): @@ -151,12 +156,16 @@
def __init__(self, vms): self._vms = vms + self._type = 'ESX'
def close(self): pass
+ def setType(self, type_name): + self._type = type_name + def getType(self): - return "ESX" + return self._type
def listAllDomains(self): return [vm for vm in self._vms] @@ -512,6 +521,23 @@ def testSuccessfulXenImport(self): self._commonConvertExternalVM(self.xen_url)
+ def testXenBlockDevice(self): + def _connect(uri, username, passwd): + self._vms[0].setDiskType('block') + conn = MockVirConnect(vms=self._vms) + conn.setType('Xen') + return conn + + with MonkeyPatchScope([(libvirtconnection, 'open_connection', + _connect)]): + vms = v2v.get_external_vms(self.xen_url, 'user', + ProtectedPassword('password'), + None)['vmList'] + + self._vms[0].setDiskType('block') + print '\n>>> %r\n' % self._vms[0] + self.assertEqual(len(vms), len(VM_SPECS) - 1) + @MonkeyPatch(v2v, '_VIRT_V2V', FAKE_VIRT_V2V) @MonkeyPatch(v2v, '_LOG_DIR', None) def testSuccessfulImportOVA(self):
gerrit-hooks has posted comments on this change.
Change subject: v2v: add test for Xen block device ......................................................................
Patch Set 1:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Shahar Havivi has posted comments on this change.
Change subject: v2v: add test for Xen block device ......................................................................
Patch Set 1: Verified+1
gerrit-hooks has posted comments on this change.
Change subject: v2v: add test for Xen block device ......................................................................
Patch Set 2:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Shahar Havivi has posted comments on this change.
Change subject: v2v: add test for Xen block device ......................................................................
Patch Set 2: Verified+1
Tomas Golembiovsky has posted comments on this change.
Change subject: v2v: add test for Xen block device ......................................................................
Patch Set 2: Code-Review+1
gerrit-hooks has posted comments on this change.
Change subject: v2v: add test for Xen block device ......................................................................
Patch Set 3:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Francesco Romani has posted comments on this change.
Change subject: v2v: add test for Xen block device ......................................................................
Patch Set 3: Code-Review-1
(1 comment)
just one update and we are good to go. -1 for visibility
https://gerrit.ovirt.org/#/c/63022/3/tests/v2vTests.py File tests/v2vTests.py:
Line 533: vms = v2v.get_external_vms(self.xen_url, 'user', Line 534: ProtectedPassword('password'), Line 535: None)['vmList'] Line 536: Line 537: self.assertEqual(len(vms), len(VM_SPECS) - 1) please check that the missing VM is the one you set the disk type as block. Let's avoid the (unlikely?) case of some other VM missing Line 538: Line 539: @MonkeyPatch(v2v, '_VIRT_V2V', FAKE_VIRT_V2V) Line 540: @MonkeyPatch(v2v, '_LOG_DIR', None) Line 541: def testSuccessfulImportOVA(self):
Shahar Havivi has posted comments on this change.
Change subject: v2v: add test for Xen block device ......................................................................
Patch Set 3:
(1 comment)
https://gerrit.ovirt.org/#/c/63022/3/tests/v2vTests.py File tests/v2vTests.py:
Line 533: vms = v2v.get_external_vms(self.xen_url, 'user', Line 534: ProtectedPassword('password'), Line 535: None)['vmList'] Line 536: Line 537: self.assertEqual(len(vms), len(VM_SPECS) - 1)
please check that the missing VM is the one you set the disk type as block.
Done Line 538: Line 539: @MonkeyPatch(v2v, '_VIRT_V2V', FAKE_VIRT_V2V) Line 540: @MonkeyPatch(v2v, '_LOG_DIR', None) Line 541: def testSuccessfulImportOVA(self):
gerrit-hooks has posted comments on this change.
Change subject: v2v: add test for Xen block device ......................................................................
Patch Set 4:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Shahar Havivi has posted comments on this change.
Change subject: v2v: add test for Xen block device ......................................................................
Patch Set 4: Verified+1
Francesco Romani has posted comments on this change.
Change subject: v2v: add test for Xen block device ......................................................................
Patch Set 4: Code-Review+2
Tomas Golembiovsky has posted comments on this change.
Change subject: v2v: add test for Xen block device ......................................................................
Patch Set 4: Code-Review+1
Dan Kenigsberg has submitted this change and it was merged.
Change subject: v2v: add test for Xen block device ......................................................................
v2v: add test for Xen block device
Change-Id: I1afc7d21857e59ebf69856e99e15cc3796149e4e Signed-off-by: Shahar Havivi shaharh@redhat.com Reviewed-on: https://gerrit.ovirt.org/63022 Tested-by: Shahar Havivi shavivi@redhat.com Continuous-Integration: Jenkins CI Reviewed-by: Francesco Romani fromani@redhat.com Reviewed-by: Tomas Golembiovsky tgolembi@redhat.com --- M tests/v2vTests.py 1 file changed, 27 insertions(+), 2 deletions(-)
Approvals: Shahar Havivi: Verified Jenkins CI: Passed CI tests Francesco Romani: Looks good to me, approved Tomas Golembiovsky: Looks good to me, but someone else must approve
gerrit-hooks has posted comments on this change.
Change subject: v2v: add test for Xen block device ......................................................................
Patch Set 5:
* Update tracker: IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org