diff --git a/lisa/features/disks.py b/lisa/features/disks.py index 3e60f31bd7..c805ff7816 100644 --- a/lisa/features/disks.py +++ b/lisa/features/disks.py @@ -80,19 +80,35 @@ def get_os_boot_partition(self) -> Optional[PartitionInfo]: if partition.mount_point.startswith("/boot"): boot_partition = partition break + if "FreeBSD" in self._node.os.name: + output = self._node.execute("glabel status").stdout.split('\n') + for line in output: + if boot_partition.disk in line: + dev = line.split()[2] + self._node.log.info(f"disk mounted on: {dev}") + boot_partition.disk = dev + break return boot_partition # Get disk controller type from the VM by checking the boot partition def get_os_disk_controller_type(self) -> schema.DiskControllerType: boot_partition = self.get_os_boot_partition() assert boot_partition, "'boot_partition' must not be 'None'" - - if boot_partition.disk.startswith("nvme"): - os_disk_controller_type = schema.DiskControllerType.NVME - elif boot_partition.disk.startswith("sd"): - os_disk_controller_type = schema.DiskControllerType.SCSI + if "FreeBSD" in self._node.os.name: + self._node.log.info(f"boot disk: {boot_partition.disk}") + if boot_partition.disk.startswith("da"): + os_disk_controller_type = schema.DiskControllerType.SCSI + elif boot_partition.disk.startswith("nvd"): + os_disk_controller_type = schema.DiskControllerType.NVME + else: + raise LisaException(f"Unknown OS boot disk type {boot_partition.disk}") else: - raise LisaException(f"Unknown OS boot disk type {boot_partition.disk}") + if boot_partition.disk.startswith("nvme"): + os_disk_controller_type = schema.DiskControllerType.NVME + elif boot_partition.disk.startswith("sd"): + os_disk_controller_type = schema.DiskControllerType.SCSI + else: + raise LisaException(f"Unknown OS boot disk type {boot_partition.disk}") return os_disk_controller_type