tests: enable MSHV fw_cfg coverage

Re-enable the fw_cfg integration tests for MSHV now that port string I/O
is handled by the hypervisor backend.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
Assisted-by: Copilot:GPT-5.5
This commit is contained in:
Wei Liu
2026-06-10 07:55:33 -07:00
parent b3149e87fd
commit 027b1a4c46
2 changed files with 12 additions and 10 deletions

View File

@@ -12004,7 +12004,6 @@ mod fw_cfg {
use crate::*; use crate::*;
#[test] #[test]
#[cfg_attr(feature = "mshv", ignore = "See #7434")]
fn test_fw_cfg() { fn test_fw_cfg() {
let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string()); let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest = Guest::new(Box::new(disk_config)); let guest = Guest::new(Box::new(disk_config));
@@ -12052,7 +12051,6 @@ mod fw_cfg {
} }
#[test] #[test]
#[cfg_attr(feature = "mshv", ignore = "See #7434")]
fn test_fw_cfg_string() { fn test_fw_cfg_string() {
let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string()); let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
let guest = Guest::new(Box::new(disk_config)); let guest = Guest::new(Box::new(disk_config));

View File

@@ -296,7 +296,7 @@ impl MshvVcpu {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use mshv_bindings::hv_x64_io_port_access_info; use mshv_bindings::{hv_x64_intercept_message_header, hv_x64_io_port_access_info};
use super::*; use super::*;
@@ -319,11 +319,15 @@ mod tests {
.set_rep_prefix(rep_prefix as u8); .set_rep_prefix(rep_prefix as u8);
} }
let mut info = hv_x64_io_port_intercept_message::default(); hv_x64_io_port_intercept_message {
info.access_info = access_info; header: hv_x64_intercept_message_header {
info.header.intercept_access_type = access_type; intercept_access_type: access_type,
info.rcx = rcx; ..Default::default()
info },
access_info,
rcx,
..Default::default()
}
} }
#[test] #[test]
@@ -341,7 +345,7 @@ mod tests {
let bad_size = io_port_info(3, false, false, HV_INTERCEPT_ACCESS_READ as u8, 0); let bad_size = io_port_info(3, false, false, HV_INTERCEPT_ACCESS_READ as u8, 0);
let bad_access = io_port_info(1, false, false, 0xff, 0); let bad_access = io_port_info(1, false, false, 0xff, 0);
assert!(MshvVcpu::io_port_access_len(&bad_size).is_err()); MshvVcpu::io_port_access_len(&bad_size).unwrap_err();
assert!(MshvVcpu::io_port_is_write(&bad_access).is_err()); MshvVcpu::io_port_is_write(&bad_access).unwrap_err();
} }
} }