Shahar Havivi has posted comments on this change.
Change subject: v2v: add fake virt-v2v process for testing without virt-v2v
......................................................................
Patch Set 4:
(5 comments)
https://gerrit.ovirt.org/#/c/47738/4/tests/v2vTests.py
File tests/v2vTests.py:
Line 118:
Line 119:
Line 120: class FakeV2VCommand(object):
Line 121: def __init__(self):
Line 122: self.cmd = os.path.join(os.path.abspath('.'),
'fake-virt-v2v.py')
Use CommandPath class for this, specifying the path to
fake-virt-v2v.py
Done
Line 123:
Line 124:
Line 125: def hypervisorConnect(uri, username, passwd):
Line 126: return LibvirtMock()
Line 293: 'imageID': disk['imageID'],
Line 294: 'path': '/rhev/data-center/mydomain/images',
Line 295: 'volumeID': disk['volumeID']
Line 296: }
Line 297: self._prepared_volumes.append(drive)
You are duplicating ImportVm code here, touching internal
implementation de
The reason that I override prepare_volumes is for the
drive['path'] which prepare_volumes is setting.
I will change it by adding a FakeIrs class that fakes prepare_volumes and return the
path.
Line 298:
Line 299: @recorded
Line 300: def teardown_volumes(self):
Line 301: return 0
Line 314: 'volumeID':
Line 315: '00000000-0000-0000-0000-000000000004'}]}
Line 316: url =
'vpx://adminr%40vsphere@0.0.0.0/ovirt/0.0.0.0?no_verify=1'
Line 317: ivm = v2v.ImportVm.from_libvirt(url, 'root',
'mypassword', vminfo,
Line 318: self._id, None)
Pass FakeIRS instance here instead of None.
Done
Line 315: '00000000-0000-0000-0000-000000000004'}]}
Line 316: url =
'vpx://adminr%40vsphere@0.0.0.0/ovirt/0.0.0.0?no_verify=1'
Line 317: ivm = v2v.ImportVm.from_libvirt(url, 'root',
'mypassword', vminfo,
Line 318: self._id, None)
Line 319: ivm._import()
OK, run import, check that the import was successful. Would you name
this
Done
Line 315: '00000000-0000-0000-0000-000000000004'}]}
Line 316: url =
'vpx://adminr%40vsphere@0.0.0.0/ovirt/0.0.0.0?no_verify=1'
Line 317: ivm = v2v.ImportVm.from_libvirt(url, 'root',
'mypassword', vminfo,
Line 318: self._id, None)
Line 319: ivm._import()
Right, to be sure it is producing the expected output.
given
the same input that we send in this test we are getting the following output, do you mean
to compare to that long output?
['[ 0.0] Opening the source -i libvirt', '[ 1.0] Creating an overlay to
protect', '[ 2.0] Copying disk 1/2 to
/rhev/data-center/00000000-0000-0000-0000-000000000005/images/00000000-0000-0000-0000-
000000000001', ' (0/100%)', ' (1/100%)', ' (2/100%)',
' (3/100%)', ' (4/100%)', ' (5/100%)', '
(6/100%)', ' (7/100%)', ' (8/100%)', ' (9/100%)',
' (10/100%)', ' (11/100%)',
' (12/100%)', ' (13/100%)', ' (14/100%)', '
(15/100%)', ' (16/100%)', ' (17/100%)', ' (18/100%)',
' (19/100%)', ' (20/100%)', ' (21/100%)', '
(22/100%)', ' (23/100%)', ' (24/
100%)', ' (25/100%)', ' (26/100%)', ' (27/100%)',
' (28/100%)', ' (29/100%)', ' (30/100%)', '
(31/100%)', ' (32/100%)', ' (33/100%)', ' (34/100%)',
' (35/100%)', ' (36/100%)',
' (37/100%)', ' (38/100%)', ' (39/100%)', '
(40/100%)', ' (41/100%)', ' (42/100%)', ' (43/100%)',
' (44/100%)', ' (45/100%)', ' (46/100%)', '
(47/100%)', ' (48/100%)', ' (49/
100%)', ' (50/100%)', ' (51/100%)', ' (52/100%)',
' (53/100%)', ' (54/100%)', ' (55/100%)', '
(56/100%)', ' (57/100%)', ' (58/100%)', ' (59/100%)',
' (60/100%)', ' (61/100%)',
' (62/100%)', ' (63/100%)', ' (64/100%)', '
(65/100%)', ' (66/100%)', ' (67/100%)', ' (68/100%)',
' (69/100%)', ' (70/100%)', ' (71/100%)', '
(72/100%)', ' (73/100%)', ' (74/
100%)', ' (75/100%)', ' (76/100%)', ' (77/100%)',
' (78/100%)', ' (79/100%)', ' (80/100%)', '
(81/100%)', ' (82/100%)', ' (83/100%)', ' (84/100%)',
' (85/100%)', ' (86/100%)',
' (87/100%)', ' (88/100%)', ' (89/100%)', '
(90/100%)', ' (91/100%)', ' (92/100%)', ' (93/100%)',
' (94/100%)', ' (95/100%)', ' (96/100%)', '
(97/100%)', ' (98/100%)', ' (99/
100%)', ' (100/100%)', '[ 103.0] Creating output metadata', '[
103.0] Finishing off', '[ 103.0] Copying disk 2/2 to
/rhev/data-center/00000000-0000-0000-0000-000000000005/images/00000000-0000-0000-0000-
000000000003', ' (0/100%)', ' (1/100%)', ' (2/100%)',
' (3/100%)', ' (4/100%)', ' (5/100%)', '
(6/100%)', ' (7/100%)', ' (8/100%)', ' (9/100%)',
' (10/100%)', ' (11/100%)',
' (12/100%)', ' (13/100%)', ' (14/100%)', '
(15/100%)', ' (16/100%)', ' (17/100%)', ' (18/100%)',
' (19/100%)', ' (20/100%)', ' (21/100%)', '
(22/100%)', ' (23/100%)', ' (24/
100%)', ' (25/100%)', ' (26/100%)', ' (27/100%)',
' (28/100%)', ' (29/100%)', ' (30/100%)', '
(31/100%)', ' (32/100%)', ' (33/100%)', ' (34/100%)',
' (35/100%)', ' (36/100%)',
' (37/100%)', ' (38/100%)', ' (39/100%)', '
(40/100%)', ' (41/100%)', ' (42/100%)', ' (43/100%)',
' (44/100%)', ' (45/100%)', ' (46/100%)', '
(47/100%)', ' (48/100%)', ' (49/
100%)', ' (50/100%)', ' (51/100%)', ' (52/100%)',
' (53/100%)', ' (54/100%)', ' (55/100%)', '
(56/100%)', ' (57/100%)', ' (58/100%)', ' (59/100%)',
' (60/100%)', ' (61/100%)',
' (62/100%)', ' (63/100%)', ' (64/100%)', '
(65/100%)', ' (66/100%)', ' (67/100%)', ' (68/100%)',
' (69/100%)', ' (70/100%)', ' (71/100%)', '
(72/100%)', ' (73/100%)', ' (74/
100%)', ' (75/100%)', ' (76/100%)', ' (77/100%)',
' (78/100%)', ' (79/100%)', ' (80/100%)', '
(81/100%)', ' (82/100%)', ' (83/100%)', ' (84/100%)',
' (85/100%)', ' (86/100%)',
' (87/100%)', ' (88/100%)', ' (89/100%)', '
(90/100%)', ' (91/100%)', ' (92/100%)', ' (93/100%)',
' (94/100%)', ' (95/100%)', ' (96/100%)', '
(97/100%)', ' (98/100%)', ' (99/
100%)', ' (100/100%)', '[ 204.0] Creating output metadata', '[
204.0] Finishing off']
--
To view, visit
https://gerrit.ovirt.org/47738
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If062a1136921af19a2ffcb4d147611bbc9cf5464
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shavivi(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Shahar Havivi <shavivi(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes