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

Function test_find_uki_path_sorted

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

Source from the content-addressed store, hash-verified

245
246 #[test]
247 fn test_find_uki_path_sorted() -> Result<()> {
248 let tempdir = cap_tempfile::tempdir(cap_std::ambient_authority())?;
249 tempdir.create_dir_all("boot/EFI/Linux")?;
250 tempdir.atomic_write("boot/EFI/Linux/zzz.efi", &create_minimal_pe())?;
251 tempdir.atomic_write("boot/EFI/Linux/aaa.efi", &create_minimal_pe())?;
252 tempdir.atomic_write("boot/EFI/Linux/mmm.efi", &create_minimal_pe())?;
253
254 // Should return first in sorted order
255 let path = find_uki_path(&tempdir)?.expect("should find uki");
256 assert_eq!(path.as_str(), "boot/EFI/Linux/aaa.efi");
257 Ok(())
258 }
259}

Callers

nothing calls this directly

Calls 2

create_minimal_peFunction · 0.85
find_uki_pathFunction · 0.85

Tested by

no test coverage detected