-
Notifications
You must be signed in to change notification settings - Fork 123
petri: Disable secure boot by default for HyperV tests and introduce specific secureboot tests #1386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
petri: Disable secure boot by default for HyperV tests and introduce specific secureboot tests #1386
Changes from all commits
769124a
9b570b0
295f36c
fd217f2
13bf127
6b57eb9
90b3454
9c1f5f4
e0262a4
2602339
eea0e1e
f5864a3
95392fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,69 @@ async fn boot(config: Box<dyn PetriVmConfig>) -> anyhow::Result<()> { | |
Ok(()) | ||
} | ||
|
||
/// Basic boot test with secure boot enabled. | ||
#[vmm_test( | ||
openvmm_uefi_aarch64(vhd(ubuntu_2404_server_aarch64)), | ||
openvmm_uefi_x64(vhd(windows_datacenter_core_2022_x64)), | ||
openvmm_uefi_x64(vhd(ubuntu_2204_server_x64)), | ||
openvmm_openhcl_uefi_x64(vhd(windows_datacenter_core_2022_x64)), | ||
openvmm_openhcl_uefi_x64(vhd(ubuntu_2204_server_x64)), | ||
hyperv_uefi_aarch64(vhd(windows_11_enterprise_aarch64)), | ||
hyperv_uefi_aarch64(vhd(ubuntu_2404_server_aarch64)), | ||
hyperv_uefi_x64(vhd(windows_datacenter_core_2022_x64)), | ||
hyperv_uefi_x64(vhd(ubuntu_2204_server_x64)), | ||
hyperv_openhcl_uefi_aarch64(vhd(windows_11_enterprise_aarch64)), | ||
hyperv_openhcl_uefi_aarch64(vhd(ubuntu_2404_server_aarch64)), | ||
hyperv_openhcl_uefi_x64(vhd(windows_datacenter_core_2022_x64)), | ||
hyperv_openhcl_uefi_x64(vhd(ubuntu_2204_server_x64)) | ||
)] | ||
async fn secure_boot(config: Box<dyn PetriVmConfig>) -> anyhow::Result<()> { | ||
let (vm, agent) = config.with_secure_boot().run().await?; | ||
agent.power_off().await?; | ||
assert_eq!(vm.wait_for_teardown().await?, HaltReason::PowerOff); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is telling these vms to shut down? You probably need to add a call to enlightened_shutdown There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think i was missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nvm, discussed offline on the correct thought process. Ill update this comment with the correct thinking soon |
||
Ok(()) | ||
} | ||
|
||
/// Verify that Windows UEFI guests fail with a mismatched secure boot template. | ||
#[vmm_test( | ||
openvmm_uefi_x64(vhd(windows_datacenter_core_2022_x64)), | ||
openvmm_openhcl_uefi_x64(vhd(windows_datacenter_core_2022_x64)), | ||
hyperv_uefi_aarch64(vhd(windows_11_enterprise_aarch64)), | ||
hyperv_uefi_x64(vhd(windows_datacenter_core_2022_x64)), | ||
hyperv_openhcl_uefi_aarch64(vhd(windows_11_enterprise_aarch64)), | ||
hyperv_openhcl_uefi_x64(vhd(windows_datacenter_core_2022_x64)) | ||
)] | ||
async fn mismatched_secure_boot_template_windows( | ||
config: Box<dyn PetriVmConfig>, | ||
) -> anyhow::Result<()> { | ||
let mut vm = config.with_uefi_ca_template().run_without_agent().await?; | ||
assert_eq!(vm.wait_for_boot_event().await?, FirmwareEvent::BootFailed); | ||
assert_eq!(vm.wait_for_teardown().await?, HaltReason::PowerOff); | ||
Ok(()) | ||
} | ||
|
||
/// Verify that Linux UEFI guests fail with a mismatched secure boot template. | ||
#[vmm_test( | ||
openvmm_uefi_aarch64(vhd(ubuntu_2404_server_aarch64)), | ||
openvmm_uefi_x64(vhd(ubuntu_2204_server_x64)), | ||
openvmm_openhcl_uefi_x64(vhd(ubuntu_2204_server_x64)), | ||
hyperv_uefi_aarch64(vhd(ubuntu_2404_server_aarch64)), | ||
hyperv_uefi_x64(vhd(ubuntu_2204_server_x64)), | ||
hyperv_openhcl_uefi_aarch64(vhd(ubuntu_2404_server_aarch64)), | ||
hyperv_openhcl_uefi_x64(vhd(ubuntu_2204_server_x64)) | ||
)] | ||
async fn mismatched_secure_boot_template_linux( | ||
config: Box<dyn PetriVmConfig>, | ||
) -> anyhow::Result<()> { | ||
let mut vm = config | ||
.with_windows_secure_boot_template() | ||
.run_without_agent() | ||
.await?; | ||
assert_eq!(vm.wait_for_boot_event().await?, FirmwareEvent::BootFailed); | ||
assert_eq!(vm.wait_for_teardown().await?, HaltReason::PowerOff); | ||
Ok(()) | ||
} | ||
|
||
/// Basic boot test for guests that are expected to reboot | ||
// TODO: Remove this test and other enable Windows 11 ARM OpenVMM tests | ||
// once we figure out how to get the guest to not reboot via IMC or other | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have other tests with secure boot that can be removed/folded into this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, ill have to look around for these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as I know, looks like we don't have any other tests with secure boot explicitly?
I did notice
guest_test_uefi
multiarch test haswith_windows_secure_boot_template()
.My new
with_secure_boot()
could be used instead? But I'm not sure if, based on the OsFlavor forguest_test_uefi_x64
orguest_test_uefi_aarch64
what the correct secure boot template would be in this case-- must it be the windows template?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a test that verifies Linux fails to boot with the Windows secure boot template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should-- I'll add these negative tests next