MCPcopy Create free account
hub / github.com/bootc-dev/bootc / test_find_kernel_uki

Function test_find_kernel_uki

crates/lib/src/kernel.rs:210–225  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

208
209 #[test]
210 fn test_find_kernel_uki() -> Result<()> {
211 let tempdir = cap_tempfile::tempdir(cap_std::ambient_authority())?;
212 tempdir.create_dir_all("boot/EFI/Linux")?;
213 tempdir.atomic_write("boot/EFI/Linux/fedora-6.12.0.efi", &create_minimal_pe())?;
214
215 let kernel_internal = find_kernel(&tempdir)?.expect("should find kernel");
216 assert_eq!(kernel_internal.kernel.version, "fedora-6.12.0");
217 assert!(kernel_internal.kernel.unified);
218 match &kernel_internal.k_type {
219 KernelType::Uki { path, .. } => {
220 assert_eq!(path.as_str(), "boot/EFI/Linux/fedora-6.12.0.efi");
221 }
222 KernelType::Vmlinuz { .. } => panic!("Expected Uki, got Vmlinuz"),
223 }
224 Ok(())
225 }
226
227 #[test]
228 fn test_find_kernel_uki_takes_precedence() -> Result<()> {

Callers

nothing calls this directly

Calls 2

create_minimal_peFunction · 0.85
find_kernelFunction · 0.85

Tested by

no test coverage detected