mirror of
https://github.com/clearlinux/clr-boot-manager.git
synced 2026-09-01 02:34:42 +00:00
Add test for freestanding initrds in image mode
Verify that freestanding initrds are installed correctly in image mode.
This commit is contained in:
committed by
William Douglas
parent
ef77136fe1
commit
3ffaf5a658
@@ -412,6 +412,32 @@ START_TEST(bootman_uefi_initrd_freestandings)
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(bootman_uefi_initrd_freestandings_image)
|
||||
{
|
||||
autofree(BootManager) *m = NULL;
|
||||
autofree(char) *path_initrd = NULL;
|
||||
char *initrd_name = "00-initrd";
|
||||
|
||||
m = prepare_playground(&uefi_config);
|
||||
fail_if(!m, "Failed to prepare update playground");
|
||||
|
||||
path_initrd = string_printf("%s%s/%s",
|
||||
PLAYGROUND_ROOT,
|
||||
INITRD_DIRECTORY,
|
||||
initrd_name);
|
||||
|
||||
file_set_text(path_initrd, "Placeholder initrd");
|
||||
/* Validate image install */
|
||||
boot_manager_set_image_mode(m, true);
|
||||
fail_if(!boot_manager_enumerate_initrds_freestanding(m), "Failed to find freestanding initrd");
|
||||
|
||||
fail_if(!check_freestanding_initrds_available(m, initrd_name), "Failed reading from initrd path");
|
||||
fail_if(!boot_manager_update(m), "Failed to update image");
|
||||
fail_if(!check_initrd_file_exist(m, initrd_name), "Failed copying initrd file");
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
||||
/**
|
||||
* Ensure all blobs are removed for garbage collected kernels
|
||||
*/
|
||||
@@ -463,6 +489,7 @@ static Suite *core_suite(void)
|
||||
tcase_add_test(tc, bootman_uefi_namespace_migration);
|
||||
tcase_add_test(tc, bootman_uefi_ensure_removed);
|
||||
tcase_add_test(tc, bootman_uefi_initrd_freestandings);
|
||||
tcase_add_test(tc, bootman_uefi_initrd_freestandings_image);
|
||||
suite_add_tcase(s, tc);
|
||||
|
||||
/* Tests without kernel modules */
|
||||
|
||||
Reference in New Issue
Block a user