Lines Matching refs:lkp
61 static LoadKernelParams lkp; variable
150 memset(&lkp, 0, sizeof(lkp)); in ResetMocks()
151 lkp.nv_context = &vnc; in ResetMocks()
152 lkp.shared_data_blob = shared; in ResetMocks()
153 lkp.gbb_data = gbb; in ResetMocks()
154 lkp.gbb_size = sizeof(gbb_data); in ResetMocks()
155 lkp.bytes_per_lba = 512; in ResetMocks()
156 lkp.streaming_lba_count = 1024; in ResetMocks()
157 lkp.gpt_lba_count = 1024; in ResetMocks()
158 lkp.kernel_buffer = kernel_buffer; in ResetMocks()
159 lkp.kernel_buffer_size = sizeof(kernel_buffer); in ResetMocks()
160 lkp.disk_handle = (VbExDiskHandle_t)1; in ResetMocks()
531 lkp.bytes_per_lba = 0; in InvalidParamsTest()
532 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_PARAMETER, in InvalidParamsTest()
536 lkp.streaming_lba_count = 0; in InvalidParamsTest()
537 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_PARAMETER, in InvalidParamsTest()
541 lkp.bytes_per_lba = 128*1024; in InvalidParamsTest()
542 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_PARAMETER, in InvalidParamsTest()
547 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_NO_KERNEL_FOUND, in InvalidParamsTest()
552 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_NO_KERNEL_FOUND, in InvalidParamsTest()
556 lkp.gpt_lba_count = 0; in InvalidParamsTest()
557 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_NO_KERNEL_FOUND, in InvalidParamsTest()
562 lkp.disk_handle = NULL; in InvalidParamsTest()
563 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in InvalidParamsTest()
573 u = LoadKernel(&lkp, &cparams); in LoadKernelTest()
575 TEST_EQ(lkp.partition_number, 1, " part num"); in LoadKernelTest()
576 TEST_EQ(lkp.bootloader_address, 0xbeadd008, " bootloader addr"); in LoadKernelTest()
577 TEST_EQ(lkp.bootloader_size, 0x1234, " bootloader size"); in LoadKernelTest()
578 TEST_STR_EQ((char *)lkp.partition_guid, "FakeGuid", " guid"); in LoadKernelTest()
586 TEST_EQ(LoadKernel(&lkp, &cparams), 0, "Two good kernels"); in LoadKernelTest()
587 TEST_EQ(lkp.partition_number, 1, " part num"); in LoadKernelTest()
593 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_NO_KERNEL_FOUND, "No kernels"); in LoadKernelTest()
600 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, "Too small"); in LoadKernelTest()
606 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
611 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
616 lkp.boot_flags |= BOOT_FLAG_DEVELOPER; in LoadKernelTest()
618 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
623 lkp.boot_flags |= BOOT_FLAG_DEVELOPER; in LoadKernelTest()
625 TEST_EQ(LoadKernel(&lkp, &cparams), 0, "Succeed key block dev sig"); in LoadKernelTest()
629 lkp.boot_flags |= BOOT_FLAG_DEVELOPER; in LoadKernelTest()
633 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
640 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
646 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
650 lkp.boot_flags |= BOOT_FLAG_RECOVERY; in LoadKernelTest()
653 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
657 lkp.boot_flags |= BOOT_FLAG_RECOVERY | BOOT_FLAG_DEVELOPER; in LoadKernelTest()
660 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
665 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
670 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
675 TEST_EQ(LoadKernel(&lkp, &cparams), 0, "Key block version roll forward"); in LoadKernelTest()
682 TEST_EQ(LoadKernel(&lkp, &cparams), 0, "Two kernels roll forward"); in LoadKernelTest()
688 lkp.boot_flags |= BOOT_FLAG_DEVELOPER; in LoadKernelTest()
689 TEST_EQ(LoadKernel(&lkp, &cparams), 0, "Key version ignored in dev mode"); in LoadKernelTest()
693 lkp.boot_flags |= BOOT_FLAG_RECOVERY; in LoadKernelTest()
694 TEST_EQ(LoadKernel(&lkp, &cparams), 0, "Key version ignored in rec mode"); in LoadKernelTest()
698 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
703 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
708 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
713 lkp.boot_flags |= BOOT_FLAG_DEVELOPER; in LoadKernelTest()
714 TEST_EQ(LoadKernel(&lkp, &cparams), 0, "Kernel version ignored in dev mode"); in LoadKernelTest()
718 lkp.boot_flags |= BOOT_FLAG_RECOVERY; in LoadKernelTest()
719 TEST_EQ(LoadKernel(&lkp, &cparams), 0, "Kernel version ignored in rec mode"); in LoadKernelTest()
723 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
728 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
734 lkp.kernel_buffer = NULL; in LoadKernelTest()
735 TEST_EQ(LoadKernel(&lkp, &cparams), 0, "Get load address from preamble"); in LoadKernelTest()
736 TEST_PTR_EQ(lkp.kernel_buffer, kernel_buffer, " address"); in LoadKernelTest()
738 TEST_EQ(lkp.kernel_buffer_size, 70144, " size"); in LoadKernelTest()
741 lkp.kernel_buffer_size = 8192; in LoadKernelTest()
742 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
747 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
752 TEST_EQ(LoadKernel(&lkp, &cparams), 0, "Kernel tiny"); in LoadKernelTest()
756 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, in LoadKernelTest()
761 TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_KERNEL_FOUND, "Bad data"); in LoadKernelTest()
765 lkp.boot_flags |= BOOT_FLAG_EXTERNAL_GPT; in LoadKernelTest()
766 TEST_EQ(LoadKernel(&lkp, &cparams), 0, "Succeed external GPT"); in LoadKernelTest()