コード例 #1
0
    def _assertVmMatchesSpec(self, vm, spec):
        self.assertEqual(vm['vmId'], spec.uuid)
        self.assertEqual(vm['memSize'], 2048)
        self.assertEqual(vm['smp'], 1)
        self.assertEqual(len(vm['disks']), 1)
        self.assertEqual(len(vm['networks']), 1)
        self.assertEqual(vm['has_snapshots'], spec.has_snapshots)

        network = vm['networks'][0]
        self.assertEqual(network['type'], 'bridge')
        self.assertEqual(network['macAddr'], _mac_from_uuid(spec.uuid))
        self.assertEqual(network['bridge'], 'VM Network')
コード例 #2
0
ファイル: v2v_test.py プロジェクト: guozhonghua216/vdsm
    def _assertVmMatchesSpec(self, vm, spec):
        assert vm['vmId'] == spec.uuid
        assert vm['memSize'] == 2048
        assert vm['smp'] == 1
        assert len(vm['disks']) == \
            int(spec.has_disk_volume) + int(spec.has_disk_block)
        assert len(vm['networks']) == 1
        assert vm['has_snapshots'] == spec.has_snapshots

        network = vm['networks'][0]
        assert network['type'] == 'bridge'
        assert network['macAddr'] == _mac_from_uuid(spec.uuid)
        assert network['bridge'] == 'VM Network'