Пример #1
0
 def _vmdk_path_and_adapter_type_devices(self, filename, parent=None):
     # Test the adapter_type returned for a lsiLogic sas controller
     controller_key = 1000
     disk = fake.VirtualDisk()
     disk.controllerKey = controller_key
     disk_backing = fake.VirtualDiskFlatVer2BackingInfo()
     disk_backing.fileName = filename
     if parent:
         disk_backing.parent = parent
     disk.backing = disk_backing
     controller = fake.VirtualLsiLogicSASController()
     controller.key = controller_key
     devices = [disk, controller]
     return devices
Пример #2
0
 def test_get_vmdk_path_and_adapter_type(self):
     # Test the adapter_type returned for a lsiLogic sas controller
     controller_key = 1000
     filename = '[test_datastore] test_file.vmdk'
     disk = fake.VirtualDisk()
     disk.controllerKey = controller_key
     disk_backing = fake.VirtualDiskFlatVer2BackingInfo()
     disk_backing.fileName = filename
     disk.backing = disk_backing
     controller = fake.VirtualLsiLogicSASController()
     controller.key = controller_key
     devices = [disk, controller]
     vmdk_info = vm_util.get_vmdk_path_and_adapter_type(devices)
     adapter_type = vmdk_info[2]
     self.assertEqual('lsiLogicsas', adapter_type)