diff options
| author | Hermes Agent <hermes@localhost> | 2026-08-12 07:48:21 +0000 |
|---|---|---|
| committer | Hermes Agent <hermes@localhost> | 2026-08-12 07:48:21 +0000 |
| commit | f967d698efd44473a9285e02d0109f3bb0641622 (patch) | |
| tree | c94975571db9426cf71b15c9e6d16346e438c7c6 /tests/initramfs.rs | |
| parent | 5e6cae20331f8e7cfd551b4656f0de852a4ad44c (diff) | |
Format native builder and satisfy clippy
Diffstat (limited to 'tests/initramfs.rs')
| -rw-r--r-- | tests/initramfs.rs | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/tests/initramfs.rs b/tests/initramfs.rs index 429411a..5ad0b99 100644 --- a/tests/initramfs.rs +++ b/tests/initramfs.rs @@ -12,10 +12,8 @@ use tempfile::tempdir; fn discovers_the_single_rt_kernel_and_renders_a_sorted_oem_recipe() { let rootfs = tempdir().expect("rootfs directory"); fs::create_dir(rootfs.path().join("boot")).expect("boot directory"); - fs::write(rootfs.path().join("boot/vmlinuz-6.12.8-alt1.rt1"), "kernel") - .expect("RT kernel"); - fs::write(rootfs.path().join("boot/vmlinuz-6.12.8-alt1.std"), "kernel") - .expect("non-RT kernel"); + fs::write(rootfs.path().join("boot/vmlinuz-6.12.8-alt1.rt1"), "kernel").expect("RT kernel"); + fs::write(rootfs.path().join("boot/vmlinuz-6.12.8-alt1.std"), "kernel").expect("non-RT kernel"); let kernel = KernelVersion::discover_rt(rootfs.path()).expect("discover RT kernel"); assert_eq!(kernel.as_str(), "6.12.8-alt1.rt1"); @@ -59,8 +57,11 @@ fn make_initrd_adapter_uses_typed_chroot_arguments_and_records_output_digest() { let rootfs = tempdir().expect("rootfs directory"); fs::create_dir(rootfs.path().join("boot")).expect("boot directory"); fs::write(rootfs.path().join("boot/vmlinuz-6.12-rt1"), "kernel").expect("RT kernel"); - fs::write(rootfs.path().join("boot/initrd-6.12-rt1.img"), b"generated initrd") - .expect("generated initrd"); + fs::write( + rootfs.path().join("boot/initrd-6.12-rt1.img"), + b"generated initrd", + ) + .expect("generated initrd"); let request = InitramfsRequest::discover(rootfs.path()).expect("initramfs request"); let mut builder = MakeInitrdBuilder::new(RecordingRunner::default()); @@ -104,10 +105,19 @@ fn initramfs_adapter_refuses_to_replace_a_non_symlink_boot_alias() { let request = InitramfsRequest::discover(rootfs.path()).expect("initramfs request"); let mut builder = MakeInitrdBuilder::new(RecordingRunner::default()); - let error = builder.build(&request).expect_err("regular boot alias must be protected"); + let error = builder + .build(&request) + .expect_err("regular boot alias must be protected"); - assert!(error.to_string().contains("refusing to replace non-symlink boot alias")); - assert_eq!(fs::read_to_string(boot.join("initrd.img")).expect("protected alias"), "do not replace"); + assert!( + error + .to_string() + .contains("refusing to replace non-symlink boot alias") + ); + assert_eq!( + fs::read_to_string(boot.join("initrd.img")).expect("protected alias"), + "do not replace" + ); } #[derive(Debug, Default)] |