Add edk2-stable202502 UEFI firmwares and try to first use firmwares from the ovmf package if installed. Fixes #2494

This commit is contained in:
grossmj committed 2025-04-18 17:13:29 +07:00
1 parent 684770a220
commit 2b7eb91694
5 files changed
+45 -13

No files matched your search

+9 -5
View File
@@ -396,16 +396,20 @@ async def test_uefi_boot_mode_option(vm, tmpdir, images_dir, fake_qemu_img_binar
vm._uefi = True
# create fake OVMF files
ovmf_code_path = os.path.join(images_dir, "OVMF_CODE.fd")
with open(ovmf_code_path, "w+") as f:
f.write('1')
ovmf_vars_path = os.path.join(images_dir, "OVMF_VARS.fd")
system_ovmf_firmware_path = "/usr/share/OVMF/OVMF_CODE_4M.fd"
if os.path.exists(system_ovmf_firmware_path):
ovmf_code_path = system_ovmf_firmware_path
else:
ovmf_code_path = os.path.join(images_dir, "OVMF_CODE_4M.fd")
with open(ovmf_code_path, "w+") as f:
f.write('1')
ovmf_vars_path = os.path.join(images_dir, "OVMF_VARS_4M.fd")
with open(ovmf_vars_path, "w+") as f:
f.write('1')
options = await vm._build_command()
assert ' '.join(["-drive", "if=pflash,format=raw,readonly,file={}".format(ovmf_code_path)]) in ' '.join(options)
assert ' '.join(["-drive", "if=pflash,format=raw,file={}".format(os.path.join(vm.working_dir, "OVMF_VARS.fd"))]) in ' '.join(options)
assert ' '.join(["-drive", "if=pflash,format=raw,file={}".format(os.path.join(vm.working_dir, "OVMF_VARS_4M.fd"))]) in ' '.join(options)
async def test_uefi_with_bios_image_already_configured(vm, tmpdir, fake_qemu_img_binary):