Shahar Havivi has uploaded a new change for review. Change subject: v2v: tests: rename vmid to UUID to match Libvirts domain property ......................................................................
v2v: tests: rename vmid to UUID to match Libvirts domain property Change-Id: I41abb2b7d7f5950e65710379a0655399014afd89 Signed-off-by: Shahar Havivi <[email protected]> --- M tests/v2vTests.py 1 file changed, 12 insertions(+), 12 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/16/51616/1 diff --git a/tests/v2vTests.py b/tests/v2vTests.py index 568aa4d..336614e 100644 --- a/tests/v2vTests.py +++ b/tests/v2vTests.py @@ -41,30 +41,30 @@ import vmfakelib as fake -VmSpec = namedtuple('VmSpec', ['name', 'vmid']) +VmSpec = namedtuple('VmSpec', ['name', 'uuid']) FAKE_VIRT_V2V = CommandPath('fake-virt-v2v', os.path.abspath('fake-virt-v2v')) -def _mac_from_uuid(vmid): +def _mac_from_uuid(uuid): return "52:54:%s:%s:%s:%s" % ( - vmid[:2], vmid[2:4], vmid[4:6], vmid[6:8]) + uuid[:2], uuid[2:4], uuid[4:6], uuid[6:8]) class MockVirDomain(object): def __init__(self, name="RHEL", - vmid="564d7cb4-8e3d-06ec-ce82-7b2b13c6a611"): + uuid="564d7cb4-8e3d-06ec-ce82-7b2b13c6a611"): self._name = name - self._vmid = vmid - self._mac_address = _mac_from_uuid(vmid) + self._uuid = uuid + self._mac_address = _mac_from_uuid(uuid) def name(self): return self._name - def id(self): - return self._vmid + def UUID(self): + return self._uuid def state(self, flags=0): return [5, 0] @@ -76,7 +76,7 @@ return """ <domain type='vmware' id='15'> <name>{name}</name> - <uuid>{vmid}</uuid> + <uuid>{uuid}</uuid> <memory unit='KiB'>2097152</memory> <currentMemory unit='KiB'>2097152</currentMemory> <vcpu placement='static'>1</vcpu> @@ -105,7 +105,7 @@ </devices> </domain>""".format( name=self._name, - vmid=self._vmid, + uuid=self._uuid, mac=self._mac_address) @@ -330,7 +330,7 @@ self.assertIn('allocation', disk) def _assertVmMatchesSpec(self, vm, spec): - self.assertEquals(vm['vmId'], spec.vmid) + self.assertEquals(vm['vmId'], spec.uuid) self.assertEquals(vm['memSize'], 2048) self.assertEquals(vm['smp'], 1) self.assertEquals(len(vm['disks']), 1) @@ -338,7 +338,7 @@ network = vm['networks'][0] self.assertEquals(network['type'], 'bridge') - self.assertEquals(network['macAddr'], _mac_from_uuid(spec.vmid)) + self.assertEquals(network['macAddr'], _mac_from_uuid(spec.uuid)) self.assertEquals(network['bridge'], 'VM Network') @MonkeyPatch(v2v, '_VIRT_V2V', FAKE_VIRT_V2V) -- To view, visit https://gerrit.ovirt.org/51616 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I41abb2b7d7f5950e65710379a0655399014afd89 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Shahar Havivi <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
